Re: [PATCH 2/6] vfs: propagate mnt_flags into do_loopback/vfsmount

From: Christoph Hellwig
Date: Sat Apr 01 2006 - 11:59:23 EST


On Fri, Jan 27, 2006 at 09:03:04PM +0100, Herbert Poetzl wrote:
>

Andrew, Linus any reason this still isn't in?

--

From: Herbert P?tzl <herbert@xxxxxxxxxxxx>

the mnt_flags are propagated into do_loopback(), so that
they can be stored with the vfsmount

Signed-off-by: Herbert P?tzl <herbert@xxxxxxxxxxxx>
Acked-by: Christoph Hellwig <hch@xxxxxxxxxxxxx>


diff -NurpP --minimal linux-2.6.16-rc1/fs/namespace.c linux-2.6.16-rc1-bme0.06.2-lo0.01/fs/namespace.c
--- linux-2.6.16-rc1/fs/namespace.c 2006-01-18 06:08:30 +0100
+++ linux-2.6.16-rc1-bme0.06.2-lo0.01/fs/namespace.c 2006-01-21 09:08:29 +0100
@@ -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 recurse = flags & MS_REC;
int err = mount_is_safe(nd);
+
if (err)
return err;
if (!old_name || !*old_name)
@@ -899,6 +901,7 @@ static int do_loopback(struct nameidata
spin_unlock(&vfsmount_lock);
release_mounts(&umount_list);
}
+ mnt->mnt_flags = mnt_flags;

out:
up_write(&namespace_sem);
@@ -1312,7 +1315,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)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/