提交 9ea2f0be 编写于 作者: C Chao Yu 提交者: Jaegeuk Kim

f2fs: fix wrong error injection path in inc_valid_block_count()

If FAULT_BLOCK type error injection is on, in inc_valid_block_count()
we may decrease sbi->alloc_valid_block_count percpu stat count
incorrectly, fix it.

Fixes: 36b877af ("f2fs: Keep alloc_valid_block_count in sync")
Signed-off-by: NChao Yu <yuchao0@huawei.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 052a82d8
......@@ -1771,7 +1771,7 @@ static inline int inc_valid_block_count(struct f2fs_sb_info *sbi,
if (time_to_inject(sbi, FAULT_BLOCK)) {
f2fs_show_injection_info(FAULT_BLOCK);
release = *count;
goto enospc;
goto release_quota;
}
/*
......@@ -1816,6 +1816,7 @@ static inline int inc_valid_block_count(struct f2fs_sb_info *sbi,
enospc:
percpu_counter_sub(&sbi->alloc_valid_block_count, release);
release_quota:
dquot_release_reservation_block(inode, release);
return -ENOSPC;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册