Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

Al Viro 1a22542b 19ac8173

+2 -2
+2 -2
fs/dcache.c
··· 1390 1390 unsigned int mounted; 1391 1391 }; 1392 1392 1393 + /* locks: mount_locked_reader && dentry->d_lock */ 1393 1394 static enum d_walk_ret path_check_mount(void *data, struct dentry *dentry) 1394 1395 { 1395 1396 struct check_mount *info = data; ··· 1417 1416 { 1418 1417 struct check_mount data = { .mnt = parent->mnt, .mounted = 0 }; 1419 1418 1420 - read_seqlock_excl(&mount_lock); 1419 + guard(mount_locked_reader)(); 1421 1420 d_walk(parent->dentry, &data, path_check_mount); 1422 - read_sequnlock_excl(&mount_lock); 1423 1421 1424 1422 return data.mounted; 1425 1423 }