public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo.btrfs@gmx.com>
To: Josef Bacik <josef@toxicpanda.com>, 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 18:34:39 +0800	[thread overview]
Message-ID: <0c3ce396-e1b8-d650-223a-e152bca25204@gmx.com> (raw)
In-Reply-To: <YYUGfguehWpzCE6d@localhost.localdomain>



On 2021/11/5 18:25, Josef Bacik wrote:
> 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 ""
> }

OK, this indeed sounds better.

Thanks,
Qu
>
> or something like that.  Thanks,
>
> Josef
>

      reply	other threads:[~2021-11-05 10:34 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
2021-11-05 10:34   ` 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=0c3ce396-e1b8-d650-223a-e152bca25204@gmx.com \
    --to=quwenruo.btrfs@gmx.com \
    --cc=fstests@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --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