[Vserver] [PATCH 01/10] vfs: propagate mnt_flags into do_loopback/vfsmount

From: Sam Vilain <sam.vilain_at_catalyst.net.nz>
Date: Mon 27 Feb 2006 - 05:25:30 GMT
Message-Id: <20060227052529.21148.84055.stgit@wilber.wgtn.cat-it.co.nz>

From: Herbert Pötzl <herbert@13thfloor.at>

Previously, the do_loopback function took a single bit only out of the
mnt_flags in do_mount - the recurse bit.

We want to allow per-vfsmount flags, so to enable this we pass the
mnt_flags into do_loopback().

Add an extra parameter to the do_loopback function that sets up a
bind mount, that allows the value of vfsmount.mnt_flags to be set.

Signed-off-by: Herbert Pötzl <herbert@13thfloor.at>
Acked-by: Christoph Hellwig <hch@infradead.org>
Acked-by: Sam Vilain <sam.vilain@catalyst.net.nz>

---
 fs/namespace.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 058a448..1094e54 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -861,11 +861,13 @@ static int do_change_type(struct nameida
 /*
  * do loopback mount.
  */
-static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
+static int do_loopback(struct nameidata *nd, char *old_name,
+	unsigned long flags, int mnt_flags)
 {
 	struct nameidata old_nd;
 	struct vfsmount *mnt = NULL;
 	int err = mount_is_safe(nd);
+	int recurse = flags & MS_REC;
 	if (err)
 		return err;
 	if (!old_name || !*old_name)
@@ -891,6 +893,8 @@ static int do_loopback(struct nameidata 
 	if (!mnt)
 		goto out;
 
+	mnt->mnt_flags = mnt_flags;
+
 	err = graft_tree(mnt, nd);
 	if (err) {
 		LIST_HEAD(umount_list);
@@ -1312,7 +1316,7 @@ long do_mount(char *dev_name, char *dir_
 		retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
 				    data_page);
 	else if (flags & MS_BIND)
-		retval = do_loopback(&nd, dev_name, flags & MS_REC);
+		retval = do_loopback(&nd, dev_name, flags, mnt_flags);
 	else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
 		retval = do_change_type(&nd, flags);
 	else if (flags & MS_MOVE)
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Mon Feb 27 05:37:30 2006
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 27 Feb 2006 - 05:37:32 GMT by hypermail 2.1.8