linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* corruption_errs
@ 2018-08-27 22:53 John Petrini
  2018-08-28 11:17 ` corruption_errs Austin S. Hemmelgarn
  0 siblings, 1 reply; 2+ messages in thread
From: John Petrini @ 2018-08-27 22:53 UTC (permalink / raw)
  To: Btrfs BTRFS

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!

[/dev/sdd].write_io_errs   0
[/dev/sdd].read_io_errs    0
[/dev/sdd].flush_io_errs   0
[/dev/sdd].corruption_errs 331
[/dev/sdd].generation_errs 0
[/dev/sde].write_io_errs   0
[/dev/sde].read_io_errs    0
[/dev/sde].flush_io_errs   0
[/dev/sde].corruption_errs 324
[/dev/sde].generation_errs 0
[/dev/sdi].write_io_errs   0
[/dev/sdi].read_io_errs    0
[/dev/sdi].flush_io_errs   0
[/dev/sdi].corruption_errs 381
[/dev/sdi].generation_errs 0
[/dev/sdk].write_io_errs   0
[/dev/sdk].read_io_errs    0
[/dev/sdk].flush_io_errs   0
[/dev/sdk].corruption_errs 492
[/dev/sdk].generation_errs 0
[/dev/sdl].write_io_errs   0
[/dev/sdl].read_io_errs    0
[/dev/sdl].flush_io_errs   0
[/dev/sdl].corruption_errs 449
[/dev/sdl].generation_errs 0
[/dev/sdj].write_io_errs   0
[/dev/sdj].read_io_errs    0
[/dev/sdj].flush_io_errs   0
[/dev/sdj].corruption_errs 391
[/dev/sdj].generation_errs 0
[/dev/sdg].write_io_errs   0
[/dev/sdg].read_io_errs    0
[/dev/sdg].flush_io_errs   0
[/dev/sdg].corruption_errs 485
[/dev/sdg].generation_errs 0
[/dev/sdh].write_io_errs   0
[/dev/sdh].read_io_errs    0
[/dev/sdh].flush_io_errs   0
[/dev/sdh].corruption_errs 444
[/dev/sdh].generation_errs 0
[/dev/sdb].write_io_errs   0
[/dev/sdb].read_io_errs    0
[/dev/sdb].flush_io_errs   0
[/dev/sdb].corruption_errs 398
[/dev/sdb].generation_errs 0
[/dev/sdc].write_io_errs   0
[/dev/sdc].read_io_errs    0
[/dev/sdc].flush_io_errs   0
[/dev/sdc].corruption_errs 400
[/dev/sdc].generation_errs 0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: corruption_errs
  2018-08-27 22:53 corruption_errs John Petrini
@ 2018-08-28 11:17 ` Austin S. Hemmelgarn
  0 siblings, 0 replies; 2+ messages in thread
From: Austin S. Hemmelgarn @ 2018-08-28 11:17 UTC (permalink / raw)
  To: John Petrini, Btrfs BTRFS

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-08-28 15:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-27 22:53 corruption_errs John Petrini
2018-08-28 11:17 ` corruption_errs Austin S. Hemmelgarn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).