Commit b66647b6 authored by Daejun Park's avatar Daejun Park Committed by Matthias Männich
Browse files

UPSTREAM: 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.

Change-Id: Ia41455c85502566c2e07a508c89963d55ec3fc0c
Signed-off-by: default avatarDaejun Park <daejun7.park@samsung.com>
Reviewed-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
(cherry picked from commit 0638a319)
parent 403c8bf1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment