f2fs: fix to handle segment allocation failure correctly
authorChao Yu <chao@kernel.org>
Thu, 22 Feb 2024 12:18:50 +0000 (20:18 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 29 Feb 2024 16:34:34 +0000 (08:34 -0800)
commit7d009e048d7cfcc21d400f2aba4c8bacbdebbd47
tree6264c4453ec9f002f6754d970419dc9224b53e6b
parentf9e28904e6442019043a8e94ec6747a064d06003
f2fs: fix to handle segment allocation failure correctly

If CONFIG_F2FS_CHECK_FS is off, and for very rare corner case that
we run out of free segment, we should not panic kernel, instead,
let's handle such error correctly in its caller.

Signed-off-by: Chao Yu <chao@kernel.org>
Tested-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/file.c
fs/f2fs/gc.c
fs/f2fs/segment.c