Re: BTRFS corruption after conversion to block group tree

Qu Wenruo
2023-12-02T06:43:15Z

On 2023/12/2 16:43, Russell Haley wrote:
> To be clear, there is no reason to be suspicious of the other disk that
> was converted to block group tree and has passed a scrub after
> rebooting? It should be safe to mount that one read-write again?

Scrub is only checksum verification, no comprehensive extent tree
cross-check like `btrfs check`.

If we really screwed up the block group tree conversion, btrfs check
should be able to expose it.

Thus that's why I'm going to add "btrfs check" runs before and after
block group tree conversion.

Just remember, scrub is never as good as "btrfs check".

>
> On 12/1/23 22:25, Qu Wenruo wrote:> Just one more question, is there any
> hibernation/suspension involved in
>> this particular corruption?
>>
>> I have seen exactly such unexplainable writes-from-future cases, which a
>> lot of them have hibernation/suspension involved.
>> (Thus personally speaking, I never go hibernation/suspension on my own
>> devices)
>
> Neither of those, but the affected disk *is* set hdparm -B 128 -S 240,
> which is Advanced Power Management set to the lowest-power value that
> "doesn't permit spin-down", AND a 20 minute spin-down timeout. It's
> possible that this contradictory combination causes firmware
> misbehavior, but this configuration has been in place since late
> December 2021 and there were no problems for almost 2 years.
>
> Unfortunately my notes don't say exactly I combined no-spindown APM with
> a spindown timeout, but it does for sure result in the drives spinning
> down after the configured duration of complete idle. Judging by the data
> I gathered before making that decision, the reason was probably that
> APM<128 gave different spindown timeouts for my 4 assorted hard drives,
> and there was no way to discover the mapping of APM levels to timeout
> durations.
>
> Needless to say, I have reverted that configuration and will just live
> with the extra noise and $20/year.

Very hard to say if it's the firmware's fault, but it can also be our
fault on the bg tree conversion.

Anyway two reports are more than enough for us to enhance bg tree
conversion code.

Thanks,
Qu
>
> Thanks,
>
> Russell Haley