Blame SOURCES/0160-libmount-fix-mnt_table_is_fs_mounted-for-rbind.patch

05ad79
From 7f5f61824b3b7ffa81d34481aec5a7ecca213a5a Mon Sep 17 00:00:00 2001
05ad79
From: Karel Zak <kzak@redhat.com>
05ad79
Date: Wed, 3 Jan 2018 13:59:59 +0100
05ad79
Subject: [PATCH 160/173] libmount: fix mnt_table_is_fs_mounted() for rbind
05ad79
05ad79
There is no difference between "bind" and "rbind" if we want to FS
05ad79
root to search for the FS in mountinfo file.
05ad79
05ad79
fstab:
05ad79
05ad79
 /dev/sdc1       /mnt/foo        xfs     defaults        0 0
05ad79
 /mnt/foo        /mnt/test       none    rw,rbind        0 0
05ad79
05ad79
use -a more than once:
05ad79
05ad79
  mount -a
05ad79
  mount -a
05ad79
05ad79
/proc/mounts (the current result):
05ad79
05ad79
 /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0
05ad79
 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0
05ad79
 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0
05ad79
 /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0
05ad79
05ad79
expected (fixed version) result:
05ad79
05ad79
 /dev/sdc1 /mnt/foo xfs rw,relatime,attr2,inode64,noquota 0 0
05ad79
 /dev/sdc1 /mnt/test xfs rw,relatime,attr2,inode64,noquota 0 0
05ad79
05ad79
Upstream: http://github.com/karelzak/util-linux/commit/b5cc232362a60b2a7738ee250609202bd6195e49
05ad79
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1528959
05ad79
Signed-off-by: Karel Zak <kzak@redhat.com>
05ad79
---
05ad79
 libmount/src/tab.c | 3 ++-
05ad79
 1 file changed, 2 insertions(+), 1 deletion(-)
05ad79
05ad79
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
05ad79
index 5628da6e5..dfa1da822 100644
05ad79
--- a/libmount/src/tab.c
05ad79
+++ b/libmount/src/tab.c
05ad79
@@ -1099,7 +1099,8 @@ int mnt_table_is_fs_mounted(struct libmnt_table *tb, struct libmnt_fs *fstab_fs)
05ad79
 		struct libmnt_fs *rootfs;
05ad79
 		int flags = 0;
05ad79
 
05ad79
-		if (mnt_fs_get_option(fstab_fs, "bind", NULL, NULL) == 0)
05ad79
+		if (mnt_fs_get_option(fstab_fs, "bind", NULL, NULL) == 0 ||
05ad79
+		    mnt_fs_get_option(fstab_fs, "rbind", NULL, NULL) == 0)
05ad79
 			flags = MS_BIND;
05ad79
 
05ad79
 		rootfs = mnt_table_get_fs_root(tb, fstab_fs, flags, &root);
05ad79
-- 
05ad79
2.14.4
05ad79