Linux Btrfs filesystem development
 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] btrfs-progs: check/lowmem: Reset path in repair mode to avoid incorrect item from being passed to lowmem check.
Date: Thu, 6 Jun 2019 11:52:45 +0800	[thread overview]
Message-ID: <42661024-8c85-99ac-5763-e9655a4d8c0d@gmx.com> (raw)
In-Reply-To: <20190605160833.GC9896@twin.jikos.cz>


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



On 2019/6/6 上午12:08, David Sterba wrote:
> On Fri, May 17, 2019 at 10:00:03PM +0800, Qu Wenruo wrote:
>> In lowmem mode, we check fs roots and free space cache by iterating
>> each root item and inode item, using btrfs_next_item() and a path
>> pointing to the root tree.
>>
>> However in repair mode, check_fs_root() can modify the fs root, thus
>> CoWs the tree root, and the old path in check_fs
>>
>> It could lead to strange behavior, e.g. after repairing a fs tree, the
>> path can point to a fs tree.
>> Since no ROOT_ITEM exists in fs tree, all remaining trees are skipped in
>> repair mode.
>>
>> This bug exists from the early time of lowmem mode repair, and is only
>> exposed by recent free space inode check code. (Fs tree inodes are
>> passed to free space inode check, causing false alerts and repair
>> failure).
>>
>> Signed-off-by: Qu Wenruo <wqu@suse.com>
> 
> I'll add it to devel, however the lowmem mode of test-check does not
> work now, so can't really test it.
> 
With this patch applies, test-fsck runs well for lowmem mode, and that's
what this patch should do.

I just tried devel branch it works as expected.

Or did you hit some new bug?

Thanks,
Qu


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

      reply	other threads:[~2019-06-06  3:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-17 14:00 [PATCH] btrfs-progs: check/lowmem: Reset path in repair mode to avoid incorrect item from being passed to lowmem check Qu Wenruo
2019-06-05 16:08 ` David Sterba
2019-06-06  3:52   ` Qu Wenruo [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=42661024-8c85-99ac-5763-e9655a4d8c0d@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