mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
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>
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user