dcavalca / rpms / util-linux

Forked from rpms/util-linux 2 years ago
Clone

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

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