diff options
-rw-r--r-- | fs/namespace.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index bf478addb852..2c5f1f80bdc2 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -899,11 +899,13 @@ static int do_change_type(struct nameidata *nd, int flag) | |||
899 | /* | 899 | /* |
900 | * do loopback mount. | 900 | * do loopback mount. |
901 | */ | 901 | */ |
902 | static int do_loopback(struct nameidata *nd, char *old_name, int recurse) | 902 | static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags, int mnt_flags) |
903 | { | 903 | { |
904 | struct nameidata old_nd; | 904 | struct nameidata old_nd; |
905 | struct vfsmount *mnt = NULL; | 905 | struct vfsmount *mnt = NULL; |
906 | int recurse = flags & MS_REC; | ||
906 | int err = mount_is_safe(nd); | 907 | int err = mount_is_safe(nd); |
908 | |||
907 | if (err) | 909 | if (err) |
908 | return err; | 910 | return err; |
909 | if (!old_name || !*old_name) | 911 | if (!old_name || !*old_name) |
@@ -937,6 +939,7 @@ static int do_loopback(struct nameidata *nd, char *old_name, int recurse) | |||
937 | spin_unlock(&vfsmount_lock); | 939 | spin_unlock(&vfsmount_lock); |
938 | release_mounts(&umount_list); | 940 | release_mounts(&umount_list); |
939 | } | 941 | } |
942 | mnt->mnt_flags = mnt_flags; | ||
940 | 943 | ||
941 | out: | 944 | out: |
942 | up_write(&namespace_sem); | 945 | up_write(&namespace_sem); |
@@ -1350,7 +1353,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, | |||
1350 | retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, | 1353 | retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, |
1351 | data_page); | 1354 | data_page); |
1352 | else if (flags & MS_BIND) | 1355 | else if (flags & MS_BIND) |
1353 | retval = do_loopback(&nd, dev_name, flags & MS_REC); | 1356 | retval = do_loopback(&nd, dev_name, flags, mnt_flags); |
1354 | else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) | 1357 | else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) |
1355 | retval = do_change_type(&nd, flags); | 1358 | retval = do_change_type(&nd, flags); |
1356 | else if (flags & MS_MOVE) | 1359 | else if (flags & MS_MOVE) |