kernel_samsung_a53x/fs
Amir Goldstein 13ae1a2557 fsnotify: clear PARENT_WATCHED flags lazily
[ Upstream commit 172e422ffea20a89bfdc672741c1aad6fbb5044e ]

In some setups directories can have many (usually negative) dentries.
Hence __fsnotify_update_child_dentry_flags() function can take a
significant amount of time. Since the bulk of this function happens
under inode->i_lock this causes a significant contention on the lock
when we remove the watch from the directory as the
__fsnotify_update_child_dentry_flags() call from fsnotify_recalc_mask()
races with __fsnotify_update_child_dentry_flags() calls from
__fsnotify_parent() happening on children. This can lead upto softlockup
reports reported by users.

Fix the problem by calling fsnotify_update_children_dentry_flags() to
set PARENT_WATCHED flags only when parent starts watching children.

When parent stops watching children, clear false positive PARENT_WATCHED
flags lazily in __fsnotify_parent() for each accessed child.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-01-19 14:52:23 +01:00
..
9p fs/9p: drop inodes immediately on non-.L too 2024-11-19 11:32:45 +01:00
adfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
affs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
afs afs: Don't cross .backup mountpoint from backup volume 2024-11-19 12:27:12 +01:00
autofs Revert "file: Replace ksys_close with close_fd" 2024-11-19 12:59:08 +01:00
befs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btrfs btrfs: replace BUG_ON with ASSERT in walk_down_proc() 2025-01-19 00:10:00 +01:00
cachefiles Revert "namei: introduce struct renamedata" 2024-11-19 13:45:08 +01:00
ceph ceph: validate snapdirname option length when mounting 2025-01-15 16:29:47 +01:00
cifs cifs: Fix buffer overflow when parsing NFS reparse points 2024-12-17 13:23:58 +01:00
coda Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
configfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cramfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
crypto Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
debugfs debugfs: fix automount d_fsdata usage 2024-11-18 12:12:12 +01:00
devpts Import susfs4ksu 2025-01-18 21:48:58 +01:00
dlm Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ecryptfs Revert "namei: introduce struct renamedata" 2024-11-19 13:45:08 +01:00
efivarfs efivarfs: Fix error on non-existent file 2025-01-15 16:29:41 +01:00
efs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
erofs erofs: fix incorrect symlink detection in fast symlink 2025-01-15 16:29:40 +01:00
exfat exfat: fix potential deadlock on __exfat_get_dentry_set 2025-01-02 17:00:49 +01:00
exportfs exportfs: use pr_debug for unreachable debug statements 2024-11-19 12:28:26 +01:00
ext2 ext2: Verify bitmap and itable block numbers before using them 2024-11-23 23:20:12 +01:00
ext4 ext4: handle redirtying in ext4_bio_write_page() 2025-01-19 14:51:19 +01:00
f2fs f2fs: fix f2fs_bug_on when uninstalling filesystem call f2fs_evict_inode. 2024-12-17 13:24:32 +01:00
fat Revert "fat: fix uninitialized variable" 2024-11-24 00:22:53 +01:00
freevxfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fscache Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fuse Revert "virtiofs: forbid newlines in tags" 2024-11-24 00:23:52 +01:00
gfs2 gfs2: setattr_chown: Add missing initialization 2024-11-23 23:20:45 +01:00
hfs hfs: fix to initialize fields of hfs_inode_info after hfs_alloc_inode() 2024-11-23 23:20:12 +01:00
hfsplus hfsplus: don't query the device logical block size multiple times 2024-12-17 13:23:59 +01:00
hostfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hpfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
hugetlbfs fs,hugetlb: fix NULL pointer dereference in hugetlbs_fill_super 2024-11-18 23:18:30 +01:00
incfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
iomap iomap: update ki_pos a little later in iomap_dio_complete 2024-11-23 23:22:00 +01:00
isofs isofs: handle CDs with bad root inode but good Joliet root directory 2024-11-19 09:23:14 +01:00
jbd2 Revert "ext4: fix incorrect tid assumption in __jbd2_log_wait_for_space()" 2024-11-24 00:23:04 +01:00
jffs2 jffs2: Fix rtime decompressor 2024-12-17 13:24:34 +01:00
jfs jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree 2024-12-17 13:24:31 +01:00
kernfs fs/kernfs/dir: obey S_ISGID 2024-11-18 12:13:20 +01:00
lockd nfsd: stop setting ->pg_stats for unused stats 2025-01-19 14:48:42 +01:00
minix Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nfs nfsd: stop setting ->pg_stats for unused stats 2025-01-19 14:48:42 +01:00
nfs_common NFSD: Add an xdr_stream-based encoder for NFSv2/3 ACLs 2024-11-19 12:27:35 +01:00
nfsd NFSD: Refactor the duplicate reply cache shrinker 2025-01-19 14:49:36 +01:00
nilfs2 nilfs2: protect references to superblock parameters exposed in sysfs 2025-01-19 00:09:58 +01:00
nls Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
notify fsnotify: clear PARENT_WATCHED flags lazily 2025-01-19 14:52:23 +01:00
ntfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ocfs2 ocfs2: update seq_file index in ocfs2_dlm_seq_next 2024-12-17 13:24:29 +01:00
omfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
openpromfs openpromfs: finish conversion to the new mount API 2024-11-19 12:26:52 +01:00
orangefs orangefs: fix out-of-bounds fsid access 2024-11-19 14:19:41 +01:00
overlayfs Import susfs4ksu 2025-01-18 21:48:58 +01:00
proc Import susfs4ksu 2025-01-18 21:48:58 +01:00
pstore pstore/zone: Add a null pointer check to the psz_kmsg_read 2024-11-19 09:23:13 +01:00
qnx4 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
qnx6 Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
quota quota: flush quota_release_work upon quota writeback 2024-12-17 13:24:23 +01:00
ramfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
reiserfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
romfs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sdfat fs: blkdev.c: Fix a typo 2024-12-18 18:20:04 +01:00
squashfs Squashfs: sanity check symbolic link size 2025-01-19 00:09:59 +01:00
sysfs fs: sysfs: Fix reference leak in sysfs_break_active_protection() 2024-11-19 11:32:23 +01:00
sysv sysv: don't call sb_bread() with pointers_lock held 2024-11-19 09:23:14 +01:00
tracefs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ubifs ubifs: authentication: Fix use-after-free in ubifs_tnc_end_commit 2024-12-17 13:24:21 +01:00
udf udf: Limit file size to 4TB 2025-01-19 14:51:26 +01:00
ufs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
unicode UPSTREAM: unicode: Don't special case ignorable code points 2025-01-19 00:09:58 +01:00
vboxsf vboxsf: Avoid an spurious warning if load_nls_xxx() fails 2024-11-19 09:22:46 +01:00
verity Revert "fs: add file and path permissions helpers" 2024-11-19 13:30:21 +01:00
xfs xfs: fix scrub tracepoints when inode-rooted btrees are involved 2025-01-02 17:00:49 +01:00
zonefs zonefs: Improve error handling 2024-11-18 22:25:32 +01:00
aio.c fs/aio: Check IOCB_AIO_RW before the struct aio_kiocb conversion 2024-11-19 09:22:39 +01:00
anon_inodes.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
attr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bad_inode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
binfmt_aout.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
binfmt_elf.c binfmt_misc: pass binfmt_misc flags to the interpreter 2024-11-23 23:20:49 +01:00
binfmt_elf_fdpic.c binfmt_misc: pass binfmt_misc flags to the interpreter 2024-11-23 23:20:49 +01:00
binfmt_em86.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
binfmt_flat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
binfmt_misc.c binfmt_misc: pass binfmt_misc flags to the interpreter 2024-11-23 23:20:49 +01:00
binfmt_script.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
block_dev.c block: Don't invalidate pagecache for invalid falloc modes 2024-11-18 12:12:06 +01:00
buffer.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
char_dev.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
compat_binfmt_elf.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
coredump.c exec: Simplify unshare_files 2024-11-19 12:27:27 +01:00
d_path.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dax.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dcache.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
dcookies.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
direct-io.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dlog_hook.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
drop_caches.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
eventfd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
eventpoll.c Revert "epoll: Add synchronous wakeup support for ep_poll_callback" 2025-01-15 16:38:29 +01:00
exec.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
fcntl.c Revert "fs: Fix file_set_fowner LSM hook inconsistencies" 2024-11-24 00:23:15 +01:00
fhandle.c do_sys_name_to_handle(): use kzalloc() to fix kernel-infoleak 2024-11-19 08:44:37 +01:00
file.c fix bitmap corruption on close_range() with CLOSE_RANGE_UNSHARE 2024-11-23 23:20:42 +01:00
file_table.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
filesystems.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs-writeback.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_context.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_parser.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_pin.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_struct.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fs_types.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
fsopen.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
init.c Revert "fs: add file and path permissions helpers" 2024-11-19 13:30:21 +01:00
inode.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
internal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioctl.c lsm: new security_file_ioctl_compat() hook 2024-11-18 12:12:58 +01:00
Kconfig NFSD: Remove CONFIG_NFSD_V3 2024-11-19 12:27:54 +01:00
Kconfig.binfmt Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kernel_read_file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
libfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
locks.c filelock: Fix fcntl/close race recovery compat path 2024-11-19 14:19:53 +01:00
Makefile Import susfs4ksu 2025-01-18 21:48:58 +01:00
mbcache.c mbcache: Speed up cache entry creation 2024-11-19 17:58:19 +01:00
mount.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mpage.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
namei.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
namespace.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
no-block.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nsfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
open.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
pipe.c pipe: wakeup wr_wait after setting max_usage 2024-11-18 12:13:04 +01:00
pnode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pnode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
posix_acl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
proc_namespace.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
read_write.c security: samsung: defex_lsm: nuke 2024-06-15 16:20:49 -03:00
readdir.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
remap_range.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
select.c fs/select: rework stack allocation hack for clang 2024-11-19 08:44:37 +01:00
seq_file.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
signalfd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
splice.c splice: don't generate zero-len segement bvecs 2024-11-19 17:42:24 +01:00
stack.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
stat.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
statfs.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
super.c Revert "fs: explicitly unregister per-superblock BDIs" 2024-11-24 00:23:31 +01:00
sus_su.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
susfs.c Import susfs4ksu 2025-01-18 21:48:58 +01:00
sync.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
timerfd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
userfaultfd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
utimes.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
xattr.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00