linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: dsterba@suse.cz, Qu Wenruo <wqu@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 0/2] Fixup and optimization for write time tree checker
Date: Sat, 6 Apr 2019 08:22:07 +0800	[thread overview]
Message-ID: <d17bb3bb-456f-0940-d95e-9cedc2ce4406@gmx.com> (raw)
In-Reply-To: <20190405154945.GX29086@twin.jikos.cz>


[-- Attachment #1.1: Type: text/plain, Size: 2733 bytes --]



On 2019/4/5 下午11:49, David Sterba wrote:
> On Thu, Apr 04, 2019 at 11:47:06AM +0800, Qu Wenruo wrote:
>> This patchset can be fetched from github:
>> https://github.com/adam900710/linux/tree/tree_checker_testing
>>
>> Which is based on misc-next, with the following commit as HEAD:
>> commit 56d46f96de92ec69963acb7b1d9aed83d2a56a7b (david/misc-next-with-write-checks, david/misc-next)
>> Author: Nikolay Borisov <nborisov@suse.com>
>> Date:   Wed Mar 27 14:24:18 2019 +0200
>>
>>     btrfs: Switch btrfs_trim_free_extents to find_first_clear_extent_bit
>>
>> These two patches changes the behavior of write time tree-checker, where
>> the initial patches didn't check the content of the leaf, leaving memory
>> bit flipping possible to sneak in.
>>
>> This patchset also introduces a new optimization, where original empty
>> leaf owner check can be pretty expensive and cause false alerts for
>> write time tree checker.
>> With this new optimization, write time tree checker can reuse the
>> existing btrfs_check_leaf_full().
> 
> This on top of misc-next throws 6 'write time' errors:
> 
> btrfs/101               [14:00:24][ 3963.736352] run fstests btrfs/101 at 2019-04-05 14:00:24
> [ 3970.417649] BTRFS error (device vdc): block=2446344192 write time tree block corruption detected

In my case, these tests just pass, so I haven't checked the dmesg.

But indeed I can reproduce the same dmesg line.

Before removing the device, btrfs will use btrfs_shrink_device(new_size
= 0) to remove all data from that device.

And that will cause on-disk total_bytes to be 0, triggering the bug.

So indeed the behavior is different between read and write time.

I'll check how to do it correctly.

Thanks,
Qu

> 
> btrfs/151               [14:06:52][ 4351.133395] run fstests btrfs/151 at 2019-04-05 14:06:52
> [ 4351.659771] BTRFS error (device vdb): block=570572800 write time tree block corruption detected
> 
> btrfs/164               [14:07:19][ 4378.349990] run fstests btrfs/164 at 2019-04-05 14:07:19
> [ 4380.645918] BTRFS error (device vdb): block=2479882240 write time tree block corruption detected
> 
> btrfs/176               [14:07:39][ 4398.493736] run fstests btrfs/176 at 2019-04-05 14:07:39
> [ 4399.186203] BTRFS error (device vdb): block=22036480 write time tree block corruption detected
> [ 4399.302700] BTRFS error (device vdb): block=1372585984 write time tree block corruption detected
> 
> btrfs/184               [14:10:13][ 4552.496289] run fstests btrfs/184 at 2019-04-05 14:10:13
> [ 4553.292780] BTRFS error (device vdb): block=4602216448 write time tree block corruption detected
> 
> Have you seen the errors during your testing?
> 


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2019-04-06  0:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  3:47 [PATCH 0/2] Fixup and optimization for write time tree checker Qu Wenruo
2019-04-04  3:47 ` [PATCH 1/2] btrfs: tree-checker: Remove comprehensive root owner check Qu Wenruo
2019-04-04  6:23   ` Nikolay Borisov
2019-04-04  6:33     ` Qu Wenruo
2019-04-04 15:24     ` David Sterba
2019-04-04  3:47 ` [PATCH 2/2] btrfs: Do mandatory tree block check before submitting bio Qu Wenruo
2019-04-12 15:36   ` David Sterba
2019-04-05 15:49 ` [PATCH 0/2] Fixup and optimization for write time tree checker David Sterba
2019-04-06  0:22   ` Qu Wenruo [this message]
2019-04-06  1:57     ` Qu Wenruo
2019-04-08 22:18       ` David Sterba

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=d17bb3bb-456f-0940-d95e-9cedc2ce4406@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.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).