On 2018-08-27 18:53, John Petrini wrote:
Hi List,

I'm seeing corruption errors when running btrfs device stats but I'm
not sure what that means exactly. I've just completed a full scrub and
it reported no errors. I'm hoping someone here can enlighten me.
Thanks!

The first thing to understand here is that the error counters reported by `btrfs device stats` are cumulative. In other words, they count errors since the last time they were reset (which means that if you've never run `btrfs device stats -z` on this filesystem, then they will count errors since the filesystem was created). As a result, seeing a non-zero value there just means that errors of that type happened at some point in time since they were reset.

Building on this a bit further, corruption errors are checksum mismatches. Each time a block is read and it's checksum does not match the stored checksum for it, a corruption error is recorded. The thing is though, if you are using a profile which can rebuild that block (dup, raid1, raid10, or one of the parity profiles), the error gets corrected automatically by the filesystem (it will attempt to rebuild that block, then write out the correct block). If that fix succeeds, there will be no errors there anymore, but the record of the error stays around (because there _was_ an error).

Given this, my guess is that you _had_ checksum mismatches somewhere, but they were fixed before you ran scrub.

Reply via email to