aboutsummaryrefslogtreecommitdiffstats
path: root/fs/pnode.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2025-08-21 20:48:38 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2025-09-02 19:35:57 -0400
commit2aec880c1cdf1cf2dab931b4dd8744c415311bc9 (patch)
tree06dfa03d06a57bd1e0239867664a614425cb8b88 /fs/pnode.c
parent2605d8684320e6c09e56743e66ecac8ae581b464 (diff)
downloadtip-2aec880c1cdf1cf2dab931b4dd8744c415311bc9.tar.gz
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>
Diffstat (limited to 'fs/pnode.c')
-rw-r--r--fs/pnode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/pnode.c b/fs/pnode.c
index 0702d45d856dd9..edaf9d9d0eaf03 100644
--- a/fs/pnode.c
+++ b/fs/pnode.c
@@ -29,6 +29,7 @@ static inline struct mount *next_slave(struct mount *p)
return hlist_entry(p->mnt_slave.next, struct mount, mnt_slave);
}
+/* locks: namespace_shared && is_mounted(mnt) */
static struct mount *get_peer_under_root(struct mount *mnt,
struct mnt_namespace *ns,
const struct path *root)
@@ -50,7 +51,7 @@ static struct mount *get_peer_under_root(struct mount *mnt,
* Get ID of closest dominating peer group having a representative
* under the given root.
*
- * Caller must hold namespace_sem
+ * locks: namespace_shared
*/
int get_dominating_id(struct mount *mnt, const struct path *root)
{