Skip to content

Commit 83c7423

Browse files
committed
udf: Fix extension of the last extent in the file
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 <[email protected]>
1 parent 41c03ba commit 83c7423

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
@@ -595,7 +595,7 @@ static void udf_do_extend_final_block(struct inode *inode,
595595
*/
596596
if (new_elen <= (last_ext->extLength & UDF_EXTENT_LENGTH_MASK))
597597
return;
598-
added_bytes = (last_ext->extLength & UDF_EXTENT_LENGTH_MASK) - new_elen;
598+
added_bytes = new_elen - (last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
599599
last_ext->extLength += added_bytes;
600600
UDF_I(inode)->i_lenExtents += added_bytes;
601601

0 commit comments

Comments
 (0)