public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Christoph Hellwig <hch@lst.de>,
	clm@fb.com, josef@toxicpanda.com, dsterba@suse.com,
	naohiro.aota@wdc.com
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2] btrfs: fix missing endianess conversion in sb_write_pointer
Date: Tue, 15 Nov 2022 18:17:54 +0800	[thread overview]
Message-ID: <f54a904d-cbf0-2e46-523f-9be87bf82d2e@gmx.com> (raw)
In-Reply-To: <20221115093944.1625659-1-hch@lst.de>



On 2022/11/15 17:39, Christoph Hellwig wrote:
> generation is an on-disk __le64 value, so use btrfs_super_generation to
> convert it to host endian before comparing it.
> 
> Fixes: 12659251ca5d ("btrfs: implement log-structured superblock for ZONED mode")
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu

> ---
> 
> Changes since v1:
>   - use btrfs_super_generation instead of le64_to_cpu
> 
>   fs/btrfs/zoned.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
> index 6781c141a6b41..4b55a5c68826f 100644
> --- a/fs/btrfs/zoned.c
> +++ b/fs/btrfs/zoned.c
> @@ -137,7 +137,8 @@ static int sb_write_pointer(struct block_device *bdev, struct blk_zone *zones,
>   			super[i] = page_address(page[i]);
>   		}
>   
> -		if (super[0]->generation > super[1]->generation)
> +		if (btrfs_super_generation(super[0]) >
> +		    btrfs_super_generation(super[1]))
>   			sector = zones[1].start;
>   		else
>   			sector = zones[0].start;

  parent reply	other threads:[~2022-11-15 10:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-15  9:39 [PATCH v2] btrfs: fix missing endianess conversion in sb_write_pointer Christoph Hellwig
2022-11-15  9:41 ` Johannes Thumshirn
2022-11-15 10:17 ` Qu Wenruo [this message]
2022-11-15 13:59 ` David Sterba

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=f54a904d-cbf0-2e46-523f-9be87bf82d2e@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hch@lst.de \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=naohiro.aota@wdc.com \
    /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