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

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



commit 4fa2ff4709d87e12e150d129663270a7beaa1ffe
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 30d82cdf128cf..86f7eb75ea506 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -404,7 +404,8 @@ blk_status_t btrfs_submit_compressed_write(struct btrfs_inode *inode, u64 start,
 	const bool use_append = btrfs_use_zone_append(inode, disk_start);
 	const unsigned int bio_op = use_append ? REQ_OP_ZONE_APPEND : REQ_OP_WRITE;
 
-	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