android_kernel_samsung_sm8650/fs/f2fs
Jaegeuk Kim dfd6ca2517 UPSTREAM: f2fs: fix deadlock in i_xattr_sem and inode page lock
Thread #1:

[122554.641906][   T92]  f2fs_getxattr+0xd4/0x5fc
    -> waiting for f2fs_down_read(&F2FS_I(inode)->i_xattr_sem);

[122554.641927][   T92]  __f2fs_get_acl+0x50/0x284
[122554.641948][   T92]  f2fs_init_acl+0x84/0x54c
[122554.641969][   T92]  f2fs_init_inode_metadata+0x460/0x5f0
[122554.641990][   T92]  f2fs_add_inline_entry+0x11c/0x350
    -> Locked dir->inode_page by f2fs_get_node_page()

[122554.642009][   T92]  f2fs_do_add_link+0x100/0x1e4
[122554.642025][   T92]  f2fs_create+0xf4/0x22c
[122554.642047][   T92]  vfs_create+0x130/0x1f4

Thread #2:

[123996.386358][   T92]  __get_node_page+0x8c/0x504
    -> waiting for dir->inode_page lock

[123996.386383][   T92]  read_all_xattrs+0x11c/0x1f4
[123996.386405][   T92]  __f2fs_setxattr+0xcc/0x528
[123996.386424][   T92]  f2fs_setxattr+0x158/0x1f4
    -> f2fs_down_write(&F2FS_I(inode)->i_xattr_sem);

[123996.386443][   T92]  __f2fs_set_acl+0x328/0x430
[123996.386618][   T92]  f2fs_set_acl+0x38/0x50
[123996.386642][   T92]  posix_acl_chmod+0xc8/0x1c8
[123996.386669][   T92]  f2fs_setattr+0x5e0/0x6bc
[123996.386689][   T92]  notify_change+0x4d8/0x580
[123996.386717][   T92]  chmod_common+0xd8/0x184
[123996.386748][   T92]  do_fchmodat+0x60/0x124
[123996.386766][   T92]  __arm64_sys_fchmodat+0x28/0x3c

Bug: 280545073
Fixes: 27161f13e3 "f2fs: avoid race in between read xattr & write xattr"
Cc: <stable@vger.kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 82d8a4f642421ece594542e1fabc689dcb094b1a)
Change-Id: Iec383216e1887e11c69374d28e4ecdedda133919
2023-07-06 19:32:34 +00:00
..
acl.c f2fs: port to vfs{g,u}id_t and associated helpers 2022-10-04 13:31:43 -07:00
acl.h vfs: add rcu argument to ->get_acl() callback 2021-08-18 22:08:24 +02:00
checkpoint.c f2fs: relax sanity check if checkpoint is corrupted 2023-04-13 16:40:30 -07:00
compress.c FROMGIT: f2fs: fix the wrong condition to determine atomic context 2023-05-18 02:41:06 +00:00
data.c Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-6.1.y' into android14-6.1 2023-04-26 17:04:43 -07:00
debug.c f2fs: fix to recover quota data correctly 2023-04-12 08:56:26 -07:00
dir.c UPSTREAM: f2fs: fix deadlock in i_xattr_sem and inode page lock 2023-07-06 19:32:34 +00:00
extent_cache.c f2fs: remove unnessary comment in __may_age_extent_tree 2023-04-19 13:39:57 -07:00
f2fs.h Revert "FROMLIST: f2fs: remove i_xattr_sem to avoid deadlock and fix the original issue" 2023-07-05 17:21:39 -07:00
file.c f2fs: allocate trace path buffer from names_cache 2023-04-19 13:39:56 -07:00
gc.c f2fs: remove power-of-two limitation of zoned device 2023-04-19 13:39:57 -07:00
gc.h f2fs: Fix system crash due to lack of free space in LFS 2023-04-10 14:56:08 -07:00
hash.c f2fs: don't use casefolded comparison for "." and ".." 2022-05-17 11:19:23 -07:00
inline.c f2fs: use common implementation of file type 2023-04-10 14:56:09 -07:00
inode.c f2fs: remove unneeded in-memory i_crtime copy 2023-04-10 14:56:25 -07:00
iostat.c f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() 2023-02-07 10:54:25 -08:00
iostat.h f2fs: use iostat_lat_type directly as a parameter in the iostat_update_and_unbind_ctx() 2023-02-07 10:54:25 -08:00
Kconfig f2fs: introduce F2FS_UNFAIR_RWSEM to support unfair rwsem 2022-03-04 09:15:53 -08:00
Makefile f2fs: separate out iostat feature 2021-08-23 10:25:51 -07:00
namei.c f2fs: fix potential corruption when moving a directory 2023-04-12 08:56:26 -07:00
node.c f2fs: reduce stack memory cost by using bitfield in struct f2fs_io_info 2023-02-02 13:40:33 -08:00
node.h f2fs: convert to use bitmap API 2023-04-03 16:08:39 -07:00
recovery.c f2fs: fix to recover quota data correctly 2023-04-12 08:56:26 -07:00
segment.c f2fs: allocate node blocks for atomic write block replacement 2023-04-19 13:39:57 -07:00
segment.h f2fs: add has_enough_free_secs() 2023-04-14 13:05:14 -07:00
shrinker.c f2fs: add block_age-based extent cache 2022-12-19 11:05:25 -08:00
super.c Revert "FROMLIST: f2fs: remove i_xattr_sem to avoid deadlock and fix the original issue" 2023-07-05 17:21:39 -07:00
sysfs.c f2fs: remove bulk remove_proc_entry() and unnecessary kobject_del() 2023-04-13 16:39:41 -07:00
verity.c fsverity: pass pos and size to ->write_merkle_tree_block 2023-02-27 19:45:03 -08:00
xattr.c UPSTREAM: f2fs: fix deadlock in i_xattr_sem and inode page lock 2023-07-06 19:32:34 +00:00
xattr.h f2fs: code cleanup by removing ifdef macro surrounding 2020-05-26 18:56:10 -07:00