linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shilong Wang <wangshilong1991@gmail.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: Fwd: 2 errors when scrubbing - but I don't know what they mean
Date: Sun, 1 Dec 2013 09:16:28 +0800	[thread overview]
Message-ID: <CAP9B-Qkh0EVTGQPRHM2OX+tH74W-sYEoD52goS7Mae=3quMjmw@mail.gmail.com> (raw)
In-Reply-To: <CAP9B-Q=Y+uY2kErYb1ZKMsvFrbYidmGpPnUbHm8iApj7v6wK+w@mail.gmail.com>

cc: linux-btrfs

---------- Forwarded message ----------
From: Shilong Wang <wangshilong1991@gmail.com>
Date: 2013/12/1
Subject: Re: 2 errors when scrubbing - but I don't know what they mean
To: Sebastian Ochmann <ochmann@informatik.uni-bonn.de>


Hello Sebastian,

2013/11/30 Sebastian Ochmann <ochmann@informatik.uni-bonn.de>:
> Hello,
>
> thank you for your input. I didn't know that btrfs keeps the error counters
> over mounts/reboots, but that's nice.
>
> I'm still trying to figure out how such a generation error may occur in the
> first place. One thing I noticed looking at the btrfs code is that the
> generation error counter will only get incremented in the actual scrubbing
> code (either in "scrub_checksum_super" or in "scrub_handle_errored_block",
> both in scrub.c - please correct me if I'm wrong, I'm not a btrfs dev).

Right, Scrub will read superblock with bio rather than using pagecaches.
This mean we will reread superblock from disks, if a checksum mismatch happens,
This can be the following reasons:

1.some read errors happen while scrubing, while superblocks are actually good
2.during last transaction, when we are trying to write superblocks to
disk, some silent corruption
   happens.
3.some unexpected operation write data to superblocks directly, for
example..'dd if=/dev/zero'
of=/dev/ seek=65536   count=4k' something like this.

Actually, during boot time, superblock should be fine, because will do
checksum check
when trying to using superblock. if checksum mismatch, we will refuse
to mount, After mounting,
these superblocks should be cached in memory until you umouting filesystem.

So ideal thing is your disk is fine, and during next transaction,
superblocks will be rewritten.
and during next umounting, you can mounting filesystem successfully!

However, if you find such superblocks checksum mismatch very often
during scrub, it maybe
there are something wrong with disk!

> Also, the dmesg errors I saw were not there at boot time, but about 10
> minutes after boot which was about the time when I started the scrub so I'm
> pretty sure that it was the scrub that detected the errors.
>
> The question remains what can cause superblock/gen errors. Sure it could be
> "some" read error, but I'd really like to make sure that it's not a
> systematic error. I wasn't able to reproduce it yet though.

You can reproduce this by doing 'dd if=/dev/zero of=/dev/sd*
seek=65536 count=4k' before
btrfs scrubing.

Thanks,
Wang
>
> Best
> Sebastian
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-12-01  1:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 20:36 2 errors when scrubbing - but I don't know what they mean Sebastian Ochmann
2013-11-29  1:10 ` Duncan
2013-11-30 11:31   ` Sebastian Ochmann
     [not found]     ` <CAP9B-Q=Y+uY2kErYb1ZKMsvFrbYidmGpPnUbHm8iApj7v6wK+w@mail.gmail.com>
2013-12-01  1:16       ` Shilong Wang [this message]
2013-12-01 20:45       ` Sebastian Ochmann
2013-12-02  1:30         ` Wang Shilong
2013-12-02  1:53           ` Wang Shilong
2013-12-02  9:21         ` Wang Shilong
2013-11-29  5:51 ` Wang Shilong

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='CAP9B-Qkh0EVTGQPRHM2OX+tH74W-sYEoD52goS7Mae=3quMjmw@mail.gmail.com' \
    --to=wangshilong1991@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).