3
0
forked from pool/util-linux
util-linux/fsck-use-FS-blacklist-for-non-all-mode-too.patch

95 lines
2.1 KiB
Diff

From e31741980762744352890d37522cbf4dd0ced9c4 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Wed, 2 Nov 2011 15:51:45 +0100
Subject: [PATCH] fsck: use FS blacklist for non-all mode too
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
---
fsck/fsck.c | 43 +++++++++++++++++++++++++++++++++++++++----
1 files changed, 39 insertions(+), 4 deletions(-)
Index: util-linux-2.20.1/fsck/fsck.c
===================================================================
--- util-linux-2.20.1.orig/fsck/fsck.c
+++ util-linux-2.20.1/fsck/fsck.c
@@ -57,14 +57,35 @@
#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 *dev
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);