From: Josef Bacik <josef@toxicpanda.com>
To: Qu Wenruo <wqu@suse.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] fstests: btrfs: make nospace_cache related test cases to work with latest v2 cache
Date: Fri, 5 Nov 2021 06:25:02 -0400 [thread overview]
Message-ID: <YYUGfguehWpzCE6d@localhost.localdomain> (raw)
In-Reply-To: <20211104005553.14485-1-wqu@suse.com>
On Thu, Nov 04, 2021 at 08:55:53AM +0800, Qu Wenruo wrote:
> In the coming btrfs-progs v5.15 release, mkfs.btrfs will change to use
> v2 cache by default.
>
> However nospace_cache mount option will not work with v2 cache, as it
> will make v2 cache out of sync with on-disk used space.
>
> So mounting a btrfs with v2 cache using "nospace_cache" will make btrfs
> to reject the mount.
>
> There are quite some test cases relying on nospace_cache to prevent v1
> cache to take up data space.
>
> For that case, we can append "clear_cache" mount option to it, so that
> btrfs knows we do not only want to prevent cache from being created, but
> also want to clear any existing v2 cache.
>
> By this, we can keep those existing tests to do the same behavior for
> both v1 and v2 cache.
>
> Signed-off-by: Qu Wenruo <wqu@suse.com>
This will re-generate the free space tree needlessly, and in fact won't be
allowed for extent-tree-v2, so we'll just have to mess with it again. Instead
add a helper to get the options if they're needed, something like
_btrfs_nocache_opt() {
$BTRFS_UTIL_PROG inspect-internal $SCRATCH_DEV | grep FREE_SPACE_TREE
if [ $? -eq 0 ]; then
return "-o nospace_cache"
fi
return ""
}
or something like that. Thanks,
Josef
next prev parent reply other threads:[~2021-11-05 10:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 0:55 [PATCH] fstests: btrfs: make nospace_cache related test cases to work with latest v2 cache Qu Wenruo
2021-11-04 11:09 ` Filipe Manana
2021-11-05 10:25 ` Josef Bacik [this message]
2021-11-05 10:34 ` 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=YYUGfguehWpzCE6d@localhost.localdomain \
--to=josef@toxicpanda.com \
--cc=fstests@vger.kernel.org \
--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