Blame SOURCES/0097-mount-fix-all-and-nofail-return-code.patch

64664a
From d94c73b186ea4fec6333d1fb6cced1b4b8515d58 Mon Sep 17 00:00:00 2001
64664a
From: Karel Zak <kzak@redhat.com>
64664a
Date: Mon, 7 Apr 2014 11:53:05 +0200
64664a
Subject: [PATCH 097/116] mount: fix --all and nofail return code
64664a
64664a
Now the "nofail" affects warnings warning messages only. That's wrong
64664a
and regression (against original non-libmount version). The nofail has
64664a
to control return code too.
64664a
64664a
Upstream: https://github.com/karelzak/util-linux/commit/8ab82185eed76bc20694a197fe10c5f9fb795b80
64664a
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1357746
64664a
Reported-by: Patrick McLean <chutzpah@gentoo.org>
64664a
Signed-off-by: Karel Zak <kzak@redhat.com>
64664a
---
64664a
 sys-utils/mount.c | 10 ++++++----
64664a
 1 file changed, 6 insertions(+), 4 deletions(-)
64664a
64664a
diff --git a/sys-utils/mount.c b/sys-utils/mount.c
64664a
index f332070..44e2b7c 100644
64664a
--- a/sys-utils/mount.c
64664a
+++ b/sys-utils/mount.c
64664a
@@ -197,12 +197,14 @@ static int mount_all(struct libmnt_context *cxt)
64664a
 			if (mnt_context_is_verbose(cxt))
64664a
 				printf("%-25s: mount successfully forked\n", tgt);
64664a
 		} else {
64664a
-			mk_exit_code(cxt, mntrc);	/* to print warnings */
64664a
-
64664a
-			if (mnt_context_get_status(cxt)) {
64664a
+			if (mk_exit_code(cxt, mntrc) == MOUNT_EX_SUCCESS) {
64664a
 				nsucc++;
64664a
 
64664a
-				if (mnt_context_is_verbose(cxt))
64664a
+				/* Note that MOUNT_EX_SUCCESS return code does
64664a
+				 * not mean that FS has been really mounted
64664a
+				 * (e.g. nofail option) */
64664a
+				if (mnt_context_get_status(cxt) 
64664a
+				    && mnt_context_is_verbose(cxt))
64664a
 					printf("%-25s: successfully mounted\n", tgt);
64664a
 			} else
64664a
 				nerrs++;
64664a
-- 
64664a
2.9.3
64664a