You are not logged in.

#1 2014-12-09 08:28:14

kartofflarna
Member
Registered: 2014-12-09
Posts: 1

BTRFS automatic error fix

So i was looking into the BTRFS function "automatic error fix" for handling corrupt files (bit rot), basically as I understand it the function uses a "per block checksum" to find corrupt blocks and fix them by copying a healthy block from a mirrored pair or parity stripe.

I'm sure I'm missing something but I can't see the logic where this "fixes" the problem, the integrity of the blocks are protected by the checksum but what is protecting the integrity of the checksum?
If a bit is flipped where the metadata checksums are stored wouldn't this compromise the integrity of the original blocks?

Sure there are less bits that can be corrupted in the metadata so i guess that minimizes the problem and there is no such thing as a perfect system but I would like to know if there is something in place that protects the metadata containing the checksum from corruption?

Offline

#2 2014-12-09 23:50:40

nstgc
Member
Registered: 2014-03-17
Posts: 393

Re: BTRFS automatic error fix

kartofflarna wrote:

So i was looking into the BTRFS function "automatic error fix" for handling corrupt files (bit rot), basically as I understand it the function uses a "per block checksum" to find corrupt blocks and fix them by copying a healthy block from a mirrored pair or parity stripe.

I'm sure I'm missing something but I can't see the logic where this "fixes" the problem, the integrity of the blocks are protected by the checksum but what is protecting the integrity of the checksum?

It uses a checksum tree. Checksums are checksumed which are checksumed...

If a bit is flipped where the metadata checksums are stored wouldn't this compromise the integrity of the original blocks?

No, because those are checksummed. Sure, its possible that one of the bits at the very top could get damaged, but that's like firing a single rifle round in the air randomly in the middle of nowhere, and having it kill someone whom I shouldn't mention so that I don't get a permanent wire tap. The point is, yeah, it can happen, but the chances of that are really really small.

Sure there are less bits that can be corrupted in the metadata so i guess that minimizes the problem and there is no such thing as a perfect system but I would like to know if there is something in place that protects the metadata containing the checksum from corruption?

See above.

[edit] Oh wait, I use Linux, so I already have a permanent wiretap.

Hi Mister/Misses big brother!

Last edited by nstgc (2014-12-09 23:53:35)

Offline

Board footer

Powered by FluxBB