All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Christoph Anton Mitterer <calestyo@scientia.org>,
	linux-btrfs@vger.kernel.org
Subject: Re: BTRFS error (device dm-0): parent transid verify failed on 1382301696 wanted 262166 found 22
Date: Mon, 28 Feb 2022 14:48:31 +0800	[thread overview]
Message-ID: <edefb747-0033-717d-5383-f8c2f22efc8f@gmx.com> (raw)
In-Reply-To: <22f7f0a5c02599c42748c82b990153bf49263512.camel@scientia.org>



On 2022/2/28 13:32, Christoph Anton Mitterer wrote:
> And I still don't understand this:
>
>
> On Mon, 2022-02-28 at 08:55 +0800, Qu Wenruo wrote:
>> The corruption part is a tree block in checksum tree (ironically).
>>
>> This corruption makes btrfs unable to read (part of) checksum tree
>
> You say the damage is in the csum tree... is that checksummed itself
> (and the error is noticed just by reading the block in the tree)... or
> is it noticed when the (actual data) is compared to the (wrong) data in
> the ckecksum tree and the mismatch is detected.

Btrfs handles checksum differently for metadata (tree block) and data.

For metadata, its header has 32 bytes reserved for checksum, and that's
where the csum of metadata is.
Aka, inlined checksum.

For data, we put data checksum into its own tree, aka the csum tree.
It records the logical -> data checksum mapping.

Currently, if btrfs has any thing wrong searching csum tree, it will not
even submit the data read.

>
>
>> thus
>> unable to verify a lot of data.
>
> How much is a lot? I copied the whole fs before, when I made the
> backup,.. and I got errors only for that 1382301696 and that one
> file... all others, tar read without giving any error.
> Is that exepcted?nd out which files are affected by that part of
the checksum tre

It really depends.

For the worst case, if the generation mismatch happens at a very high
level, the whole csum tree can be rendered useless.
In that case, almost all data can be affected (although the data on-disk
may still be OK).

For the best case, it's just a leave got this corruption.
In that case, if you're using SHA256 and 16K nodesize, you get at most
2MiB range which can not be read.
(Again, on disk data can still be fine)

>
>
>
>
>> For memory bitflip, since it's corrupted in memory, the checksum will
>> be
>> calculated using the corrupted data, thus the checksum for that tree
>> block will be correct, thus scrub won't detect it.
>
> Could that part of the checksum block have been rewritten recently?

Depends on the generation. If your current generation (can be checked
with btrfs ins dump-super) is close to the number 262166, then it's
possible it's rewritten recently.

Thanks,
Qu

> Cause I send/received that data at least once in the past to another
> fs... and I would have assumed that any error should have shown up
> already back then (didn't however).... so the bitflip must have
> happened recently... after the affected file had been written to disk
> originally (and after it's checksum had been written originally).
>
>
> Thanks,
> Chris.

  reply	other threads:[~2022-02-28  6:48 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27 17:45 BTRFS error (device dm-0): parent transid verify failed on 1382301696 wanted 262166 found 22 Christoph Anton Mitterer
2022-02-27 23:26 ` Qu Wenruo
2022-02-28  0:38   ` Christoph Anton Mitterer
2022-02-28  0:55     ` Qu Wenruo
2022-02-28  5:19       ` Christoph Anton Mitterer
2022-02-28  6:54         ` Qu Wenruo
2022-02-28  5:32       ` Christoph Anton Mitterer
2022-02-28  6:48         ` Qu Wenruo [this message]
2022-02-28 15:24           ` Christoph Anton Mitterer
2022-03-01  0:19             ` Qu Wenruo
2022-03-01  2:14               ` Christoph Anton Mitterer
2022-03-01  2:30                 ` Qu Wenruo
2022-03-02  1:38                   ` Christoph Anton Mitterer
2022-03-02  2:01                     ` Qu Wenruo

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=edefb747-0033-717d-5383-f8c2f22efc8f@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=calestyo@scientia.org \
    --cc=linux-btrfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.