diff options
| author | 2025-09-02 19:55:41 -0400 | |
|---|---|---|
| committer | 2025-09-15 21:26:44 -0400 | |
| commit | 1a22542b5ffe2f91859ed7c7e610dc7b588a6713 (patch) | |
| tree | 70017fd8a399a51609b98b04d09aecaa004d2290 | |
| parent | fs/namespace.c: sanitize descriptions for {__,}lookup_mnt() (diff) | |
| download | wireguard-linux-1a22542b5ffe2f91859ed7c7e610dc7b588a6713.tar.xz wireguard-linux-1a22542b5ffe2f91859ed7c7e610dc7b588a6713.zip | |
path_has_submounts(): use guard(mount_locked_reader)
Needed there since the callback passed to d_walk() (path_check_mount())
is using __path_is_mountpoint(), which uses __lookup_mnt().
Has to be taken in the caller - d_walk() might take rename_lock spinlock
component and that nests inside mount_lock.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to '')
| -rw-r--r-- | fs/dcache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index 60046ae23d51..ab21a8402db0 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -1390,6 +1390,7 @@ struct check_mount { unsigned int mounted; }; +/* locks: mount_locked_reader && dentry->d_lock */ static enum d_walk_ret path_check_mount(void *data, struct dentry *dentry) { struct check_mount *info = data; @@ -1416,9 +1417,8 @@ int path_has_submounts(const struct path *parent) { struct check_mount data = { .mnt = parent->mnt, .mounted = 0 }; - read_seqlock_excl(&mount_lock); + guard(mount_locked_reader)(); d_walk(parent->dentry, &data, path_check_mount); - read_sequnlock_excl(&mount_lock); return data.mounted; } |
