Re: [PATCH] fsck: list nonexistent devices that are declared without nofail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 02, 2010 at 02:26:58PM +0200, Serafeim Zanikolas wrote:
> fsck -A output does not indicate the offending device(s), when a device is
> nonexistent and declared without nofail (e2fsck doesn't mention anything, and
> dosfsck outputs just "No such file or directory")

 Hmm... I'd like to be conservative with this kind of warnings. The
 "nofail" option is relatively new and I guess that many people still
 successfully rely on the old behavior (because e2fsck doesn't mention
 anything ;-).

 I have applied the patch below -- it prints the warning if -V
 (verbose) option is specified.

    Karel


>From 236acf2d27b8f6e1de11f0fb35c78756837a6700 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@xxxxxxxxxx>
Date: Thu, 7 Oct 2010 09:26:37 +0200
Subject: [PATCH] fsck: inform about nonexistent devices in verbose mode

Reported-by: Serafeim Zanikolas <sez@xxxxxxxxxx>
Signed-off-by: Karel Zak <kzak@xxxxxxxxxx>
---
 fsck/fsck.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/fsck/fsck.c b/fsck/fsck.c
index e7526f9..7e1608f 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -887,10 +887,17 @@ static int ignore(struct fs_info *fs)
 	/*
 	 * ignore devices that don't exist and have the "nofail" mount option
 	 */
-	if (!device_exists(fs->device) && opt_in_list("nofail", fs->opts)) {
+	if (!device_exists(fs->device)) {
+		if (opt_in_list("nofail", fs->opts)) {
+			if (verbose)
+				printf(_("%s: skipping nonexistent device\n"),
+								fs->device);
+			return 1;
+		}
 		if (verbose)
-			printf(_("%s: skipping nonexistent device\n"), fs->device);
-		return 1;
+			printf(_("%s: nonexistent device (\"nofail\" fstab "
+				 "option may be used to skip this device)\n"),
+				 fs->device);
 	}
 
 	interpret_type(fs);
-- 
1.7.2.3

--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux