]> git.baikalelectronics.ru Git - kernel.git/commit
proc: Use d_invalidate in proc_prune_siblings_dcache
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 21 Feb 2020 14:43:23 +0000 (08:43 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Mon, 24 Feb 2020 15:50:04 +0000 (09:50 -0600)
commit4ba3675c49f223bf13a194e1a8094505e6b450c8
tree9222e57f17f8716d8345fadea251ff1e83bce8c9
parent608d232f40ed7b0a0edb95e3cb0ef8030740e4e5
proc: Use d_invalidate in proc_prune_siblings_dcache

The function d_prune_aliases has the problem that it will only prune
aliases thare are completely unused.  It will not remove aliases for
the dcache or even think of removing mounts from the dcache.  For that
behavior d_invalidate is needed.

To use d_invalidate replace d_prune_aliases with d_find_alias followed
by d_invalidate and dput.

For completeness the directory and the non-directory cases are
separated because in theory (although not in currently in practice for
proc) directories can only ever have a single dentry while
non-directories can have hardlinks and thus multiple dentries.
As part of this separation use d_find_any_alias for directories
to spare d_find_alias the extra work of doing that.

Plus the differences between d_find_any_alias and d_find_alias makes
it clear why the directory and non-directory code and not share code.

To make it clear these routines now invalidate dentries rename
proc_prune_siblings_dache to proc_invalidate_siblings_dcache, and rename
proc_sys_prune_dcache proc_sys_invalidate_dcache.

V2: Split the directory and non-directory cases.  To make this
    code robust to future changes in proc.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
fs/proc/inode.c
fs/proc/internal.h
fs/proc/proc_sysctl.c