Skip to content

Commit 0904c9a

Browse files
zhangyi089tytso
authored andcommitted
ext4: move inode eio simulation behind io completeion
No EIO simulation is required if the buffer is uptodate, so move the simulation behind read bio completeion just like inode/block bitmap simulation does. Signed-off-by: Zhang Yi <[email protected]> Reviewed-by: Jan Kara <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 4a79a98 commit 0904c9a

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/ext4/inode.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4337,8 +4337,6 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino,
43374337
bh = sb_getblk(sb, block);
43384338
if (unlikely(!bh))
43394339
return -ENOMEM;
4340-
if (ext4_simulate_fail(sb, EXT4_SIM_INODE_EIO))
4341-
goto simulate_eio;
43424340
if (!buffer_uptodate(bh)) {
43434341
lock_buffer(bh);
43444342

@@ -4425,8 +4423,8 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino,
44254423
ext4_read_bh_nowait(bh, REQ_META | REQ_PRIO, NULL);
44264424
blk_finish_plug(&plug);
44274425
wait_on_buffer(bh);
4426+
ext4_simulate_fail_bh(sb, bh, EXT4_SIM_INODE_EIO);
44284427
if (!buffer_uptodate(bh)) {
4429-
simulate_eio:
44304428
if (ret_block)
44314429
*ret_block = block;
44324430
brelse(bh);

0 commit comments

Comments
 (0)