All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Sidong Yang <realwakka@gmail.com>
Cc: linux-btrfs@vger.kernel.org, fstests@vger.kernel.org
Subject: Re: [PATCH] btrfs/298: add test for showing qgroups include staled sorted by path
Date: Mon, 9 Oct 2023 17:41:51 +0200	[thread overview]
Message-ID: <20231009154151.GS28758@twin.jikos.cz> (raw)
In-Reply-To: <20231009143123.9588-1-realwakka@gmail.com>

On Mon, Oct 09, 2023 at 02:31:23PM +0000, Sidong Yang wrote:
> Test for showing qgroups include a staled qgroup list sorted by path.
> It crashed without checking qgroup has empty path. It fixed by the
> following commit in btrfs-progs:
> 
> cd7f1e48 ("btrfs-progs: qgroup: check null in comparing paths")

This is a progs patch and I'd like to have the test case there, while it
does not hurt to have it in the fstests too but IMHO it's not very
useful there.

> Signed-off-by: Sidong Yang <realwakka@gmail.com>
> ---
>  tests/btrfs/298     | 34 ++++++++++++++++++++++++++++++++++
>  tests/btrfs/298.out |  2 ++
>  2 files changed, 36 insertions(+)
>  create mode 100755 tests/btrfs/298
>  create mode 100644 tests/btrfs/298.out
> 
> diff --git a/tests/btrfs/298 b/tests/btrfs/298
> new file mode 100755
> index 00000000..5457423d
> --- /dev/null
> +++ b/tests/btrfs/298
> @@ -0,0 +1,34 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2023 Sidong Yang.  All Rights Reserved.
> +#
> +# FS QA Test 298
> +#
> +# Test that showing qgourps list includes a staled qgroup without crash.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick qgroup
> +
> + . ./common/filter
> +
> +_supported_fs btrfs
> +_require_test
> +_require_scratch
> +
> +_scratch_mkfs > /dev/null 2>&1
> +_scratch_mount
> +
> +# Create stale qgroup with creating and deleting a subvolume.
> +$BTRFS_UTIL_PROG quota enable $SCRATCH_MNT >> $seqres.full
> +$BTRFS_UTIL_PROG subvolume create $SCRATCH_MNT/a >> $seqres.full
> +$BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/a >> $seqres.full
> +
> +# Show qgroups list with sorting path without crash.
> +$BTRFS_UTIL_PROG qgroup show --sort path $SCRATCH_MNT >> $seqres.full
> +
> +_scratch_unmount

I've created a test case for btrfs-progs with the same commands, only
using the other wrappers to run them.

  reply	other threads:[~2023-10-09 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-09 14:31 [PATCH] btrfs/298: add test for showing qgroups include staled sorted by path Sidong Yang
2023-10-09 15:41 ` David Sterba [this message]
2023-10-21 13:24 ` Zorro Lang

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=20231009154151.GS28758@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=fstests@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=realwakka@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.