Skip to content
Commit fe4de493 authored by Chao Yu's avatar Chao Yu Committed by Sasha Levin
Browse files

f2fs: fix to avoid potential panic during recovery



[ Upstream commit 21ec6823 ]

During recovery, if FAULT_BLOCK is on, it is possible that
f2fs_reserve_new_block() will return -ENOSPC during recovery,
then it may trigger panic.

Also, if fault injection rate is 1 and only FAULT_BLOCK fault
type is on, it may encounter deadloop in loop of block reservation.

Let's change as below to fix these issues:
- remove bug_on() to avoid panic.
- limit the loop count of block reservation to avoid potential
deadloop.

Fixes: 956fa1dd ("f2fs: fix to check return value of f2fs_reserve_new_block()")
Reported-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 98df108a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment