Re: [systemd-devel] PATCH: handle rbind mount as bind mounts

2013-03-01 Thread Lennart Poettering
On Thu, 21.02.13 16:09, Frederic Crozat (fcro...@suse.com) wrote:

 Hi all,
 
 attached patch fixes bug reported recently about systemd not handling
 rbind mount as bind mount.

Applied! Thanks!

Lennart

-- 
Lennart Poettering - Red Hat, Inc.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] PATCH: handle rbind mount as bind mounts

2013-02-21 Thread Frederic Crozat
Hi all,

attached patch fixes bug reported recently about systemd not handling
rbind mount as bind mount.

Fix is straightforward.
-- 
Frederic Crozat fcro...@suse.com
SUSE
From df77b11852d6b3495848c4123e7cbd9f099910f9 Mon Sep 17 00:00:00 2001
From: Frederic Crozat fcro...@suse.com
Date: Thu, 21 Feb 2013 15:40:52 +0100
Subject: [PATCH] detect rbind as bind mount

Correctly detect rbind mount option as bind mount.
Fixes https://bugzilla.novell.com/show_bug.cgi?id=804575.
---
 src/core/mount.c  | 6 ++
 src/fstab-generator/fstab-generator.c | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/core/mount.c b/src/core/mount.c
index e3d298e..419cf27 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -329,6 +329,12 @@ static bool mount_is_bind(MountParameters *p) {
 if (p-fstype  streq(p-fstype, bind))
 return true;
 
+if (mount_test_option(p-options, rbind))
+return true;
+
+if (p-fstype  streq(p-fstype, rbind))
+return true;
+
 return false;
 }
 
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index bfedded..9db4123 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -178,7 +178,9 @@ static bool mount_is_bind(struct mntent *me) {
 
 return
 hasmntopt(me, bind) ||
-streq(me-mnt_type, bind);
+streq(me-mnt_type, bind) ||
+hasmntopt(me, rbind) ||
+streq(me-mnt_type, rbind);
 }
 
 static bool mount_is_network(struct mntent *me) {
-- 
1.8.1.1

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel