mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] erofs: fix unsupported blksize in fileio mode
@ 2024-10-15  3:36 Hongzhen Luo
  2024-10-15  3:47 ` Gao Xiang
  0 siblings, 1 reply; 3+ messages in thread
From: Hongzhen Luo @ 2024-10-15  3:36 UTC (permalink / raw)
  To: linux-erofs; +Cc: linux-kernel, Hongzhen Luo

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@linux.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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] erofs: fix unsupported blksize in fileio mode
  2024-10-15  3:36 [PATCH] erofs: fix unsupported blksize in fileio mode Hongzhen Luo
@ 2024-10-15  3:47 ` Gao Xiang
  2024-10-15  3:53   ` Hongzhen Luo
  0 siblings, 1 reply; 3+ messages in thread
From: Gao Xiang @ 2024-10-15  3:47 UTC (permalink / raw)
  To: Hongzhen Luo, linux-erofs; +Cc: linux-kernel

Hi Hongzhen,

On 2024/10/15 11:36, Hongzhen Luo wrote:
> 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@linux.alibaba.com>

File-backed mounts should support < PAGE_SIZE sizes.
You should just fix these cases instead.

Thanks,
Gao Xiang

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] erofs: fix unsupported blksize in fileio mode
  2024-10-15  3:47 ` Gao Xiang
@ 2024-10-15  3:53   ` Hongzhen Luo
  0 siblings, 0 replies; 3+ messages in thread
From: Hongzhen Luo @ 2024-10-15  3:53 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs; +Cc: linux-kernel


On 2024/10/15 11:47, Gao Xiang wrote:
> Hi Hongzhen,
>
> On 2024/10/15 11:36, Hongzhen Luo wrote:
>> 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@linux.alibaba.com>
>
> File-backed mounts should support < PAGE_SIZE sizes.
> You should just fix these cases instead.
>
> Thanks,
> Gao Xiang


Okay, I will fix it later.

---

Thanks,

Hongzhen


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-15  3:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-15  3:36 [PATCH] erofs: fix unsupported blksize in fileio mode Hongzhen Luo
2024-10-15  3:47 ` Gao Xiang
2024-10-15  3:53   ` Hongzhen Luo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®