[PATCH] btrfs: fix rescan helper

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



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@xxxxxx>
---
 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




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux