linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans van Kranenburg <hans.van.kranenburg@mendix.com>
To: Robert Krig <robert.krig@render-wahnsinn.de>,
	linux-btrfs@vger.kernel.org
Subject: Re: Need some help: "BTRFS critical (device sda): corrupt leaf, slot offset bad: block"
Date: Mon, 3 Apr 2017 16:44:30 +0200	[thread overview]
Message-ID: <b863d020-8d6c-f0af-5c62-b84bb752bd59@mendix.com> (raw)
In-Reply-To: <98a478cf-20f9-981f-6da5-4186a10be303@render-wahnsinn.de>

On 04/03/2017 04:20 PM, Robert Krig wrote:
> 
> 
> On 03.04.2017 16:08, Hans van Kranenburg wrote:
>> On 04/03/2017 12:11 PM, Robert Krig wrote:
>> The corruption is at item 157. Can you attach all of the output, or
>> pastebin it?
>>
> 
> I've attached the entire log of btrfs-debug-tree. This was generated
> with btrfs-progs 4.7.3

Meuh,

item 156 key (23416298414080 EXTENT_ITEM 4096) itemoff 8643 itemsize 53
item 157 key (23416298418176 EXTENT_ITEM 4096) itemoff 8590 itemsize 53

8590 + 53 = 8643.

I don't get what's invalid about that.

"incorrect offsets 8590 1258314415"

if (btrfs_item_offset_nr(buf, i) !=
    btrfs_item_end_nr(buf, i + 1)) {
    ret = BTRFS_TREE_BLOCK_INVALID_OFFSETS;
    fprintf(stderr, "incorrect offsets %u %u\n",
        btrfs_item_offset_nr(buf, i),
        btrfs_item_end_nr(buf, i + 1));
    goto fail;
}

Ah, ok, so the corruption is in item 158, but it's reported as
corruption in item 157.

There's no really simple tool right now to fix this manually. We can
also try to dd 16kiB of metadata from disk, fix it, and write it back.
We've been doing that before, it's a bit of work, but it can succeed.
Here's more instructions:

https://www.spinics.net/lists/linux-btrfs/msg62459.html

So, if you're the adventurous type...

But then again, if this is really memory failure, there might be other
errors all around the fs, which you didn't hit while reading back the
data yet.

Also note that btrfs does not protect you against this, also not for
data in files that gets corrupted in memory before it's written out
(which contains the checksum step).

> If it makes a difference, I can try it again with the newest version of
> btrfs-progs?

No, that code hasn't been touched in over 5 years.

-- 
Hans van Kranenburg

      parent reply	other threads:[~2017-04-03 14:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-03 10:11 Need some help: "BTRFS critical (device sda): corrupt leaf, slot offset bad: block" Robert Krig
2017-04-03 13:50 ` Robert Krig
2017-04-03 14:09   ` Hans van Kranenburg
2017-04-03 14:08 ` Hans van Kranenburg
2017-04-03 14:20   ` Robert Krig
2017-04-03 14:25     ` Robert Krig
2017-04-04  4:02       ` Robert Krig
2017-04-04 13:29         ` Brian B
2017-04-04 13:48           ` Hugo Mills
2017-04-04 13:52           ` Austin S. Hemmelgarn
2017-04-04 16:52         ` Chris Murphy
2017-04-04 16:55           ` Chris Murphy
2017-04-05  6:07             ` Robert Krig
2017-04-03 14:44     ` Hans van Kranenburg [this message]

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=b863d020-8d6c-f0af-5c62-b84bb752bd59@mendix.com \
    --to=hans.van.kranenburg@mendix.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=robert.krig@render-wahnsinn.de \
    /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).