linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Burkov <boris@bur.io>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com,
	fstests@vger.kernel.org, anand.jain@oracle.com
Subject: [PATCH] btrfs: fix rescan helper
Date: Fri, 29 Sep 2023 10:43:30 -0700	[thread overview]
Message-ID: <d51adc803f344fb0bb5e63243e94f94f287ac2c0.1696009118.git.boris@bur.io> (raw)
In-Reply-To: <ea2c732f-68be-74b1-f05e-218ebaa2b359@oracle.com>

rescan -w silently handles the case where a rescan is already running.
rescan -W works even in squota mode, so it is insufficient to implement
the requires. Therefore, preface the rescan -w with rescan -W, which
should reliably trigger a real rescan start.

This results in an extra log line reliably appearing in stdout, so also
redirect the output to $seqres.full.

btrfs/022 and btrfs/057 now pass with and without mkfs -O squota.

Signed-off-by: Boris Burkov <boris@bur.io>
---
 common/btrfs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/btrfs b/common/btrfs
index 34fa3a157..eff8e8386 100644
--- a/common/btrfs
+++ b/common/btrfs
@@ -724,7 +724,10 @@ _require_qgroup_rescan()
 	_scratch_mkfs >>$seqres.full 2>&1
 	_scratch_mount
 	_run_btrfs_util_prog quota enable $SCRATCH_MNT
-	$BTRFS_UTIL_PROG quota rescan -w $SCRATCH_MNT ||  _notrun "not able to run quota rescan"
+	# Wait for the first rescan.
+	$BTRFS_UTIL_PROG quota rescan -W $SCRATCH_MNT || _notrun "not able to wait on a quota rescan"
+	# Make sure we can start a rescan.
+	$BTRFS_UTIL_PROG quota rescan -w $SCRATCH_MNT >> $seqres.full || _notrun "not able to run quota rescan"
 	_scratch_unmount
 }
 
-- 
2.42.0


  parent reply	other threads:[~2023-09-29 17:42 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 23:16 [PATCH v4 0/6] btrfs: simple quotas fstests Boris Burkov
2023-09-28 23:16 ` [PATCH v4 1/6] common: refactor sysfs_attr functions Boris Burkov
2023-09-29  8:23   ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 2/6] btrfs: quota mode helpers Boris Burkov
2023-09-29  8:57   ` Anand Jain
2023-09-29  9:11     ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 3/6] btrfs/301: new test for simple quotas Boris Burkov
2023-09-28 23:16 ` [PATCH v4 4/6] btrfs: quota rescan helpers Boris Burkov
2023-09-29  9:14   ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 5/6] btrfs: use new rescan wrapper Boris Burkov
2023-09-29  9:28   ` Anand Jain
2023-09-28 23:16 ` [PATCH v4 6/6] btrfs: skip squota incompatible tests Boris Burkov
2023-09-29  9:37   ` Anand Jain
2023-09-29  9:42     ` Anand Jain
2023-09-29 16:57       ` Boris Burkov
2023-09-29 17:28       ` Boris Burkov
2023-09-29 17:43     ` Boris Burkov [this message]
2023-09-30  9:37       ` [PATCH] btrfs: fix rescan helper Anand Jain
2023-09-30  9:45 ` [PATCH v4 0/6] btrfs: simple quotas fstests Anand Jain
2023-10-05  8:08   ` 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=d51adc803f344fb0bb5e63243e94f94f287ac2c0.1696009118.git.boris@bur.io \
    --to=boris@bur.io \
    --cc=anand.jain@oracle.com \
    --cc=fstests@vger.kernel.org \
    --cc=kernel-team@fb.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).