Ye Bin
fa6482f374
ext4: fix warning in ext4_iomap_begin as race between bmap and write
...
[ Upstream commit 51ae846cff568c8c29921b1b28eb2dfbcd4ac12d ]
We got issue as follows:
------------[ cut here ]------------
WARNING: CPU: 3 PID: 9310 at fs/ext4/inode.c:3441 ext4_iomap_begin+0x182/0x5d0
RIP: 0010:ext4_iomap_begin+0x182/0x5d0
RSP: 0018:ffff88812460fa08 EFLAGS: 00010293
RAX: ffff88811f168000 RBX: 0000000000000000 RCX: ffffffff97793c12
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: ffff88812c669160 R08: ffff88811f168000 R09: ffffed10258cd20f
R10: ffff88812c669077 R11: ffffed10258cd20e R12: 0000000000000001
R13: 00000000000000a4 R14: 000000000000000c R15: ffff88812c6691ee
FS: 00007fd0d6ff3740(0000) GS:ffff8883af180000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fd0d6dda290 CR3: 0000000104a62000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
iomap_apply+0x119/0x570
iomap_bmap+0x124/0x150
ext4_bmap+0x14f/0x250
bmap+0x55/0x80
do_vfs_ioctl+0x952/0xbd0
__x64_sys_ioctl+0xc6/0x170
do_syscall_64+0x33/0x40
entry_SYSCALL_64_after_hwframe+0x44/0xa9
Above issue may happen as follows:
bmap write
bmap
ext4_bmap
iomap_bmap
ext4_iomap_begin
ext4_file_write_iter
ext4_buffered_write_iter
generic_perform_write
ext4_da_write_begin
ext4_da_write_inline_data_begin
ext4_prepare_inline_data
ext4_create_inline_data
ext4_set_inode_flag(inode,
EXT4_INODE_INLINE_DATA);
if (WARN_ON_ONCE(ext4_has_inline_data(inode))) ->trigger bug_on
To solved above issue hold inode lock in ext4_bamp.
Signed-off-by: Ye Bin <yebin10@huawei.com>
Link: https://lore.kernel.org/r/20220617013935.397596-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-08-17 15:16:16 +02:00
..
2022-06-17 06:03:30 +09:00
2022-05-09 16:21:44 -04:00
2022-05-09 16:21:44 -04:00
2022-07-14 10:10:12 +02:00
2022-05-09 16:21:45 -04:00
2022-05-09 16:21:44 -04:00
2022-08-17 15:16:12 +02:00
2022-07-05 16:12:21 +01:00
2022-07-14 10:10:12 +02:00
2022-08-17 15:16:06 +02:00
2022-05-09 16:21:45 -04:00
2022-02-22 18:30:28 +01:00
2022-05-09 16:21:45 -04:00
2022-05-09 16:18:54 -07:00
2022-02-25 11:56:13 +01:00
2022-01-24 14:17:02 +01:00
2022-05-02 11:23:49 -05:00
2022-05-09 16:21:45 -04:00
2022-05-09 16:21:45 -04:00
2022-08-17 15:14:21 +02:00
2022-06-09 21:26:32 +09:00
2022-04-28 16:31:10 +02:00
2022-08-17 15:14:00 +02:00
2022-08-17 15:16:16 +02:00
2022-08-17 15:16:02 +02:00
2022-05-27 11:22:03 -07:00
2022-06-03 10:34:34 -07:00
2022-07-05 16:12:55 +01:00
2022-08-17 15:15:56 +02:00
2022-05-24 19:55:07 -07:00
2022-05-09 23:12:34 -04:00
2022-05-09 23:12:34 -04:00
2022-05-09 16:21:45 -04:00
2022-05-09 16:21:45 -04:00
2022-06-16 19:11:32 -07:00
2022-05-24 19:55:07 -07:00
2022-05-09 16:21:45 -04:00
2022-08-17 15:15:43 +02:00
2022-06-03 14:42:24 -07:00
2022-05-27 15:59:21 -07:00
2022-08-17 15:15:26 +02:00
2022-08-17 15:13:54 +02:00
2022-08-17 15:13:42 +02:00
2022-05-09 16:21:44 -04:00
2022-07-14 10:10:12 +02:00
2022-08-17 15:13:40 +02:00
2022-08-17 15:13:40 +02:00
2022-07-03 15:42:33 -07:00
2022-06-28 11:18:13 +02:00
2022-07-18 15:07:52 -07:00
2022-06-03 16:57:16 -07:00
2022-07-18 15:09:15 -07:00
2022-05-09 16:21:44 -04:00
2022-03-22 15:57:03 -07:00
2022-05-09 23:12:53 -04:00
2022-08-17 15:13:48 +02:00
2022-08-17 15:15:54 +02:00
2022-03-15 11:08:23 -07:00
2022-05-09 16:21:44 -04:00
2022-05-09 16:21:44 -04:00
2022-06-06 10:08:10 +02:00
2021-11-09 10:11:53 -08:00
2022-05-09 23:12:34 -04:00
2022-05-09 16:21:46 -04:00
2022-05-23 20:24:12 -05:00
2022-05-24 19:55:07 -07:00
2022-04-05 15:39:19 +02:00
2022-05-27 11:22:03 -07:00
2022-06-17 19:01:28 -04:00
2022-06-03 14:42:24 -07:00
2022-05-24 19:55:07 -07:00
2022-05-09 16:21:44 -04:00
2022-02-14 10:37:32 +09:00
2022-05-09 16:21:46 -04:00
2022-05-24 19:55:07 -07:00
2022-07-01 09:09:52 -07:00
2022-06-08 19:13:55 +09:00
2022-04-01 19:57:03 -07:00
2022-08-17 15:13:46 +02:00
2022-03-08 12:55:29 -06:00
2022-03-03 20:38:56 -08:00
2022-04-15 14:49:56 -07:00
2022-04-22 10:57:18 -07:00
2022-02-09 09:50:02 -08:00
2022-05-09 23:12:34 -04:00
2022-03-03 20:38:56 -08:00
2022-03-28 17:29:53 -07:00
2021-11-06 13:30:32 -07:00
2022-05-27 15:49:30 -07:00
2022-03-22 15:57:03 -07:00
2022-04-17 19:50:02 -06:00
2022-08-17 15:13:59 +02:00
2022-08-17 15:16:06 +02:00
2022-05-09 18:20:49 -07:00
2022-06-04 18:52:00 -07:00
2022-06-05 15:03:03 -04:00
2022-01-18 09:23:19 +02:00
2021-12-09 14:09:36 -05:00
2022-06-06 09:54:30 +02:00
2022-05-19 23:25:10 -04:00
2022-06-06 09:54:30 +02:00
2022-06-04 19:00:05 -07:00
2022-04-01 19:35:56 -07:00
2022-04-28 23:16:15 -07:00
2022-05-30 10:56:18 -07:00
2022-05-09 16:21:44 -04:00
2022-05-19 12:25:39 -04:00
2022-08-17 15:14:20 +02:00
2022-08-17 15:13:56 +02:00
2022-05-09 23:12:34 -04:00
2022-08-17 15:16:06 +02:00
2022-06-04 19:00:05 -07:00
2022-05-31 14:10:54 -07:00
2022-05-27 11:22:03 -07:00
2022-04-19 10:19:02 -07:00
2021-12-03 18:44:06 +01:00
2022-07-26 19:38:46 -07:00
2022-07-14 15:35:24 -07:00
2022-01-11 09:03:05 -08:00
2022-05-22 21:03:01 +01:00
2022-01-17 05:49:30 +02:00
2022-08-17 15:14:49 +02:00
2022-05-31 14:10:54 -07:00
2022-04-17 19:49:59 -06:00
2022-04-26 13:36:25 -07:00
2022-01-22 08:33:36 +02:00
2022-07-26 18:25:01 -07:00
2022-04-24 18:18:37 -06:00