]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
path_is_under(): use guards
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 22 Aug 2025 00:48:38 +0000 (20:48 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 2 Sep 2025 23:35:57 +0000 (19:35 -0400)
commit2aec880c1cdf1cf2dab931b4dd8744c415311bc9
tree06dfa03d06a57bd1e0239867664a614425cb8b88
parent2605d8684320e6c09e56743e66ecac8ae581b464
path_is_under(): use guards

... and document that locking requirements for is_path_reachable().
There is one questionable caller in do_listmount() where we are not
holding mount_lock *and* might not have the first argument mounted.
However, in that case it will immediately return true without having
to look at the ancestors.  Might be cleaner to move the check into
non-LSTM_ROOT case which it really belongs in - there the check is
not always true and is_mounted() is guaranteed.

Document the locking environments for is_path_reachable() callers:
get_peer_under_root()
get_dominating_id()
do_statmount()
do_listmount()

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c
fs/pnode.c