Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] btrfs: tree-checker: add missing returns after data_ref alignment checks
Date: Sat, 21 Nov 2020 06:51:09 +0800	[thread overview]
Message-ID: <2575a8c4-7898-1d72-191a-832c59629fbb@gmx.com> (raw)
In-Reply-To: <20201120155558.29684-1-dsterba@suse.com>


[-- Attachment #1.1: Type: text/plain, Size: 1396 bytes --]



On 2020/11/20 下午11:55, David Sterba wrote:
> There are sectorsize alignment checks that are reported but then
> check_extent_data_ref continues. This was not intended, wrong alignment
> is not a minor problem and we should return with error.
> 
> CC: stable@vger.kernel.org # 5.4+
> Fixes: 0785a9aacf9d ("btrfs: tree-checker: Add EXTENT_DATA_REF check")
> Signed-off-by: David Sterba <dsterba@suse.com>

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

Thanks,
Qu
> ---
>  fs/btrfs/tree-checker.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
> index 1b27242a9c0b..f3f666b343ef 100644
> --- a/fs/btrfs/tree-checker.c
> +++ b/fs/btrfs/tree-checker.c
> @@ -1424,6 +1424,7 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
>  	"invalid item size, have %u expect aligned to %zu for key type %u",
>  			    btrfs_item_size_nr(leaf, slot),
>  			    sizeof(*dref), key->type);
> +		return -EUCLEAN;
>  	}
>  	if (!IS_ALIGNED(key->objectid, leaf->fs_info->sectorsize)) {
>  		generic_err(leaf, slot,
> @@ -1452,6 +1453,7 @@ static int check_extent_data_ref(struct extent_buffer *leaf,
>  			extent_err(leaf, slot,
>  	"invalid extent data backref offset, have %llu expect aligned to %u",
>  				   offset, leaf->fs_info->sectorsize);
> +			return -EUCLEAN;
>  		}
>  	}
>  	return 0;
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2020-11-20 22:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 15:55 [PATCH] btrfs: tree-checker: add missing returns after data_ref alignment checks David Sterba
2020-11-20 22:51 ` Qu Wenruo [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=2575a8c4-7898-1d72-191a-832c59629fbb@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=stable@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