Skip to content

Commit 0dca737

Browse files
jankaragregkh
authored andcommitted
udf: Fix extension of the last extent in the file
[ Upstream commit 83c7423 ] When extending the last extent in the file within the last block, we wrongly computed the length of the last extent. This is mostly a cosmetical problem since the extent does not contain any data and the length will be fixed up by following operations but still. Fixes: 1f3868f ("udf: Fix extending file within last block") Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent dc1bc90 commit 0dca737

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/udf/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ static void udf_do_extend_final_block(struct inode *inode,
599599
*/
600600
if (new_elen <= (last_ext->extLength & UDF_EXTENT_LENGTH_MASK))
601601
return;
602-
added_bytes = (last_ext->extLength & UDF_EXTENT_LENGTH_MASK) - new_elen;
602+
added_bytes = new_elen - (last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
603603
last_ext->extLength += added_bytes;
604604
UDF_I(inode)->i_lenExtents += added_bytes;
605605

0 commit comments

Comments
 (0)