Skip to content

Commit 1a22542

Browse files
author
Al Viro
committed
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>
1 parent 19ac817 commit 1a22542

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/dcache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,7 @@ struct check_mount {
13901390
unsigned int mounted;
13911391
};
13921392

1393+
/* locks: mount_locked_reader && dentry->d_lock */
13931394
static enum d_walk_ret path_check_mount(void *data, struct dentry *dentry)
13941395
{
13951396
struct check_mount *info = data;
@@ -1416,9 +1417,8 @@ int path_has_submounts(const struct path *parent)
14161417
{
14171418
struct check_mount data = { .mnt = parent->mnt, .mounted = 0 };
14181419

1419-
read_seqlock_excl(&mount_lock);
1420+
guard(mount_locked_reader)();
14201421
d_walk(parent->dentry, &data, path_check_mount);
1421-
read_sequnlock_excl(&mount_lock);
14221422

14231423
return data.mounted;
14241424
}

0 commit comments

Comments
 (0)