Jaegeuk Kim
a996fec74c
f2fs: fix deadlock in i_xattr_sem and inode page lock
...
commit 5eda1ad1aaffdfebdecf7a164e586060a210f74f upstream.
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
Cc: <stable@vger.kernel.org>
Fixes: 27161f13e3c3 "f2fs: avoid race in between read xattr & write xattr"
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-07-23 13:49:29 +02:00
..
2022-10-04 13:31:43 -07:00
2021-08-18 22:08:24 +02:00
2023-05-24 17:32:38 +01:00
2023-07-23 13:49:29 +02:00
2023-07-19 16:21:55 +02:00
2023-05-17 11:53:52 +02:00
2023-07-23 13:49:29 +02:00
2023-05-17 11:53:59 +02:00
2023-07-19 16:21:55 +02:00
2023-07-19 16:21:55 +02:00
2023-07-19 16:22:00 +02:00
2023-05-24 17:32:38 +01:00
2022-05-17 11:19:23 -07:00
2023-03-10 09:34:08 +01:00
2023-05-17 11:53:59 +02:00
2023-03-11 13:55:21 +01:00
2022-08-29 21:15:51 -07:00
2022-03-04 09:15:53 -08:00
2021-08-23 10:25:51 -07:00
2023-07-19 16:22:12 +02:00
2023-07-19 16:22:03 +02:00
2023-05-17 11:53:52 +02:00
2022-10-04 13:31:45 -07:00
2023-05-17 11:53:53 +02:00
2023-05-24 17:32:38 +01:00
2023-05-17 11:53:52 +02:00
2023-05-24 17:32:38 +01:00
2023-05-11 23:03:20 +09:00
2023-03-11 13:55:18 +01:00
2023-07-23 13:49:29 +02:00
2020-05-26 18:56:10 -07:00