FSTests Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] btrfs: 210: Ignore output from "quota rescan" after "quota enable"
@ 2020-07-21 12:46 Marcos Paulo de Souza
  2020-07-22 11:48 ` Filipe Manana
  0 siblings, 1 reply; 2+ messages in thread
From: Marcos Paulo de Souza @ 2020-07-21 12:46 UTC (permalink / raw)
  To: dsterba, linux-btrfs, fstests; +Cc: Marcos Paulo de Souza

From: Marcos Paulo de Souza <mpdesouza@suse.com>

Command "quota enable" triggers a quota rescan, but it can finish quick
in some machines leading to the next command "quota rescan" to be able
to start scanning again, and then printing "quota rescan started" making
the test fail.

In some machines this don't happen because the first rescan initiated by
"quota enable" is still running when "quota rescan" is executed, returning
-EINPROGRESS from ioctl BTRFS_IOC_QUOTA_RESCAN_STATUS and not printing the
message.

Ignoring any output from "quota rescan" solves the issue in both cases, and
this is already being done by others tests as well.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
 Patch v1 can be found here:
 https://www.spinics.net/lists/linux-btrfs/msg103177.html

 tests/btrfs/210 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/btrfs/210 b/tests/btrfs/210
index daa76a87..13d1a87b 100755
--- a/tests/btrfs/210
+++ b/tests/btrfs/210
@@ -46,7 +46,7 @@ _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" > /dev/null
 # by qgroup
 sync
 $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT"
-$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT"
+$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
 $BTRFS_UTIL_PROG qgroup create 1/0 "$SCRATCH_MNT"
 
 # Create a snapshot with qgroup inherit
-- 
2.27.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] btrfs: 210: Ignore output from "quota rescan" after "quota enable"
  2020-07-21 12:46 [PATCH v2] btrfs: 210: Ignore output from "quota rescan" after "quota enable" Marcos Paulo de Souza
@ 2020-07-22 11:48 ` Filipe Manana
  0 siblings, 0 replies; 2+ messages in thread
From: Filipe Manana @ 2020-07-22 11:48 UTC (permalink / raw)
  To: Marcos Paulo de Souza
  Cc: David Sterba, linux-btrfs, fstests, Marcos Paulo de Souza

On Tue, Jul 21, 2020 at 2:09 PM Marcos Paulo de Souza
<marcos@mpdesouza.com> wrote:
>
> From: Marcos Paulo de Souza <mpdesouza@suse.com>
>
> Command "quota enable" triggers a quota rescan, but it can finish quick
> in some machines leading to the next command "quota rescan" to be able
> to start scanning again, and then printing "quota rescan started" making
> the test fail.
>
> In some machines this don't happen because the first rescan initiated by
> "quota enable" is still running when "quota rescan" is executed, returning
> -EINPROGRESS from ioctl BTRFS_IOC_QUOTA_RESCAN_STATUS and not printing the
> message.
>
> Ignoring any output from "quota rescan" solves the issue in both cases, and
> this is already being done by others tests as well.
>
> Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Looks good now, thanks.

> ---
>  Patch v1 can be found here:
>  https://www.spinics.net/lists/linux-btrfs/msg103177.html
>
>  tests/btrfs/210 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/btrfs/210 b/tests/btrfs/210
> index daa76a87..13d1a87b 100755
> --- a/tests/btrfs/210
> +++ b/tests/btrfs/210
> @@ -46,7 +46,7 @@ _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" > /dev/null
>  # by qgroup
>  sync
>  $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT"
> -$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT"
> +$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null
>  $BTRFS_UTIL_PROG qgroup create 1/0 "$SCRATCH_MNT"
>
>  # Create a snapshot with qgroup inherit
> --
> 2.27.0
>


-- 
Filipe David Manana,

“Whether you think you can, or you think you can't — you're right.”

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 12:46 [PATCH v2] btrfs: 210: Ignore output from "quota rescan" after "quota enable" Marcos Paulo de Souza
2020-07-22 11:48 ` Filipe Manana

FSTests Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/fstests/0 fstests/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 fstests fstests/ https://lore.kernel.org/fstests \
		fstests@vger.kernel.org
	public-inbox-index fstests

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.fstests


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git