Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280198
b: refs/heads/master
c: 900148d
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Jan 4, 2012
1 parent e6fdcab commit 451594f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95bc5f25c10fcdf02c53af1eda987f58d0bc377c
refs/heads/master: 900148dcac6bc93ca688d64a7f9a9f8d706e0d1c
13 changes: 7 additions & 6 deletions trunk/fs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,9 +763,8 @@ static inline void mntfree(struct mount *mnt)
deactivate_super(sb);
}

static void mntput_no_expire(struct vfsmount *m)
static void mntput_no_expire(struct mount *mnt)
{
struct mount *mnt = real_mount(m);
put_again:
#ifdef CONFIG_SMP
br_read_lock(vfsmount_lock);
Expand All @@ -792,7 +791,7 @@ static void mntput_no_expire(struct vfsmount *m)
mnt_add_count(mnt, mnt->mnt.mnt_pinned + 1);
mnt->mnt.mnt_pinned = 0;
br_write_unlock(vfsmount_lock);
acct_auto_close_mnt(m);
acct_auto_close_mnt(&mnt->mnt);
goto put_again;
}
br_write_unlock(vfsmount_lock);
Expand All @@ -805,7 +804,7 @@ void mntput(struct vfsmount *mnt)
/* avoid cacheline pingpong, hope gcc doesn't get "smart" */
if (unlikely(mnt->mnt_expiry_mark))
mnt->mnt_expiry_mark = 0;
mntput_no_expire(mnt);
mntput_no_expire(real_mount(mnt));
}
}
EXPORT_SYMBOL(mntput);
Expand Down Expand Up @@ -1351,6 +1350,7 @@ static int do_umount(struct mount *mnt, int flags)
SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
{
struct path path;
struct mount *mnt;
int retval;
int lookup_flags = 0;

Expand All @@ -1363,6 +1363,7 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
retval = user_path_at(AT_FDCWD, name, lookup_flags, &path);
if (retval)
goto out;
mnt = real_mount(path.mnt);
retval = -EINVAL;
if (path.dentry != path.mnt->mnt_root)
goto dput_and_out;
Expand All @@ -1373,11 +1374,11 @@ SYSCALL_DEFINE2(umount, char __user *, name, int, flags)
if (!capable(CAP_SYS_ADMIN))
goto dput_and_out;

retval = do_umount(real_mount(path.mnt), flags);
retval = do_umount(mnt, flags);
dput_and_out:
/* we mustn't call path_put() as that would clear mnt_expiry_mark */
dput(path.dentry);
mntput_no_expire(path.mnt);
mntput_no_expire(mnt);
out:
return retval;
}
Expand Down

0 comments on commit 451594f

Please sign in to comment.