BACKPORT: 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(). Bug: 337626258 Signed-off-by:Zhiguo Niu <zhiguo.niu@unisoc.com> Reviewed-by:
Chao Yu <chao@kernel.org> Signed-off-by:
Jaegeuk Kim <jaegeuk@kernel.org> (cherry picked from commit 22d4368b) [xiuhong: Resolved minor conflict in fs/f2fs/segment.c] Change-Id: Ib7b2b74ec826d9ece0e1cb9ff2edd99399af8264 Signed-off-by:
Xiuhong Wang <xiuhong.wang@unisoc.com>
Loading