Patch "erofs: fix blksize < PAGE_SIZE for file-backed mounts" has been added to the 6.12-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

    erofs: fix blksize < PAGE_SIZE for file-backed mounts

to the 6.12-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:
     erofs-fix-blksize-page_size-for-file-backed-mounts.patch
and it can be found in the queue-6.12 subdirectory.

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



commit 932de7ab63436f5ef7768fec373a1c4bc4e3ba53
Author: Hongzhen Luo <hongzhen@xxxxxxxxxxxxxxxxx>
Date:   Tue Oct 15 18:38:36 2024 +0800

    erofs: fix blksize < PAGE_SIZE for file-backed mounts
    
    [ Upstream commit bae0854160939a64a092516ff1b2f221402b843b ]
    
    Adjust sb->s_blocksize{,_bits} directly for file-backed
    mounts when the fs block size is smaller than PAGE_SIZE.
    
    Previously, EROFS used sb_set_blocksize(), which caused
    a panic if bdev-backed mounts is not used.
    
    Fixes: fb176750266a ("erofs: add file-backed mount support")
    Signed-off-by: Hongzhen Luo <hongzhen@xxxxxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20241015103836.3757438-1-hongzhen@xxxxxxxxxxxxxxxxx
    Signed-off-by: Gao Xiang <hsiangkao@xxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index bed3dbe5b7cb8..2dd7d819572f4 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -631,7 +631,11 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
 			errorfc(fc, "unsupported blksize for fscache mode");
 			return -EINVAL;
 		}
-		if (!sb_set_blocksize(sb, 1 << sbi->blkszbits)) {
+
+		if (erofs_is_fileio_mode(sbi)) {
+			sb->s_blocksize = 1 << sbi->blkszbits;
+			sb->s_blocksize_bits = sbi->blkszbits;
+		} else if (!sb_set_blocksize(sb, 1 << sbi->blkszbits)) {
 			errorfc(fc, "failed to set erofs blksize");
 			return -EINVAL;
 		}




[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