public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: Ivo Smits <ivo@ucis.nl>, linux-btrfs@vger.kernel.org
Subject: Re: parent transid verify failed on raid1
Date: Thu, 8 May 2025 07:23:15 +0930	[thread overview]
Message-ID: <db844b03-0f1c-4124-a705-bfe07eaeb9b9@suse.com> (raw)
In-Reply-To: <507f3dd3-1148-40be-8223-87be96ac6269@ucis.nl>



在 2025/5/8 02:03, Ivo Smits 写道:
> Hello everyone,
> 
> After some abuse (drive going offline and unexpected shutdowns) one of 
> my fairly large BTRFS filesystems seems to suffer from some corruption. 
> The filesystem still mounts and operates mostly fine. A lot of errors 
> (probably caused by a drive going offline and later returning) have been 
> recovered from a good RAID1 mirror by scrub a little while ago, but some 
> problems persist.
> 
> The kernel log is repeating the following two messages about every 30 
> seconds:
> 
> BTRFS error (device sdg1): parent transid verify failed on logical 
> 31419461632000 mirror 1 wanted 1240926 found 1089963
> BTRFS error (device sdg1): parent transid verify failed on logical 
> 31419461632000 mirror 2 wanted 1240926 found 1089963

The transid mismatch mostly a death sentence for a btrfs.

This normally means bad metadata COW or bad hardware FLUSH/FUA behavior.

> 
> I suspect this might be some background process in the kernel trying to 
> clean things up since it starts after mounting and doesn't stop.

Nope, no regular operation should lead to such problem.

Not to mention both mirrors share the same bad transid.

[...]
> 
> I also ran btrfs check while the filesystem was unmounted. This first 
> discovered the two transid failures also found by scrub, and then 
> continued to find a lot more errors, like reference count and bytenr 
> mismatches. Since the filesystem appears to operate normally and scrub 
> did not find those errors, could this just be blocks which are no longer 
> part of the filesystem tree, possibly not even referenced by anything?

When anything go wrong on btrfs, please just go "btrfs check --readonly" 
on the unmounted fs directly.

That's the only reliable way to evaluate the problem.
If the fs is too large, or you want a better way to show the errors, 
"btrfs check --readonly --mode=lowmem" will also help.

> 
> Is this situation something btrfs check can fix? Is it possible to only 
> let it fix the most problematic transid error and ignore everything 
> else? Could manually patching the transid value help btrfs clean things up?

Normally no to all the questions above.

Thanks,
Qu

> 
> Most of the data on the filesystem is backup data, or can be backed up 
> elsewhere, so losing some files would not be the end of the world, as 
> long as damaged files can be identified and there is no silent data 
> corruption.
> 
> Best regards,
> 
> Ivo
> 
> 

      reply	other threads:[~2025-05-07 21:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-07 16:33 parent transid verify failed on raid1 Ivo Smits
2025-05-07 21:53 ` 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=db844b03-0f1c-4124-a705-bfe07eaeb9b9@suse.com \
    --to=wqu@suse.com \
    --cc=ivo@ucis.nl \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox