diff options
| author | Chao Yu <chao@kernel.org> | 2024-11-08 09:25:57 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-12-14 20:03:12 +0100 |
| commit | 8e9fec7f79ad62bab021333bee1bfec74be6d978 (patch) | |
| tree | c056dbb986a9d7aeed24bed718642f0ce59e36c2 /include/linux | |
| parent | e6a91ed4b9e5baffbf3c7f77a92381eb4730ed66 (diff) | |
| download | linux-8e9fec7f79ad62bab021333bee1bfec74be6d978.tar.gz linux-8e9fec7f79ad62bab021333bee1bfec74be6d978.tar.bz2 linux-8e9fec7f79ad62bab021333bee1bfec74be6d978.zip | |
f2fs: fix to requery extent which cross boundary of inquiry
[ Upstream commit 6787a82245857271133b63ae7f72f1dc9f29e985 ]
dd if=/dev/zero of=file bs=4k count=5
xfs_io file -c "fiemap -v 2 16384"
file:
EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
0: [0..31]: 139272..139303 32 0x1000
1: [32..39]: 139304..139311 8 0x1001
xfs_io file -c "fiemap -v 0 16384"
file:
EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
0: [0..31]: 139272..139303 32 0x1000
xfs_io file -c "fiemap -v 0 16385"
file:
EXT: FILE-OFFSET BLOCK-RANGE TOTAL FLAGS
0: [0..39]: 139272..139311 40 0x1001
There are two problems:
- continuous extent is split to two
- FIEMAP_EXTENT_LAST is missing in last extent
The root cause is: if upper boundary of inquiry crosses extent,
f2fs_map_blocks() will truncate length of returned extent to
F2FS_BYTES_TO_BLK(len), and also, it will stop to query latter
extent or hole to make sure current extent is last or not.
In order to fix this issue, once we found an extent locates
in the end of inquiry range by f2fs_map_blocks(), we need to
expand inquiry range to requiry.
Cc: stable@vger.kernel.org
Fixes: 7f63eb77af7b ("f2fs: report unwritten area in f2fs_fiemap")
Reported-by: Zhiguo Niu <zhiguo.niu@unisoc.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
