From: Boris Burkov <boris@bur.io>
To: Anand Jain <anand.jain@oracle.com>
Cc: fstests@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 1/4] common/btrfs: introduce _require_btrfs_send_version
Date: Thu, 14 Mar 2024 09:40:41 -0700 [thread overview]
Message-ID: <20240314164041.GA3483638@zen.localdomain> (raw)
In-Reply-To: <b9f5d4d4ebe898034c36b3b7094b758c2df73e1b.1710411934.git.anand.jain@oracle.com>
On Thu, Mar 14, 2024 at 04:07:37PM +0530, Anand Jain wrote:
> Rename _require_btrfs_send_v2() to _require_btrfs_send_version() and
> check if the Btrfs kernel supports the v3 stream.
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Boris Burkov <boris@bur.io>
> ---
> common/btrfs | 10 ++++++----
> tests/btrfs/281 | 2 +-
> tests/btrfs/284 | 2 +-
> 3 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/common/btrfs b/common/btrfs
> index aa344706cd5f..ae13fb55cbc6 100644
> --- a/common/btrfs
> +++ b/common/btrfs
> @@ -662,18 +662,20 @@ _require_btrfs_corrupt_block()
> _require_command "$BTRFS_CORRUPT_BLOCK_PROG" btrfs-corrupt-block
> }
>
> -_require_btrfs_send_v2()
> +_require_btrfs_send_version()
> {
> + local version=$1
> +
> # Check first if btrfs-progs supports the v2 stream.
> _require_btrfs_command send --compressed-data
>
> # Now check the kernel support. If send_stream_version does not exists,
> # then it's a kernel that only supports v1.
> [ -f /sys/fs/btrfs/features/send_stream_version ] || \
> - _notrun "kernel does not support send stream v2"
> + _notrun "kernel does not support send stream $version"
>
> - [ $(cat /sys/fs/btrfs/features/send_stream_version) -gt 1 ] || \
> - _notrun "kernel does not support send stream v2"
> + [ $(cat /sys/fs/btrfs/features/send_stream_version) -ge $version ] || \
> + _notrun "kernel does not support send stream $version"
> }
>
> # Get the bytenr associated to a file extent item at a given file offset.
> diff --git a/tests/btrfs/281 b/tests/btrfs/281
> index 6407522567b8..ddc7d9e8b06d 100755
> --- a/tests/btrfs/281
> +++ b/tests/btrfs/281
> @@ -22,7 +22,7 @@ _begin_fstest auto quick send compress clone fiemap
> _supported_fs btrfs
> _require_test
> _require_scratch_reflink
> -_require_btrfs_send_v2
> +_require_btrfs_send_version 2
> _require_xfs_io_command "fiemap"
> _require_fssum
> _require_btrfs_no_nodatacow
> diff --git a/tests/btrfs/284 b/tests/btrfs/284
> index c6692668f7fc..0df494bc8ab4 100755
> --- a/tests/btrfs/284
> +++ b/tests/btrfs/284
> @@ -12,7 +12,7 @@ _begin_fstest auto quick send compress snapshot
>
> # Modify as appropriate.
> _supported_fs btrfs
> -_require_btrfs_send_v2
> +_require_btrfs_send_version 2
> _require_test
> # The size needed is variable as it depends on the specific randomized
> # operations from fsstress and on the value of $LOAD_FACTOR. But require at
> --
> 2.39.3
>
next prev parent reply other threads:[~2024-03-14 16:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-14 10:37 [PATCH v2 0/4] fstests: btrfs pending misc fixes Anand Jain
2024-03-14 10:37 ` [PATCH v2 1/4] common/btrfs: introduce _require_btrfs_send_version Anand Jain
2024-03-14 16:40 ` Boris Burkov [this message]
2024-03-14 10:37 ` [PATCH v2 2/4] btrfs/320: skip -O squota runs Anand Jain
2024-03-14 10:37 ` [PATCH v2 3/4] btrfs/277: specify protocol version 3 for verity send Anand Jain
2024-03-14 10:37 ` [PATCH v2 4/4] btrfs/316: use rescan wrapper 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=20240314164041.GA3483638@zen.localdomain \
--to=boris@bur.io \
--cc=anand.jain@oracle.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).