From: Oleg Nesterov Date: Wed, 10 Dec 2014 23:54:56 +0000 (-0800) Subject: exit: proc: don't try to flush /proc/tgid/task/tgid X-Git-Tag: v4.9.8~5219^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c35a7f18a0b237261dad57c9abd3adfa73f315e1;p=platform%2Fkernel%2Flinux-rpi3.git exit: proc: don't try to flush /proc/tgid/task/tgid proc_flush_task_mnt() always tries to flush task/pid, but this is pointless if we reap the leader. d_invalidate() is recursive, and if nothing else the next d_hash_and_lookup(tgid) should fail anyway. Signed-off-by: Oleg Nesterov Cc: Aaron Tomlin Cc: "Eric W. Biederman" Cc: Rik van Riel Cc: Sterling Alexander Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/proc/base.c b/fs/proc/base.c index 772efa4..e7b04a3 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2618,6 +2618,9 @@ static void proc_flush_task_mnt(struct vfsmount *mnt, pid_t pid, pid_t tgid) dput(dentry); } + if (pid == tgid) + return; + name.name = buf; name.len = snprintf(buf, sizeof(buf), "%d", tgid); leader = d_hash_and_lookup(mnt->mnt_root, &name);