diff options
author | Jan Kara <jack@suse.cz> | 2022-12-21 17:45:51 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2023-01-06 15:44:07 +0100 |
commit | 83c7423d1eb6806d13c521d1002cc1a012111719 (patch) | |
tree | f88fec02d7b2f94e649619ce7b1a0918834447a1 /fs | |
parent | 41c03ba9beea760bd2d2ac9250b09a2e192da2dc (diff) |
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: 1f3868f06855 ("udf: Fix extending file within last block")
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/udf/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 1d7c2a812fc1..f3e988928d1d 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -595,7 +595,7 @@ static void udf_do_extend_final_block(struct inode *inode, */ if (new_elen <= (last_ext->extLength & UDF_EXTENT_LENGTH_MASK)) 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; UDF_I(inode)->i_lenExtents += added_bytes; |