f2fs: fix to map blocks correctly for direct write
authorChao Yu <chao@kernel.org>
Mon, 4 Nov 2024 01:35:51 +0000 (09:35 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 5 Nov 2024 18:29:57 +0000 (18:29 +0000)
commit5dd00ebda337b9295e7027691fa70540da369ff2
treec315a19119983fb286f0c0bd240c6f270129afa4
parent7b0033dbc48340a1c1c3f12448ba17d6587ca092
f2fs: fix to map blocks correctly for direct write

f2fs_map_blocks() supports to map continuous holes or preallocated
address, we should avoid setting F2FS_MAP_MAPPED for these cases
only, otherwise, it may fail f2fs_iomap_begin(), and make direct
write fallbacking to use buffered IO and flush, result in performance
regression.

Fixes: 9f0f6bf42714 ("f2fs: support to map continuous holes or preallocated address")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202409122103.e45aa13b-oliver.sang@intel.com
Cc: Cyril Hrubis <chrubis@suse.cz>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/data.c