Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 862cf9f2 authored by Zhiguo Niu's avatar Zhiguo Niu Committed by Daniel Rosenberg
Browse files

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().

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>

(cherry picked from commit f9e28904e6442019043a8e94ec6747a064d06003)
[drosen: Fixed conflict in segment.c, applying logic to both branches,
         removed stop_cp_reason as it doesn't exist in 4.19]
Change-Id: I6f9eaa87c76dcab319f3351cb2ffae701eaa3332
Signed-off-by: default avatarDaniel Rosenberg <drosen@google.com>
Bug: 358293777
parent d7575523
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment