From: David Sterba <dsterba@suse.cz>
To: Su Yue <l@damenly.su>
Cc: linux-btrfs@vger.kernel.org, Boris Burkov <boris@bur.io>
Subject: Re: [PATCH v2] btrfs-progs: check: continue to check space cache if sb cache_generation is 0
Date: Wed, 12 May 2021 20:44:25 +0200 [thread overview]
Message-ID: <20210512184425.GX7604@twin.jikos.cz> (raw)
In-Reply-To: <20210330022830.491831-1-l@damenly.su>
On Tue, Mar 30, 2021 at 10:28:30AM +0800, Su Yue wrote:
> User reported that test fsck-tests/037-freespacetree-repair fails:
> # TEST=037\* ./fsck-tests.sh
> [TEST/fsck] 037-freespacetree-repair
> btrfs check should have detected corruption
> test failed for case 037-freespacetree-repair
>
> The test tries to corrupt FST, call btrfs check readonly then repair FST
> using btrfs check. Above case failed at the second readonly check step.
> Test log said "cache and super generation don't match, space cache will
> be invalidated" which is printed by validate_free_space_cache().
> If cache_generation of the superblock is not -1ULL,
> validate_free_space_cache() requires that cache_generation must equal
> to the superblock's generation. Otherwise, it skips the check of space
> cache(v1, v2) like the above case where the sb cache_generation is 0.
>
> Since kernel commit 948462294577 ("btrfs: keep sb cache_generation
> consistent with space_cache"), sb cache_generation will be set to be 0
> once space cache v1 is disabled(nospace_cache/space_cache=v2). But
> progs check was forgotten to be added the 0 case support.
>
> Fix it by adding the condition if sb cache_generation is 0 in
> validate_free_space_cache() as the 0 case is valid now since the
> kernel commit mentioned above.
>
> Link: https://github.com/kdave/btrfs-progs/issues/338
> Signed-off-by: Su Yue <l@damenly.su>
> Reviewed-by: Boris Burkov <boris@bur.io>
Added to devel, thanks.
prev parent reply other threads:[~2021-05-12 21:08 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 2:28 [PATCH v2] btrfs-progs: check: continue to check space cache if sb cache_generation is 0 Su Yue
2021-05-12 18:44 ` David Sterba [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=20210512184425.GX7604@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=boris@bur.io \
--cc=l@damenly.su \
--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).