Commit 7c57860b authored by Zhiguo Niu's avatar Zhiguo Niu Committed by Daeho Jeong
Browse files

UPSTREAM: f2fs: stop checkpoint when get a out-of-bounds segment



There is low probability that an out-of-bounds segment will be got
on a small-capacity device. In order to prevent subsequent write requests
allocating block address from this invalid segment, which may cause
unexpected issue, stop checkpoint should be performed.

Also introduce a new stop cp reason: STOP_CP_REASON_NO_SEGMENT.

Note, f2fs_stop_checkpoint(, false) is complex and it may sleep, so we should
move it outside segmap_lock spinlock coverage in get_new_segment().

Signed-off-by: default avatarZhiguo Niu <zhiguo.niu@unisoc.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>

Bug: 361829529
Bug: 381105141
(cherry picked from commit f9e28904)
Signed-off-by: default avatarDaeho Jeong <daehojeong@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:751a02f798fb8981166bd500f2ba0765bf19cab2)
Merged-In: Ie5a83b05851a0b5c0c75fa74dbcf9261065724fa
Change-Id: Ie5a83b05851a0b5c0c75fa74dbcf9261065724fa
parent e24f0456
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment