diff options
-rw-r--r-- | fs/namespace.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/namespace.c b/fs/namespace.c index 6b5e0436acfd..3e95cc26dda6 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -763,9 +763,8 @@ static inline void mntfree(struct mount *mnt) | |||
763 | deactivate_super(sb); | 763 | deactivate_super(sb); |
764 | } | 764 | } |
765 | 765 | ||
766 | static void mntput_no_expire(struct vfsmount *m) | 766 | static void mntput_no_expire(struct mount *mnt) |
767 | { | 767 | { |
768 | struct mount *mnt = real_mount(m); | ||
769 | put_again: | 768 | put_again: |
770 | #ifdef CONFIG_SMP | 769 | #ifdef CONFIG_SMP |
771 | br_read_lock(vfsmount_lock); | 770 | br_read_lock(vfsmount_lock); |
@@ -792,7 +791,7 @@ put_again: | |||
792 | mnt_add_count(mnt, mnt->mnt.mnt_pinned + 1); | 791 | mnt_add_count(mnt, mnt->mnt.mnt_pinned + 1); |
793 | mnt->mnt.mnt_pinned = 0; | 792 | mnt->mnt.mnt_pinned = 0; |
794 | br_write_unlock(vfsmount_lock); | 793 | br_write_unlock(vfsmount_lock); |
795 | acct_auto_close_mnt(m); | 794 | acct_auto_close_mnt(&mnt->mnt); |
796 | goto put_again; | 795 | goto put_again; |
797 | } | 796 | } |
798 | br_write_unlock(vfsmount_lock); | 797 | br_write_unlock(vfsmount_lock); |
@@ -805,7 +804,7 @@ void mntput(struct vfsmount *mnt) | |||
805 | /* avoid cacheline pingpong, hope gcc doesn't get "smart" */ | 804 | /* avoid cacheline pingpong, hope gcc doesn't get "smart" */ |
806 | if (unlikely(mnt->mnt_expiry_mark)) | 805 | if (unlikely(mnt->mnt_expiry_mark)) |
807 | mnt->mnt_expiry_mark = 0; | 806 | mnt->mnt_expiry_mark = 0; |
808 | mntput_no_expire(mnt); | 807 | mntput_no_expire(real_mount(mnt)); |
809 | } | 808 | } |
810 | } | 809 | } |
811 | EXPORT_SYMBOL(mntput); | 810 | EXPORT_SYMBOL(mntput); |
@@ -1351,6 +1350,7 @@ static int do_umount(struct mount *mnt, int flags) | |||
1351 | SYSCALL_DEFINE2(umount, char __user *, name, int, flags) | 1350 | SYSCALL_DEFINE2(umount, char __user *, name, int, flags) |
1352 | { | 1351 | { |
1353 | struct path path; | 1352 | struct path path; |
1353 | struct mount *mnt; | ||
1354 | int retval; | 1354 | int retval; |
1355 | int lookup_flags = 0; | 1355 | int lookup_flags = 0; |
1356 | 1356 | ||
@@ -1363,6 +1363,7 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags) | |||
1363 | retval = user_path_at(AT_FDCWD, name, lookup_flags, &path); | 1363 | retval = user_path_at(AT_FDCWD, name, lookup_flags, &path); |
1364 | if (retval) | 1364 | if (retval) |
1365 | goto out; | 1365 | goto out; |
1366 | mnt = real_mount(path.mnt); | ||
1366 | retval = -EINVAL; | 1367 | retval = -EINVAL; |
1367 | if (path.dentry != path.mnt->mnt_root) | 1368 | if (path.dentry != path.mnt->mnt_root) |
1368 | goto dput_and_out; | 1369 | goto dput_and_out; |
@@ -1373,11 +1374,11 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags) | |||
1373 | if (!capable(CAP_SYS_ADMIN)) | 1374 | if (!capable(CAP_SYS_ADMIN)) |
1374 | goto dput_and_out; | 1375 | goto dput_and_out; |
1375 | 1376 | ||
1376 | retval = do_umount(real_mount(path.mnt), flags); | 1377 | retval = do_umount(mnt, flags); |
1377 | dput_and_out: | 1378 | dput_and_out: |
1378 | /* we mustn't call path_put() as that would clear mnt_expiry_mark */ | 1379 | /* we mustn't call path_put() as that would clear mnt_expiry_mark */ |
1379 | dput(path.dentry); | 1380 | dput(path.dentry); |
1380 | mntput_no_expire(path.mnt); | 1381 | mntput_no_expire(mnt); |
1381 | out: | 1382 | out: |
1382 | return retval; | 1383 | return retval; |
1383 | } | 1384 | } |