Linux block layer
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Johannes Thumshirn <jth@kernel.org>
Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org,
	Damien Le Moal <dlemoal@kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	Johannes Thumshirn <johannes.thumshirn@wdc.com>
Subject: Re: [PATCH] zonefs: use ZONEFS_SUPER_SIZE instead of PAGE_SIZE
Date: Tue, 29 Apr 2025 07:48:42 -0700	[thread overview]
Message-ID: <20250429144842.GC1035866@frogsfrogsfrogs> (raw)
In-Reply-To: <c14f62628e0417498ace0caaa1f4fef2cb0f8477.1745934166.git.jth@kernel.org>

On Tue, Apr 29, 2025 at 03:42:53PM +0200, Johannes Thumshirn wrote:
> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> 
> Use ZONEFS_SUPER_SIZE constant instead of PAGE_SIZE allocating memory for
> reading the super block in zonefs_read_super().
> 
> While PAGE_SIZE technically isn't incorrect as Linux doesn't support pages
> smaller than 4k ZONEFS_SUPER_SIZE is semantically more correct.

Yeah, that is less likely to leave a landmine if the super size ever
gets bigger or someone goes nuts and reintroduces tinypages.

Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> 
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
> 
> ---
> This patch is based on top of Christoph's series titled "add more bio
> helper" specifically on top of "[PATCH 16/17] zonefs: use bdev_rw_virt in
> zonefs_read_super"
> ---
>  fs/zonefs/super.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index d165eb979f21..4dc7f967c861 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -1113,11 +1113,12 @@ static int zonefs_read_super(struct super_block *sb)
>  	u32 crc, stored_crc;
>  	int ret;
>  
> -	super = kmalloc(PAGE_SIZE, GFP_KERNEL);
> +	super = kmalloc(ZONEFS_SUPER_SIZE, GFP_KERNEL);
>  	if (!super)
>  		return -ENOMEM;
>  
> -	ret = bdev_rw_virt(sb->s_bdev, 0, super, PAGE_SIZE, REQ_OP_READ);
> +	ret = bdev_rw_virt(sb->s_bdev, 0, super, ZONEFS_SUPER_SIZE,
> +			   REQ_OP_READ);
>  	if (ret)
>  		goto free_super;
>  
> -- 
> 2.43.0
> 
> 

  reply	other threads:[~2025-04-29 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29 13:42 [PATCH] zonefs: use ZONEFS_SUPER_SIZE instead of PAGE_SIZE Johannes Thumshirn
2025-04-29 14:48 ` Darrick J. Wong [this message]
2025-05-07  4:16 ` Damien Le Moal
2025-06-13  8:07 ` Damien Le Moal

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=20250429144842.GC1035866@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=dlemoal@kernel.org \
    --cc=hch@lst.de \
    --cc=johannes.thumshirn@wdc.com \
    --cc=jth@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@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