Commit f6422f17 authored by Herbert Poetzl's avatar Herbert Poetzl Committed by Linus Torvalds

[PATCH] vfs: propagate mnt_flags into do_loopback/vfsmount

The mnt_flags are propagated into do_loopback(), so that they can be stored
with the vfsmount
Signed-off-by: default avatarHerbert Poetzl <herbert@13thfloor.at>
Acked-by: default avatarChristoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent fb5035db
...@@ -899,11 +899,13 @@ static int do_change_type(struct nameidata *nd, int flag) ...@@ -899,11 +899,13 @@ static int do_change_type(struct nameidata *nd, int flag)
/* /*
* do loopback mount. * 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 nameidata old_nd;
struct vfsmount *mnt = NULL; struct vfsmount *mnt = NULL;
int recurse = flags & MS_REC;
int err = mount_is_safe(nd); int err = mount_is_safe(nd);
if (err) if (err)
return err; return err;
if (!old_name || !*old_name) if (!old_name || !*old_name)
...@@ -937,6 +939,7 @@ static int do_loopback(struct nameidata *nd, char *old_name, int recurse) ...@@ -937,6 +939,7 @@ static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
spin_unlock(&vfsmount_lock); spin_unlock(&vfsmount_lock);
release_mounts(&umount_list); release_mounts(&umount_list);
} }
mnt->mnt_flags = mnt_flags;
out: out:
up_write(&namespace_sem); up_write(&namespace_sem);
...@@ -1350,7 +1353,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, ...@@ -1350,7 +1353,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags,
data_page); data_page);
else if (flags & MS_BIND) 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)) else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE))
retval = do_change_type(&nd, flags); retval = do_change_type(&nd, flags);
else if (flags & MS_MOVE) else if (flags & MS_MOVE)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment