Patch "udf: Fix extension of the last extent in the file" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    udf: Fix extension of the last extent in the file

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     udf-fix-extension-of-the-last-extent-in-the-file.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0a34407a4363ac1ba758597a6b5b6c1c3fc459ee
Author: Jan Kara <jack@xxxxxxx>
Date:   Wed Dec 21 17:45:51 2022 +0100

    udf: Fix extension of the last extent in the file
    
    [ Upstream commit 83c7423d1eb6806d13c521d1002cc1a012111719 ]
    
    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@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index f713d108f21d..e92a16435a29 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -600,7 +600,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;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux