exit: proc: don't try to flush /proc/tgid/task/tgid
authorOleg Nesterov <[email protected]>
Wed, 10 Dec 2014 23:54:56 +0000 (15:54 -0800)
committerLinus Torvalds <[email protected]>
Thu, 11 Dec 2014 01:41:17 +0000 (17:41 -0800)
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 <[email protected]>
Cc: Aaron Tomlin <[email protected]>
Cc: "Eric W. Biederman" <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Sterling Alexander <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
fs/proc/base.c

index 772efa45a452c75a912ec67641d06bee4cfde4bf..e7b04a321cc1d3e00325ae3c90a6b3363984e1de 100644 (file)
@@ -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);