Commit 83c7423d authored by Jan Kara's avatar Jan Kara

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: 1f3868f0 ("udf: Fix extending file within last block")
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent 41c03ba9
...@@ -595,7 +595,7 @@ static void udf_do_extend_final_block(struct inode *inode, ...@@ -595,7 +595,7 @@ static void udf_do_extend_final_block(struct inode *inode,
*/ */
if (new_elen <= (last_ext->extLength & UDF_EXTENT_LENGTH_MASK)) if (new_elen <= (last_ext->extLength & UDF_EXTENT_LENGTH_MASK))
return; return;
added_bytes = (last_ext->extLength & UDF_EXTENT_LENGTH_MASK) - new_elen; added_bytes = new_elen - (last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
last_ext->extLength += added_bytes; last_ext->extLength += added_bytes;
UDF_I(inode)->i_lenExtents += added_bytes; UDF_I(inode)->i_lenExtents += added_bytes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment