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