]> www.infradead.org Git - users/jedix/linux-maple.git/commit
f2fs: don't rely on F2FS_MAP_* in f2fs_iomap_begin
authorChristoph Hellwig <hch@lst.de>
Mon, 28 Nov 2022 09:15:09 +0000 (10:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 12:55:16 +0000 (13:55 +0100)
commit14b3742f34b13b970a4e7ba91884106ce6caab72
tree1dc834492f4d6aba7eeacdad740ffe88119eea57
parentd35290addcbac94b076babe0a798a8c043421812
f2fs: don't rely on F2FS_MAP_* in f2fs_iomap_begin

[ Upstream commit 8d3c1fa3fa5eacfd14f5b018eddb6c1a91c57783 ]

When testing with a mixed zoned / convention device combination, there
are regular but not 100% reproducible failures in xfstests generic/113
where the __is_valid_data_blkaddr assert hits due to finding a hole.

This seems to be because f2fs_map_blocks can set this flag on a hole
when it was found in the extent cache.

Rework f2fs_iomap_begin to just check the special block numbers directly.
This has the added benefits of the WARN_ON showing which invalid block
address we found, and being properly error out on delalloc blocks that
are confusingly called unwritten but not actually suitable for direct
I/O.

Fixes: 1517c1a7a445 ("f2fs: implement iomap operations")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/data.c