public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Disseldorp <ddiss@suse.de>
To: fdmanana@kernel.org
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org,
	Filipe Manana <fdmanana@suse.com>
Subject: Re: [PATCH] btrfs: test send optimal cloning behaviour
Date: Wed, 25 Jan 2023 13:21:21 +0100	[thread overview]
Message-ID: <20230125132121.7c7be706@echidna.fritz.box> (raw)
In-Reply-To: <49e01810eff8d5ddd7d3c99796a66b997faaaf84.1674644814.git.fdmanana@suse.com>

On Wed, 25 Jan 2023 11:07:54 +0000, fdmanana@kernel.org wrote:

> From: Filipe Manana <fdmanana@suse.com>
> 
> Test that send operations do the best cloning decisions when we have
> extents that are shared but some files refer to the full extent while
> others refer to only a section of the extent.
> 
> This exercises an optimization that was added to kernel 6.2, by the
> following commit:
> 
>   c7499a64dcf6 ("btrfs: send: optimize clone detection to increase extent sharing")
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>
> ---
>  tests/btrfs/283     | 88 +++++++++++++++++++++++++++++++++++++++++++++
>  tests/btrfs/283.out | 26 ++++++++++++++
>  2 files changed, 114 insertions(+)
>  create mode 100755 tests/btrfs/283
>  create mode 100644 tests/btrfs/283.out
> 
> diff --git a/tests/btrfs/283 b/tests/btrfs/283
> new file mode 100755
> index 00000000..c1f6007d
> --- /dev/null
> +++ b/tests/btrfs/283
> @@ -0,0 +1,88 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (C) 2023 SUSE Linux Products GmbH. All Rights Reserved.
> +#
> +# FS QA Test 283
> +#
> +# Test that send operations do the best cloning decisions when we have extents
> +# that are shared but some files refer to the full extent while others refer to
> +# only a section of the extent.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick send clone fiemap
> +
> +. ./common/filter
> +. ./common/reflink
> +. ./common/punch # for _filter_fiemap_flags
> +
> +_supported_fs btrfs
> +_require_test
> +_require_scratch_reflink
> +_require_cp_reflink
> +_require_xfs_io_command "fiemap"
> +_require_fssum
> +
> +_wants_kernel_commit c7499a64dcf6 \
> +	     "btrfs: send: optimize clone detection to increase extent sharing"
> +
> +send_files_dir=$TEST_DIR/btrfs-test-$seq
> +send_stream=$send_files_dir/snap.stream
> +snap_fssum=$send_files_dir/snap.fssum
> +
> +rm -fr $send_files_dir
> +mkdir $send_files_dir

I'm not sure what the rules are regarding TEST_DIR residuals, but it
might be worth adding a custom _cleanup() for $send_files_dir .
Anyhow, looks good as-is.
Reviewed-by: David Disseldorp <ddiss@suse.de>

  reply	other threads:[~2023-01-25 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 11:07 [PATCH] btrfs: test send optimal cloning behaviour fdmanana
2023-01-25 12:21 ` David Disseldorp [this message]
2023-01-30  4:27   ` Zorro Lang
2023-01-26  6:58 ` Anand Jain

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=20230125132121.7c7be706@echidna.fritz.box \
    --to=ddiss@suse.de \
    --cc=fdmanana@kernel.org \
    --cc=fdmanana@suse.com \
    --cc=fstests@vger.kernel.org \
    --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