Patch "btrfs: subpage: make btrfs_submit_compressed_write() compatible" has been added to the 5.4-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

    btrfs: subpage: make btrfs_submit_compressed_write() compatible

to the 5.4-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:
     btrfs-subpage-make-btrfs_submit_compressed_write-com.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 43eed27532e1c7b2ae261346cf8bda59a148be60
Author: Qu Wenruo <wqu@xxxxxxxx>
Date:   Mon Sep 27 15:22:00 2021 +0800

    btrfs: subpage: make btrfs_submit_compressed_write() compatible
    
    [ Upstream commit bbbff01a47bfe1b7733c5ccac6a78ff6d7a8954f ]
    
    There is a WARN_ON() checking if @start is aligned to PAGE_SIZE, not
    sectorsize, which will cause false alert for subpage.  Fix it to check
    against sectorsize.
    
    Furthermore:
    
    - Use ASSERT() to do the check
      So that in the future we may skip the check for production build
    
    - Also check alignment for @len
    
    Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
    Signed-off-by: David Sterba <dsterba@xxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 28f78e4f2c87a..fc64f75075e31 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -324,7 +324,8 @@ blk_status_t btrfs_submit_compressed_write(struct inode *inode, u64 start,
 	blk_status_t ret;
 	int skip_sum = BTRFS_I(inode)->flags & BTRFS_INODE_NODATASUM;
 
-	WARN_ON(!PAGE_ALIGNED(start));
+	ASSERT(IS_ALIGNED(start, fs_info->sectorsize) &&
+	       IS_ALIGNED(len, fs_info->sectorsize));
 	cb = kmalloc(compressed_bio_size(fs_info, compressed_len), GFP_NOFS);
 	if (!cb)
 		return BLK_STS_RESOURCE;



[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