From: Gao Xiang <hsiangkao@linux.alibaba.com>
To: Hongzhen Luo <hongzhen@linux.alibaba.com>, linux-erofs@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] erofs: fix blksize < PAGE_SIZE for file-backed mounts
Date: Tue, 15 Oct 2024 15:52:44 +0800 [thread overview]
Message-ID: <b0c38bac-a682-45ae-8991-b73991ae6ddb@linux.alibaba.com> (raw)
In-Reply-To: <20241015070750.3489603-1-hongzhen@linux.alibaba.com>
On 2024/10/15 15:07, Hongzhen Luo wrote:
> 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@linux.alibaba.com>
> ---
> v3: Fix trivial typos.
> v2: https://lore.kernel.org/linux-erofs/20241015064007.3449582-1-hongzhen@linux.alibaba.com/
> v1: https://lore.kernel.org/linux-erofs/20241015033601.3206952-1-hongzhen@linux.alibaba.com/
> ---
> fs/erofs/super.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/fs/erofs/super.c b/fs/erofs/super.c
> index 320d586c3896..ca45dfb17d7c 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);
Why needing parentheses here?
Thanks,
Gao Xiang
> + sb->s_blocksize_bits = sbi->blkszbits;
> + } else if (!sb_set_blocksize(sb, 1 << sbi->blkszbits)) {
> errorfc(fc, "failed to set erofs blksize");
> return -EINVAL;
> }
prev parent reply other threads:[~2024-10-15 7:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 7:07 Hongzhen Luo
2024-10-15 7:52 ` Gao Xiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0c38bac-a682-45ae-8991-b73991ae6ddb@linux.alibaba.com \
--to=hsiangkao@linux.alibaba.com \
--cc=hongzhen@linux.alibaba.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®