linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Kaiser <simon.kaiser@kit.edu>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>,
	Chris Murphy <lists@colorremedies.com>
Cc: Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: corrupt leaf; unaligned key offset for csum item
Date: Sun, 10 Jun 2018 15:38:49 +0200	[thread overview]
Message-ID: <87wov63gnq.fsf@int-nb-181.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <aa02c8c9-7ce7-eb8d-18e8-d810532083d8@gmx.com>

Qu Wenruo <quwenruo.btrfs@gmx.com> writes:

> On 2018年06月10日 11:53, Chris Murphy wrote:
>> On Sat, Jun 9, 2018 at 7:56 PM, Qu Wenruo <quwenruo.btrfs@gmx.com> wrote:
>>>
>>> Indeed, the corrupted bytenr is 0x4bc98004.
>>> Looks pretty like a bit flip in the 3rd lowest bit.
>>>
>>> It can be fixed by manually patching the corrupted leaf to get rid of
>>> the bitflip.
>>> I could provide a special branch of btrfs-progs to fix it easily.
>>>
>>> But before that, it's better to do a scrub to see if there is other
>>> similar problems, so I could fix them all.
>>>

Online scrub `btrfs scrub start -B -r /mnt/` (`mount -o ro,norecovery`)

ERROR: scrubbing /mnt/ failed for device id 1: ret=-1, errno=5 (Input/output error)
scrub canceled for 95b4974b-a798-44b3-99aa-a4eef990aeeb
        scrub started at Sun Jun 10 13:25:37 2018 and was aborted after 00:00:03
        total bytes scrubbed: 1.09GiB with 0 errors

Offline scrub `btrfs check --check-data-csum /dev/sda5`

Checking filesystem on /dev/sda5
UUID: 95b4974b-a798-44b3-99aa-a4eef990aeeb
checking extents
checking free space cache
checking fs roots
root 257 inode 7984709 errors 1000, some csum missing
root 257 inode 8016535 errors 800, odd csum item
root 407 inode 7984709 errors 1000, some csum missing
ERROR: errors found in fs roots
found 83859496960 bytes used, error(s) found
total csum bytes: 79588008
total tree bytes: 1907539968
total fs tree bytes: 1707540480
total extent tree bytes: 93782016
btree space waste bytes: 338263641
file data blocks allocated: 97127669760
 referenced 108545990656
btrfs check --check-data-csum /dev/sda5  10.70s user 1.51s system 82% cpu 14.736 total

>> 
>> Do you think Simon should try -o ro and -o ro,norecovery and see if he
>> can update backups the easy way first?

On copying from this drive, btrfs throws the error I posted initally on
lots of files, but the rest look ok.  I also dd'ed the partition on a
backup drive, so I should be good to go on.

>
> If the bit flip is the only problem, I could fix it manually and nothing
> is lost, the fs can be used as usual.
>
>> And then use the offline scrub
>> to check for additional problems?
>
> I mean online scrub.
>
> I didn't notice extra error, and I don't believe even for a faulty
> memory, bit flip is that easy to happen, so on-line scrub should do the
> work.
>

>> 
>> Simon, the offline scrub is done unmounted with 'btrfs check
>> --check-data-csum <dev>' and it is a read-only check.
>> 
>>

Thank you both for looking into this!

Yours,
Simon

  reply	other threads:[~2018-06-10 13:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-09 12:22 corrupt leaf; unaligned key offset for csum item Simon Kaiser
2018-06-09 22:53 ` Chris Murphy
2018-06-10  1:56 ` Qu Wenruo
2018-06-10  3:53   ` Chris Murphy
2018-06-10  5:12     ` Qu Wenruo
2018-06-10 13:38       ` Simon Kaiser [this message]
2018-06-10 21:30         ` Chris Murphy
2018-06-10 22:32           ` Simon Kaiser
2018-06-11  8:10   ` Qu Wenruo
2018-06-11 16:42     ` Simon Kaiser
2018-06-12  1:18       ` Qu Wenruo

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=87wov63gnq.fsf@int-nb-181.i-did-not-set--mail-host-address--so-tickle-me \
    --to=simon.kaiser@kit.edu \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=quwenruo.btrfs@gmx.com \
    /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).