From: Boris Burkov <boris@bur.io>
To: An Long <lan@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: tests: add misc test for enqueue parameter
Date: Fri, 16 Apr 2021 10:38:23 -0700 [thread overview]
Message-ID: <YHnLj7vHuXSH9Pt+@zen> (raw)
In-Reply-To: <20210414074906.17715-1-lan@suse.com>
On Wed, Apr 14, 2021 at 03:49:06PM +0800, An Long wrote:
> The exclusive ops will not start if there's one already running. The
> enqueue parameter allows operations to be queued.
>
> Signed-off-by: An Long <lan@suse.com>
> ---
> .../misc-tests/048-enqueue-parameter/test.sh | 52 +++++++++++++++++++
> 1 file changed, 52 insertions(+)
> create mode 100755 tests/misc-tests/048-enqueue-parameter/test.sh
>
> diff --git a/tests/misc-tests/048-enqueue-parameter/test.sh b/tests/misc-tests/048-enqueue-parameter/test.sh
> new file mode 100755
> index 00000000..4be7d466
> --- /dev/null
> +++ b/tests/misc-tests/048-enqueue-parameter/test.sh
> @@ -0,0 +1,52 @@
> +#!/bin/bash
> +# Check if --enqueue can enqueueing of the operations correctly
> +
> +source "$TEST_TOP/common"
> +
> +check_prereq mkfs.btrfs
> +check_prereq btrfs
> +check_global_prereq fallocate
> +
> +setup_loopdevs 3
> +prepare_loopdevs
> +dev1=${loopdevs[1]}
> +dev2=${loopdevs[2]}
> +dev3=${loopdevs[3]}
> +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$dev1"
> +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$dev2"
> +run_check $SUDO_HELPER "$TOP/mkfs.btrfs" -f "$dev3"
> +run_check $SUDO_HELPER mount "$dev1" "$TEST_MNT"
> +run_check $SUDO_HELPER "$TOP/btrfs" device add -f "$dev2" "$TEST_MNT"
> +
> +test_run_commands() {
> + run_check $SUDO_HELPER "$TOP/btrfs" balance start --enqueue --full-balance "$TEST_MNT" &
> + run_check $SUDO_HELPER "$TOP/btrfs" filesystem resize --enqueue -100M "$TEST_MNT" &
> + run_check $SUDO_HELPER "$TOP/btrfs" device add --enqueue -f "$dev3" "$TEST_MNT" &
> + run_check $SUDO_HELPER "$TOP/btrfs" device delete --enqueue "$dev2" "$TEST_MNT" &
> +}
> +
> +get_fs_uuid() {
> + run_check_stdout "$TOP/btrfs" inspect-internal dump-super "$1" | \
> + grep '^fsid' | awk '{print $2}'
> +}
> +
> +fsid=$(get_fs_uuid "$dev1")
> +if ! [ -f "/sys/fs/btrfs/$fsid/exclusive_operation" ]; then
> + run_check_umount_test_dev "$TEST_MNT"
> + cleanup_loopdevs
> + _not_run "kernel does not support exclusive_operation"
> + exit
> +fi
> +
> +# Generate 1G data, for enough balance time for exclusive_operation
> +for i in $(seq 1 5); do
> + run_check $SUDO_HELPER fallocate -l 200M "$TEST_MNT/file$i"
> +done
> +
> +# Do btrfs balance in background, then try commands with enqueue parameter
> +run_check $SUDO_HELPER "$TOP/btrfs" balance start --full-balance "$TEST_MNT" &
> +test_run_commands
> +wait
> +
> +run_check_umount_test_dev "$TEST_MNT"
> +cleanup_loopdevs
> --
> 2.26.2
>
I applied this patch to progs v5.11.1 and ran it on a vm running a
kernel built from e5ff2239e143 (kdave/misc-next rebased today) and each
of the enqueued commands fails without any useful diagnostic
information, nor anything interesting in dmesg as far as I can tell.
e.g.:
"failed: /home/vmuser/btrfs-progs/btrfs filesystem resize --enqueue
-100M /home/vmuser/btrfs-progs/tests/mnt"
I am able to pass other misc tests on this setup.
Is there anything else I need to do to be able to run this test?
Thanks,
Boris
next prev parent reply other threads:[~2021-04-16 17:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-14 7:49 [PATCH] btrfs-progs: tests: add misc test for enqueue parameter An Long
2021-04-16 17:38 ` Boris Burkov [this message]
2021-04-18 14:34 ` Long An
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=YHnLj7vHuXSH9Pt+@zen \
--to=boris@bur.io \
--cc=lan@suse.com \
--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).