[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241015033601.3206952-1-hongzhen@linux.alibaba.com>
Date: Tue, 15 Oct 2024 11:36:01 +0800
From: Hongzhen Luo <hongzhen@...ux.alibaba.com>
To: linux-erofs@...ts.ozlabs.org
Cc: linux-kernel@...r.kernel.org,
Hongzhen Luo <hongzhen@...ux.alibaba.com>
Subject: [PATCH] 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.
Fixes: fb176750266a ("erofs: add file-backed mount support")
Signed-off-by: Hongzhen Luo <hongzhen@...ux.alibaba.com>
---
fs/erofs/super.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 320d586c3896..a7635e667d4b 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -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;
--
2.43.5
Powered by blists - more mailing lists