]> www.infradead.org Git - users/jedix/linux-maple.git/commit
f2fs: avoid unused block when dio write in LFS mode
authorDaejun Park <daejun7.park@samsung.com>
Thu, 5 Sep 2024 05:24:33 +0000 (14:24 +0900)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 11 Sep 2024 03:30:27 +0000 (03:30 +0000)
commit0638a3197c194bed837c157c3574685e36febc7b
tree6c772d7a3d7df2c2687d60506c97cf74a4ac31c3
parentbfe5c02654261bfb8bd9cb174a67f3279ea99e58
f2fs: avoid unused block when dio write in LFS mode

This patch addresses the problem that when using LFS mode, unused blocks
may occur in f2fs_map_blocks() during block allocation for dio writes.

If a new section is allocated during block allocation, it will not be
included in the map struct by map_is_mergeable() if the LBA of the
allocated block is not contiguous. However, the block already allocated
in this process will remain unused due to the LFS mode.

This patch avoids the possibility of unused blocks by escaping
f2fs_map_blocks() when allocating the last block in a section.

Signed-off-by: Daejun Park <daejun7.park@samsung.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c