summaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorZhang Yi <yi.zhang@huawei.com>2021-08-26 15:04:07 +0200
committerTheodore Ts'o <tytso@mit.edu>2021-08-31 05:36:51 +0200
commit0904c9ae3465c7acc066a564a76b75c0af83e6c7 (patch)
tree7032de2ca6267fba0c928fc86f5331ece25dbeaf /fs/ext4/inode.c
parentext4: Improve scalability of ext4 orphan file handling (diff)
downloadlinux-0904c9ae3465c7acc066a564a76b75c0af83e6c7.tar.xz
linux-0904c9ae3465c7acc066a564a76b75c0af83e6c7.zip
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 <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Link: https://lore.kernel.org/r/20210826130412.3921207-2-yi.zhang@huawei.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to '')
-rw-r--r--fs/ext4/inode.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 8fc0dad9fa62..532443f89015 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -4337,8 +4337,6 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino,
bh = sb_getblk(sb, block);
if (unlikely(!bh))
return -ENOMEM;
- if (ext4_simulate_fail(sb, EXT4_SIM_INODE_EIO))
- goto simulate_eio;
if (!buffer_uptodate(bh)) {
lock_buffer(bh);
@@ -4425,8 +4423,8 @@ make_io:
ext4_read_bh_nowait(bh, REQ_META | REQ_PRIO, NULL);
blk_finish_plug(&plug);
wait_on_buffer(bh);
+ ext4_simulate_fail_bh(sb, bh, EXT4_SIM_INODE_EIO);
if (!buffer_uptodate(bh)) {
- simulate_eio:
if (ret_block)
*ret_block = block;
brelse(bh);