diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2014-02-13 13:24:23 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-10-09 02:38:58 -0400 |
commit | bbd5192412fdedbae00888316bfe350bf89d0458 (patch) | |
tree | a9fc77990ac4807b581f7f5b5cf6739af826d343 /fs/proc | |
parent | c143c2333c48f1430231b31a8c17e074b9b504eb (diff) |
proc: Update proc_flush_task_mnt to use d_invalidate
Now that d_invalidate always succeeds and flushes mount points use
it in stead of a combination of shrink_dcache_parent and d_drop
in proc_flush_task_mnt. This removes the danger of a mount point
under /proc/<pid>/... becoming unreachable after the d_drop.
Reviewed-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/base.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index b4fe0ee08942..00cd85f18bcc 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -2639,8 +2639,7 @@ static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid) | |||
2639 | /* no ->d_hash() rejects on procfs */ | 2639 | /* no ->d_hash() rejects on procfs */ |
2640 | dentry = d_hash_and_lookup(mnt->mnt_root, &name); | 2640 | dentry = d_hash_and_lookup(mnt->mnt_root, &name); |
2641 | if (dentry) { | 2641 | if (dentry) { |
2642 | shrink_dcache_parent(dentry); | 2642 | d_invalidate(dentry); |
2643 | d_drop(dentry); | ||
2644 | dput(dentry); | 2643 | dput(dentry); |
2645 | } | 2644 | } |
2646 | 2645 | ||
@@ -2660,8 +2659,7 @@ static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid) | |||
2660 | name.len = snprintf(buf, sizeof(buf), "%d", pid); | 2659 | name.len = snprintf(buf, sizeof(buf), "%d", pid); |
2661 | dentry = d_hash_and_lookup(dir, &name); | 2660 | dentry = d_hash_and_lookup(dir, &name); |
2662 | if (dentry) { | 2661 | if (dentry) { |
2663 | shrink_dcache_parent(dentry); | 2662 | d_invalidate(dentry); |
2664 | d_drop(dentry); | ||
2665 | dput(dentry); | 2663 | dput(dentry); |
2666 | } | 2664 | } |
2667 | 2665 | ||