linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Lukas Pirl <btrfs@lukas-pirl.de>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs scrub crashes OS
Date: Tue, 26 Sep 2017 17:36:09 +0800	[thread overview]
Message-ID: <2c7db235-827c-1f17-484b-2a7f8da4810c@gmx.com> (raw)
In-Reply-To: <e9cfdde0-f07d-c73b-23f0-49ef55709240@lukas-pirl.de>



On 2017年09月26日 17:26, Lukas Pirl wrote:
> Hi Qu,
> 
> On 09/26/2017 10:51 AM, Qu Wenruo wrote as excerpted:
>> This make things more weird.
>> Just in case, are you executing offline scrub by "btrfs scrub start
>> --offline <device>"
> 
> Yes. I even got some output (pretty sure the last lines are missing due
> to the crash):
> 
> WARNING: Offline scrub doesn't support extra options other than -r
> [I gave -d as well]
> Invalid mapping for 644337258496-644337332224, got
> 645348196352-646421938176
> Couldn't map the block 644337258496

This is strange, this means that we can't find a chunk map for a 72K 
length data extent.

Either the new mapper code has some bug, or it's a big problem.
But I think it's more possible for former case.

Would you please try to dump the chunk tree (which should be quite 
small) using the following command?

$ btrfs inspect-internal dump-tree -t chunk <device>

> ERROR: failed to read out data at bytenr 644337258496 mirror 1
> Invalid mapping for 653402148864-653402152960, got
> 653938130944-655011872768
> Couldn't map the block 653402148864
> ERROR: failed to read out data at bytenr 653402148864 mirror 1
> Invalid mapping for 717315420160-717315526656, got
> 718362640384-719436382208
> Couldn't map the block 717315420160
> ERROR: failed to read out data at bytenr 717315420160 mirror 1
> Invalid mapping for 875072008192-875072040960, got
> 875128946688-876202688512
> Couldn't map the block 875072008192
> ERROR: failed to read tree block 875072008192 mirror 1
> ERROR: extent 875072008192 len 32768 CORRUPTED: all mirror(s)
> corrupted, can't be recovered
> 
> Can I find out on which disk a mirror of a block is?

btrfs-map-logical can help you.
But I doubt if the offline scrub code, especially the new 
btrfs_map_block_v2() has hidden bug which caused the problem.

Withouth chunk tree dump, I am not which if it's a real bug or missing 
device.

Thanks,
Qu
> 
>> If so, I think there may be some problem outside the btrfs territory.
> 
> Of course, that is a possibility…
> 
>> Offline scrub has nothing to do with btrfs kernel module, it just reads
>> out on-disk data and verify checksum in *user* space.
>>
>> So if offline scrub can also screw up the system, it means there is
>> something wrong in the disk IO routine, not btrfs.
>>
>> And scrub can trigger it because normal btrfs IO won't try to read that
>> part/mirror.
> 
> …especially when considering this.
> 
>> What about trying to read all data out of your raw disk?
>> If offline crashes the system, reading the disk may crash it also.
>> Using dd to read each of your disk (with btrfs unmounted) may expose
>> which disk caused the problem.
> 
> That it is good idea! Will go ahead.
> 
> Thanks for your help so far.
> --
> 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
> 

  reply	other threads:[~2017-09-26  9:36 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25  9:50 btrfs scrub crashes OS Lukas Pirl
2017-09-25 10:19 ` Qu Wenruo
2017-09-26  8:34   ` Lukas Pirl
2017-09-26  8:51     ` Qu Wenruo
2017-09-26  9:26       ` Lukas Pirl
2017-09-26  9:36         ` Qu Wenruo [this message]
2017-09-26 11:50           ` Lukas Pirl
2017-09-26 12:16             ` 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=2c7db235-827c-1f17-484b-2a7f8da4810c@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=btrfs@lukas-pirl.de \
    --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).