Files
linux/fs/ext2
Wei Gao c8e0967400 ext2: Handle fiemap on empty files to prevent EINVAL
[ Upstream commit a099b09a33 ]

Previously, ext2_fiemap would unconditionally apply "len = min_t(u64, len,
i_size_read(inode));", When inode->i_size was 0 (for an empty file), this
would reduce the requested len to 0. Passing len = 0 to iomap_fiemap could
then result in an -EINVAL error, even for valid queries on empty files.

Link: https://github.com/linux-test-project/ltp/issues/1246
Signed-off-by: Wei Gao <wegao@suse.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20250613152402.3432135-1-wegao@suse.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-20 18:30:21 +02:00
..
2023-01-19 09:24:27 +01:00
2023-05-16 11:32:42 +02:00
2023-05-16 11:32:42 +02:00
2023-05-16 11:32:42 +02:00
2023-01-19 09:24:28 +01:00
2023-01-19 09:24:28 +01:00
2023-01-19 09:24:28 +01:00