erofs: fix unsupported blksize in fileio mode
PATCH 1/1 erofs: fix unsupported blksize in fileio mode
In fileio mode, when blcksize is not equal to PAGE_SIZE, erofs will attempt to set the block size of sb->s_bdev, which will trigger a panic. This patch fixes this.
--- fs/erofs/super.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/erofs/super.c +4 -0
@@ -631,6 +631,10 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)errorfc (fc,"unsupported blksize for fscache mode" );return -EINVAL ; } +if (erofs_is_fileio_mode (sbi)) { +errorfc (fc,"unsupported blksize for fileio mode" ); +return -EINVAL ; + }if (!sb_set_blocksize (sb,1 << sbi->blkszbits)) {errorfc (fc,"failed to set erofs blksize" );return -EINVAL ;
Signature · 1 line
2.43.5
Hi Hongzhen,
Quoted 7 lines · Hongzhen Luo
In fileio mode, when blcksize is not equal to
PAGE_SIZE, erofs will attempt to set the block size ofsb->s_bdev, which will trigger a panic. This patch fixes this.Fixes fb176750266a ("erofs: add file-backed mount support")Signed-off-by Hongzhen Luo <[email protected]>
File-backed mounts should support < PAGE_SIZE sizes. You should just fix these cases instead.
Thanks,
Gao Xiang
Quoted 9 lines · Gao Xiang
Hi Hongzhen,
Quoted 6 lines · Hongzhen Luo
In fileio mode, when blcksize is not equal to
PAGE_SIZE, erofs will attempt to set the block size ofsb->s_bdev, which will trigger a panic. This patch fixes this.Fixes fb176750266a ("erofs: add file-backed mount support")
Quoted 7 lines
Quoted 1 line
Signed-off-by Hongzhen Luo <[email protected]>File-backed mounts should support <
PAGE_SIZEsizes. You should just fix these cases instead.Thanks,
Gao Xiang
Okay, I will fix it later.
---
Thanks,
Hongzhen