mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: "Анастасия Белова" <abelova@astralinux.ru>, "Chris Mason" <clm@fb.com>
Cc: Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	lvc-project@linuxtesting.org
Subject: Re: [PATCH] btrfs: parent bytenr must be aligned to sector size
Date: Wed, 26 Apr 2023 20:25:14 +0800	[thread overview]
Message-ID: <8fb6638f-1e99-a1c1-3fa1-f814d08d2659@suse.com> (raw)
In-Reply-To: <20230426115323.9455-1-abelova@astralinux.ru>



On 2023/4/26 19:53, Анастасия Белова wrote:
> From: Anastasia Belova <abelova@astralinux.ru>
> 
> Change nodesize to sectorsize in alignment check
> in print_extent_item. Change requirement in comment.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: ea57788eb76d ("btrfs: require only sector size alignment for parent eb bytenr")
> Signed-off-by: Anastasia Belova <abelova@astralinux.ru>

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

A little surprised that a static checker can even find such hidden problem.

Thanks,
Qu
> ---
>   fs/btrfs/print-tree.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
> index b93c96213304..cee005fb8209 100644
> --- a/fs/btrfs/print-tree.c
> +++ b/fs/btrfs/print-tree.c
> @@ -152,9 +152,9 @@ static void print_extent_item(struct extent_buffer *eb, int slot, int type)
>   			       offset, btrfs_shared_data_ref_count(eb, sref));
>   			/*
>   			 * offset is supposed to be a tree block which
> -			 * must be aligned to nodesize.
> +			 * must be aligned to sectorsize.
>   			 */
> -			if (!IS_ALIGNED(offset, eb->fs_info->nodesize))
> +			if (!IS_ALIGNED(offset, eb->fs_info->sectorsize))
>   				pr_info(
>   			"\t\t\t(parent %llu not aligned to sectorsize %u)\n",
>   				     offset, eb->fs_info->sectorsize);

  reply	other threads:[~2023-04-26 12:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26 11:53 Анастасия Белова
2023-04-26 12:25 ` Qu Wenruo [this message]
2023-04-28 16:44   ` David Sterba
2023-04-28 16:42 ` 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=8fb6638f-1e99-a1c1-3fa1-f814d08d2659@suse.com \
    --to=wqu@suse.com \
    --cc=abelova@astralinux.ru \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvc-project@linuxtesting.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®