]> git.baikalelectronics.ru Git - kernel.git/commit
udf: Fix off-by-one error when discarding preallocation
authorJan Kara <jack@suse.cz>
Mon, 23 Jan 2023 13:29:15 +0000 (14:29 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:50:19 +0000 (08:50 +0100)
commitee0f4a4aede6a496db9f53c3a08485137debd4c0
treef6bfdc6cf5b312a0ea34f2826cea7ee53961ff6b
parentc8b7b4c567d9fc3dfa69f7f19c8c24ec31acabc4
udf: Fix off-by-one error when discarding preallocation

[ Upstream commit 490a849b4a3d6e9bd67f9aa4385502dadbb70a32 ]

The condition determining whether the preallocation can be used had
an off-by-one error so we didn't discard preallocation when new
allocation was just following it. This can then confuse code in
inode_getblk().

CC: stable@vger.kernel.org
Fixes: 189b02ac597c ("udf: Discard preallocation before extending file with a hole")
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/udf/inode.c