Commit eee391a6 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] revert "vfs: propagate mnt_flags into do_loopback/vfsmount"

Revert commit f6422f17, due to

Valdis.Kletnieks@vt.edu wrote:
>
> There seems to have been a bug introduced in this changeset:
>
> Am running 2.6.17-rc3-mm1.  When this changeset is applied, 'mount --bind'
> misbehaves:
>
> > # mkdir /foo
> > # mount -t tmpfs -o rw,nosuid,nodev,noexec,noatime,nodiratime none /foo
> > # mkdir /foo/bar
> > # mount --bind /foo/bar /foo
> > # tail -2 /proc/mounts
> > none /foo tmpfs rw,nosuid,nodev,noexec,noatime,nodiratime 0 0
> > none /foo tmpfs rw 0 0
>
> Reverting this changeset causes both mounts to have the same options.
>
> (Thanks to Stephen Smalley for tracking down the changeset...)
>

Cc: Herbert Poetzl <herbert@13thfloor.at>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: <Valdis.Kletnieks@vt.edu>
Cc: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent be6e028b
...@@ -899,13 +899,11 @@ static int do_change_type(struct nameidata *nd, int flag) ...@@ -899,13 +899,11 @@ 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, unsigned long flags, int mnt_flags) static int do_loopback(struct nameidata *nd, char *old_name, int recurse)
{ {
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)
...@@ -939,7 +937,6 @@ static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags ...@@ -939,7 +937,6 @@ static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags
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);
...@@ -1353,7 +1350,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, ...@@ -1353,7 +1350,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, mnt_flags); retval = do_loopback(&nd, dev_name, flags & MS_REC);
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