public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Josef Bacik <josef@toxicpanda.com>, Qu Wenruo <wqu@suse.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v3 3/5] btrfs: Detect unbalanced tree with empty leaf before crashing btree operations
Date: Wed, 12 Aug 2020 08:29:18 +0800	[thread overview]
Message-ID: <fb4aea50-0e81-6444-ae9f-3e6c2df88c67@gmx.com> (raw)
In-Reply-To: <ee1203ab-444d-cc9d-0e00-2102bd02ecd2@toxicpanda.com>



On 2020/8/12 上午8:23, Josef Bacik wrote:
> On 8/11/20 7:04 PM, Qu Wenruo wrote:
>>
>>
[...]
>>> Which I assume is the problem?  The generation is 19, is that >
>>> last_trans_committed?  Seems like this check just needs to be moved
>>> lower, right?  Thanks,
>>
>> Nope, that generation 19 is valid. That fs has a higher generation, so
>> that's completely valid.
>>
>> The generation 19 is there because there is another csum leaf whose
>> generation is 19.
>>
>
> Then this patch does nothing, because we already have this check lower,
> so how exactly did it make the panic go away?  Thanks,
>
> Josef

Sorry, I don't get your point.

The generation 19 isn't larger than last_trans_committed, so that check
has nothing to do with this case.

And then it goes to the header_nritems() check, which is 0, and with
first_key present, which is invalid and we error out, rejecting the
corrupted leaf.

What's the problem then?

Thanks,
Qu

  reply	other threads:[~2020-08-12  0:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-09 12:09 [PATCH v3 0/5] btrfs: Enhanced runtime defence against fuzzed images Qu Wenruo
2020-08-09 12:09 ` [PATCH v3 1/5] btrfs: extent_io: Do extra check for extent buffer read write functions Qu Wenruo
2020-08-11 18:42   ` Josef Bacik
2020-08-09 12:09 ` [PATCH v3 2/5] btrfs: extent-tree: Kill BUG_ON() in __btrfs_free_extent() and do better comment Qu Wenruo
2020-08-11 18:45   ` Josef Bacik
2020-08-09 12:09 ` [PATCH v3 3/5] btrfs: Detect unbalanced tree with empty leaf before crashing btree operations Qu Wenruo
2020-08-11 18:48   ` Josef Bacik
2020-08-11 23:04     ` Qu Wenruo
2020-08-12  0:23       ` Josef Bacik
2020-08-12  0:29         ` Qu Wenruo [this message]
2020-08-12  1:50           ` Josef Bacik
2020-08-12  1:53             ` Qu Wenruo
2020-08-09 12:09 ` [PATCH v3 4/5] btrfs: extent-tree: Kill the BUG_ON() in insert_inline_extent_backref() Qu Wenruo
2020-08-11 18:50   ` Josef Bacik
2020-08-09 12:09 ` [PATCH v3 5/5] btrfs: ctree: Checking key orders before merged tree blocks Qu Wenruo
2020-08-11 18:53   ` Josef Bacik

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=fb4aea50-0e81-6444-ae9f-3e6c2df88c67@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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