Patch "udf: Fix off-by-one error when discarding preallocation" has been added to the 5.10-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 off-by-one error when discarding preallocation

to the 5.10-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-off-by-one-error-when-discarding-preallocati.patch
and it can be found in the queue-5.10 subdirectory.

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



commit a0dd1017e6c63ac7a75b9b4c039369f452bd8eb4
Author: Jan Kara <jack@xxxxxxx>
Date:   Mon Jan 23 14:29:15 2023 +0100

    udf: Fix off-by-one error when discarding preallocation
    
    [ Upstream commit f54aa97fb7e5329a373f9df4e5e213ced4fc8759 ]
    
    The condition determining whether the preallocation can be used had
    an off-by-one error so we didn't discard preallocation when new
    allocation was just following it. This can then confuse code in
    inode_getblk().
    
    CC: stable@xxxxxxxxxxxxxxx
    Fixes: 16d055656814 ("udf: Discard preallocation before extending file with a hole")
    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 81876284a83c0..d114774ecdea8 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -442,7 +442,7 @@ static int udf_get_block(struct inode *inode, sector_t block,
 	 * Block beyond EOF and prealloc extents? Just discard preallocation
 	 * as it is not useful and complicates things.
 	 */
-	if (((loff_t)block) << inode->i_blkbits > iinfo->i_lenExtents)
+	if (((loff_t)block) << inode->i_blkbits >= iinfo->i_lenExtents)
 		udf_discard_prealloc(inode);
 	udf_clear_extent_cache(inode);
 	phys = inode_getblk(inode, block, &err, &new);



[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