Commit 327276cb authored by Wei Gao's avatar Wei Gao Committed by Greg Kroah-Hartman
Browse files

ext2: Handle fiemap on empty files to prevent EINVAL

[ Upstream commit a099b09a ]

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: default avatarWei Gao <wegao@suse.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20250613152402.3432135-1-wegao@suse.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 6c7fadac
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment