]> git.baikalelectronics.ru Git - kernel.git/commit
procfs: get rid of ancient BS in pid_revalidate() uses
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 3 May 2018 01:26:16 +0000 (21:26 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 22 May 2018 18:28:03 +0000 (14:28 -0400)
commit5ec77277ca281b23476b47502469ffc0d6557752
tree42f965fe9a163a3bdaf8d8a51a6649afbf7118ce
parent97736fae8e8edc2e47801d1da188ed7e03b4c530
procfs: get rid of ancient BS in pid_revalidate() uses

First of all, calling pid_revalidate() in the end of <pid>/* lookups
is *not* about closing any kind of races; that used to be true once
upon a time, but these days those comments are actively misleading.
Especially since pid_revalidate() doesn't even do d_drop() on
failure anymore.  It doesn't matter, anyway, since once
pid_revalidate() starts returning false, ->d_delete() of those
dentries starts saying "don't keep"; they won't get stuck in
dcache any longer than they are pinned.

These calls cannot be just removed, though - the side effect of
pid_revalidate() (updating i_uid/i_gid/etc.) is what we are calling
it for here.

Let's separate the "update ownership" into a new helper (pid_update_inode())
and use it, both in lookups and in pid_revalidate() itself.

The comments in pid_revalidate() are also out of date - they refer to
the time when pid_revalidate() used to call d_drop() directly...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/proc/base.c
fs/proc/internal.h
fs/proc/namespaces.c