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

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