So far a check for unsupported filesystem was in the mount_add_list
which was simply stopping mount from being added to the global list.
This resulted in mount_dev_add continuously not being able to find a
mount for the given block device and trying to add it over and over.
That was non-optimal becuse with unsupported filesystem present the
code was checking all its parameters every second.
Fix this by:
1) Moving check out of the mount_add_list to keep all logic in the
caller function.
2) Adding mount with ignore=1 for unsupported filesystem instead of
ignoring it.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: John Crispin <john@phrozen.org>
{
struct mount *mount;
char tmp[64], tmp2[64];
{
struct mount *mount;
char tmp[64], tmp2[64];
- if(fs <= MBR || fs > LASTFS)
- return;
mount = malloc(sizeof(struct mount));
INIT_LIST_HEAD(&mount->list);
strncpy(mount->vendor, vendor, 64);
mount = malloc(sizeof(struct mount));
INIT_LIST_HEAD(&mount->list);
strncpy(mount->vendor, vendor, 64);
char sector_size[64];
FILE *fp;
int offset = 3;
char sector_size[64];
FILE *fp;
int offset = 3;
strcpy(name, dev);
if (!strncmp(name, "mmcblk", 6))
strcpy(name, dev);
if (!strncmp(name, "mmcblk", 6))
fclose(fp);
}
snprintf(tmp, 64, "/dev/%s", dev);
fclose(fp);
}
snprintf(tmp, 64, "/dev/%s", dev);
- mount_add_list(node, dev, s, vendor, model, rev, ignore, size, sector_size, detect_fs(tmp));
+ fs = detect_fs(tmp);
+ if (fs <= MBR || fs > LASTFS) {
+ ignore = 1;
+ }
+ mount_add_list(node, dev, s, vendor, model, rev, ignore, size, sector_size, fs);
mount_dump_uci_state();
}
}
mount_dump_uci_state();
}
}