]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck: use FS blacklist for non-all mode too
authorKarel Zak <kzak@redhat.com>
Wed, 2 Nov 2011 14:51:45 +0000 (15:51 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 2 Nov 2011 14:51:45 +0000 (15:51 +0100)
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
fsck/fsck.c

index 747a3450e9d444a6470e3c261531071f7d1120a8..8ac43bea42b985a8edbe91021c5e5ac0532269c6 100644 (file)
 #include "xalloc.h"
 
 static const char *ignored_types[] = {
+       "9p",
+       "afs",
+       "autofs",
+       "binfmt_misc",
+       "cgroup",
+       "cifs",
+       "cpuset",
+       "debugfs",
+       "devfs",
+       "devpts",
+       "devtmpfs",
+       "dlmfs",
+       "fusectl",
+       "fuse.gvfs-fuse-daemon",
+       "hugetlbfs",
        "ignore",
        "iso9660",
+       "mqueue"
+       "ncpfs",
        "nfs",
        "proc",
+       "rpc_pipefs",
+       "securityfs",
+       "smbfs",
+       "spufs",
        "sw",
        "swap",
+       "sysfs",
        "tmpfs",
-       "devpts",
        NULL
 };
 
@@ -953,6 +974,18 @@ static int device_exists(const char *device)
        return 1;
 }
 
+static int ignored_type(const char *fstype)
+{
+       const char **ip;
+
+       for(ip = ignored_types; *ip; ip++) {
+               if (strcmp(fstype, *ip) == 0)
+                       return 1;
+       }
+
+       return 0;
+}
+
 /* Check if we should ignore this filesystem. */
 static int ignore(struct fs_info *fs)
 {
@@ -1000,8 +1033,8 @@ static int ignore(struct fs_info *fs)
        if (!fs_match(fs, &fs_type_compiled)) return 1;
 
        /* Are we ignoring this type? */
-       for(ip = ignored_types; *ip; ip++)
-               if (strcmp(fs->type, *ip) == 0) return 1;
+       if (fs->type && ignored_type(fs->type))
+               return 1;
 
        /* Do we really really want to check this fs? */
        for(ip = really_wanted; *ip; ip++)
@@ -1461,7 +1494,9 @@ int main(int argc, char *argv[])
                                              0, -1, -1);
                        if (!fs)
                                continue;
-               }
+               } else if (fs->type && ignored_type(fs->type))
+                       continue;
+
                if (ignore_mounted && is_mounted(fs->device))
                        continue;
                status |= fsck_device(fs, interactive);