btrfs: Ignore output of "btrfs quota rescan"
PATCH 1/1 btrfs: Ignore output of "btrfs quota rescan"
From: Marcos Paulo de Souza <[email protected]>
Some recent test already ignore this output, while older ones do not. It can sometimes make tests fail because "quota rescan" can show the message "quota rescan started". Ignoring the output of the command solves this problem.
--- tests/btrfs/017 | 2 +- tests/btrfs/022 | 4 ++-- tests/btrfs/028 | 2 +- tests/btrfs/057 | 2 +- tests/btrfs/091 | 2 +- tests/btrfs/104 | 2 +- tests/btrfs/123 | 2 +- tests/btrfs/126 | 2 +- tests/btrfs/139 | 2 +- tests/btrfs/153 | 2 +- tests/btrfs/193 | 2 +- tests/btrfs/210 | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-)
tests/btrfs/017 +1 -1
@@ -64,7 +64,7 @@ $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE $SCRATCH_MNT/foo \ $SCRATCH_MNT/snap/foo-reflink2 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null rm -fr $SCRATCH_MNT/foo* rm -fr $SCRATCH_MNT/snap/foo*
tests/btrfs/022 +2 -2
@@ -38,7 +38,7 @@ _basic_test() echo "=== basic test ===" >> $seqres.full _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a _run_btrfs_util_prog quota enable $SCRATCH_MNT/a - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \ $seqres.full 2>&1
@@ -77,7 +77,7 @@ _rescan_test() echo "qgroup values before rescan: $output" >> $seqres.full refer=$(echo $output | awk '{ print $2 }') excl=$(echo $output | awk '{ print $3 }') - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") echo "qgroup values after rescan: $output" >> $seqres.full [ $refer -eq $(echo $output | awk '{ print $2 }') ] || \
tests/btrfs/028 +1 -1
@@ -42,7 +42,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Increase the probability of generating de-refer extent, and decrease # other.
tests/btrfs/057 +1 -1
@@ -47,7 +47,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \ $FSSTRESS_AVOID >&/dev/null _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null echo "Silence is golden" # btrfs check will detect any qgroup number mismatch.
tests/btrfs/091 +1 -1
@@ -59,7 +59,7 @@ _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv2 _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv3 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # if we don't support noinode_cache mount option, then we should double check # whether inode cache is enabled before executing the real test payload.
tests/btrfs/104 +1 -1
@@ -113,7 +113,7 @@ _explode_fs_tree 1 $SCRATCH_MNT/snap2/files-snap2 # Enable qgroups now that we have our filesystem prepared. This # will kick off a scan which we will have to wait for. _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Remount to clear cache, force everything to disk _scratch_cycle_mount
tests/btrfs/123 +1 -1
@@ -56,7 +56,7 @@ sync # enable quota and rescan to get correct number _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # now balance data block groups to corrupt qgroup _run_btrfs_balance_start -d $SCRATCH_MNT >> $seqres.full
tests/btrfs/126 +1 -1
@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount "-o enospc_debug" _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 512K 0/5 $SCRATCH_MNT # The amount of written data may change due to different nodesize at mkfs time,
tests/btrfs/139 +1 -1
@@ -43,7 +43,7 @@ SUBVOL=$SCRATCH_MNT/subvol _run_btrfs_util_prog subvolume create $SUBVOL _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit -e 1G $SUBVOL
tests/btrfs/153 +1 -1
@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 100M 0/5 $SCRATCH_MNT testfile1=$SCRATCH_MNT/testfile1
tests/btrfs/193 +1 -1
@@ -43,7 +43,7 @@ _scratch_mkfs > /dev/null _scratch_mount $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null -$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null +$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" >/dev/null $BTRFS_UTIL_PROG qgroup limit -e 256M "$SCRATCH_MNT" # Create a file with the following layout:
tests/btrfs/210 +1 -1
@@ -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
Signature · 1 line
2.26.2
Quoted 9 lines · Marcos Paulo de Souza
From: Marcos Paulo de Souza <[email protected]>
Some recent test already ignore this output, while older ones do not. It can sometimes make tests fail because "quota rescan" can show the message "quota rescan started". Ignoring the output of the command solves this problem.
Signed-off-by Marcos Paulo de Souza <[email protected]>---
[...]
Review
Quoted 2 lines
(quoted diff) +1
-1-_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null
I think it's better to filter the "quota rescan started" output instead of redirecting all output to /dev/null. This way you'll get the real errors from 'btrfs quota rescan'.
Quoted 7 lines · Marcos Paulo de Souza
From: Marcos Paulo de Souza <[email protected]>
Some recent test already ignore this output, while older ones do not. It can sometimes make tests fail because "quota rescan" can show the message "quota rescan started". Ignoring the output of the command solves this problem.
Hi Marcos,
Can you elaborate exactly how it fails?
I've never seen those tests fail due to an unexpected "quota rescan started" message.
I also don't see how this change fixes anything, because:
1) The quota rescans are always executed - so we should always see such failure;
2) More importantly _run_btrfs_util_prog is:
_run_btrfs_util_prog()
{
run_check $BTRFS_UTIL_PROG $*
}
and run_check:
run_check()
{
echo "# $@" >> $seqres.full 2>&1
"$@" >> $seqres.full 2>&1 || _fail "failed: '$@'"
}
So any output from _run_btrfs_util_prog is redirected to the test's .full file. It will not cause a mismatch with the golden output.
Quoted 22 lines
Signed-off-by Marcos Paulo de Souza <[email protected]>--- tests/btrfs/017 | 2 +- tests/btrfs/022 | 4 ++-- tests/btrfs/028 | 2 +- tests/btrfs/057 | 2 +- tests/btrfs/091 | 2 +- tests/btrfs/104 | 2 +- tests/btrfs/123 | 2 +- tests/btrfs/126 | 2 +- tests/btrfs/139 | 2 +- tests/btrfs/153 | 2 +- tests/btrfs/193 | 2 +- tests/btrfs/210 | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-)tests/btrfs/017 +0
-0
tests/btrfs/017 $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE $SCRATCH_MNT/foo \ · line 67
Quoted 5 lines
tests/btrfs/017 +1
-1@@ -64,7 +64,7 @@ $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE $SCRATCH_MNT/foo \ $SCRATCH_MNT/snap/foo-reflink2 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null
So this is pointless, as mentioned before, any output is already redirected to the test's .full file.
The same applies to all changes below.
So I fail to see what problem you are trying to solve.
Thanks.
Quoted 158 lines
tests/btrfs/017 +0
-0rm -fr $SCRATCH_MNT/foo* rm -fr $SCRATCH_MNT/snap/foo*tests/btrfs/022 +2
-2@@ -38,7 +38,7 @@ _basic_test() echo "=== basic test ===" >> $seqres.full _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a _run_btrfs_util_prog quota enable $SCRATCH_MNT/a - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep $subvolid >> \ $seqres.full 2>&1@@ -77,7 +77,7 @@ _rescan_test() echo "qgroup values before rescan: $output" >> $seqres.full refer=$(echo $output | awk '{ print $2 }') excl=$(echo $output | awk '{ print $3 }') - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null output=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep "0/$subvolid") echo "qgroup values after rescan: $output" >> $seqres.full [ $refer -eq $(echo $output | awk '{ print $2 }') ] || \tests/btrfs/028 +1
-1@@ -42,7 +42,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Increase the probability of generating de-refer extent, and decrease # other.tests/btrfs/057 +1
-1@@ -47,7 +47,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w -p 5 -n 1000 \ $FSSTRESS_AVOID >&/dev/null _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null echo "Silence is golden" # btrfs check will detect any qgroup number mismatch.tests/btrfs/091 +1
-1@@ -59,7 +59,7 @@ _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv2 _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv3 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # if we don't support noinode_cache mount option, then we should double check # whether inode cache is enabled before executing the real test payload.tests/btrfs/104 +1
-1@@ -113,7 +113,7 @@ _explode_fs_tree 1 $SCRATCH_MNT/snap2/files-snap2 # Enable qgroups now that we have our filesystem prepared. This # will kick off a scan which we will have to wait for. _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Remount to clear cache, force everything to disk _scratch_cycle_mounttests/btrfs/123 +1
-1@@ -56,7 +56,7 @@ sync # enable quota and rescan to get correct number _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # now balance data block groups to corrupt qgroup _run_btrfs_balance_start -d $SCRATCH_MNT >> $seqres.fulltests/btrfs/126 +1
-1@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount "-o enospc_debug" _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 512K 0/5 $SCRATCH_MNT # The amount of written data may change due to different nodesize at mkfs time,tests/btrfs/139 +1
-1@@ -43,7 +43,7 @@ SUBVOL=$SCRATCH_MNT/subvol _run_btrfs_util_prog subvolume create $SUBVOL _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit -e 1G $SUBVOLtests/btrfs/153 +1
-1@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 100M 0/5 $SCRATCH_MNT testfile1=$SCRATCH_MNT/testfile1tests/btrfs/193 +1
-1@@ -43,7 +43,7 @@ _scratch_mkfs > /dev/null _scratch_mount $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null -$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null +$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" >/dev/null $BTRFS_UTIL_PROG qgroup limit -e 256M "$SCRATCH_MNT" # Create a file with the following layout:tests/btrfs/210 +1
-2@@ -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.26.2
Signature · 3 lines
Filipe David Manana, “Whether you think you can, or you think you can't — you're right.”
Quoted 8 lines · Filipe Manana
Quoted 4 lines · Marcos Paulo de Souza
From: Marcos Paulo de Souza <[email protected]>
Some recent test already ignore this output, while older ones do
not.
Quoted 1 line
It can sometimes make tests fail because "quota rescan" can show
Quoted 8 lines
the
Quoted 2 lines
message "quota rescan started". Ignoring the output of the command solves this problem.
Hi Marcos,
Can you elaborate exactly how it fails?
QA output created by 210
quota rescan started
Silence is goldenSure, my fault to not clarifying the error I was facing. This only happens with btrfs/210, which fails for me:
QA output created by 210
quota rescan started
Silence is golden
I've never seen those tests fail due to an unexpected "quota rescan
Quoted 6 lines
started" message.
I also don't see how this change fixes anything, because:
1) The quota rescans are always executed - so we should always see such failure;
Yes, it's interesting because running other tests touched by this patchset do not trigger the issue, but I thought it would be nice to have this pattern among all tests that start a quota rescan. Any ideas why this happens?
With this patch, specifically with the change on btrfs/210 solves the issue for me as the message is dropped.
Thanks,
Marcos
Quoted 230 lines
2) More importantly
_run_btrfs_util_progis:
_run_btrfs_util_prog()
{
run_check$BTRFS_UTIL_PROG $*
}and
run_check:
run_check(){ echo "# $@" >> $seqres.full 2>&1 "$@" >> $seqres.full 2>&1 || _fail "failed: '$@'" }So any output from
_run_btrfs_util_progis redirected to the test's .full file.
It will not cause a mismatch with the golden output.tests/btrfs/017 $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE
Quoted 22 lines
Signed-off-by Marcos Paulo de Souza <[email protected]>--- tests/btrfs/017 | 2 +- tests/btrfs/022 | 4 ++-- tests/btrfs/028 | 2 +- tests/btrfs/057 | 2 +- tests/btrfs/091 | 2 +- tests/btrfs/104 | 2 +- tests/btrfs/123 | 2 +- tests/btrfs/126 | 2 +- tests/btrfs/139 | 2 +- tests/btrfs/153 | 2 +- tests/btrfs/193 | 2 +- tests/btrfs/210 | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-)tests/btrfs/017 +0
-0@@ -64,7 +64,7 @@ $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE$SCRATCH_MNT/foo \
tests/btrfs/017 $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE $SCRATCH_MNT/foo \ · line 67
Quoted 5 lines
tests/btrfs/017 +1
-1$SCRATCH_MNT/snap/foo-reflink2 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/nullSo this is pointless, as mentioned before, any output is already redirected to the test's .full file.
The same applies to all changes below.So I fail to see what problem you are trying to solve.
Thanks.
Quoted 13 lines
tests/btrfs/017 +0
-0rm -fr $SCRATCH_MNT/foo* rm -fr $SCRATCH_MNT/snap/foo*tests/btrfs/022 +1
-1@@ -38,7 +38,7 @@ _basic_test() echo "=== basic test ===" >> $seqres.full _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a _run_btrfs_util_prog quota enable $SCRATCH_MNT/a - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNTQuoted 3 lines
/dev/null
subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep$subvolid >> \
Quoted 9 lines
$seqres.full 2>&1tests/btrfs/022 +1
-1@@ -77,7 +77,7 @@ _rescan_test() echo "qgroup values before rescan: $output" >> $seqres.full refer=$(echo $output | awk '{ print $2 }') excl=$(echo $output | awk '{ print $3 }') - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
/dev/nulloutput=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT |grep "0/$subvolid")
Quoted 7 lines
echo "qgroup values after rescan: $output" >> $seqres.full [ $refer -eq $(echo $output | awk '{ print $2 }') ] || \
tests/btrfs/028 +0
-0tests/btrfs/028 _scratch_mkfs >/dev/null · line 47
Quoted 7 lines
tests/btrfs/028 +1
-1@@ -42,7 +42,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Increase the probability of generating de-refer extent, anddecrease
tests/btrfs/057 run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w
Quoted 6 lines
tests/btrfs/028 +0
-0# other.tests/btrfs/057 +0
-0@@ -47,7 +47,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w-p 5 -n 1000 \
tests/btrfs/091 _run_btrfs_util_prog subvolume create
Quoted 13 lines
tests/btrfs/057 +1
-1$FSSTRESS_AVOID >&/dev/null _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null echo "Silence is golden" # btrfs check will detect any qgroup number mismatch.tests/btrfs/091 +0
-0@@ -59,7 +59,7 @@ _run_btrfs_util_prog subvolume create$SCRATCH_MNT/subv2
tests/btrfs/091 _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv2
Quoted 7 lines
tests/btrfs/091 +1
-1_run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv3 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # if we don't support noinode_cache mount option, then we shoulddouble check
tests/btrfs/091 _run_btrfs_util_prog subvolume create · line 65
Quoted 1 line
tests/btrfs/091 +0
-0# whether inode cache is enabled before executing the real testpayload.
tests/btrfs/104 _explode_fs_tree 1 $SCRATCH_MNT/snap2/files-
Quoted 5 lines
tests/btrfs/104 +0
-0@@ -113,7 +113,7 @@ _explode_fs_tree 1 $SCRATCH_MNT/snap2/files-snap2
Quoted 26 lines
tests/btrfs/104 +1
-1# Enable qgroups now that we have our filesystem prepared. This # will kick off a scan which we will have to wait for. _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Remount to clear cache, force everything to disk _scratch_cycle_mounttests/btrfs/123 +1
-1@@ -56,7 +56,7 @@ sync # enable quota and rescan to get correct number _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # now balance data block groups to corrupt qgroup _run_btrfs_balance_start -d $SCRATCH_MNT >> $seqres.fulltests/btrfs/126 +0
-0tests/btrfs/126 _scratch_mkfs >/dev/null · line 47
Quoted 8 lines
tests/btrfs/126 +1
-1@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount "-o enospc_debug" _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 512K 0/5 $SCRATCH_MNT # The amount of written data may change due to different nodesizeat mkfs time,
tests/btrfs/210 _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" >
Quoted 44 lines
tests/btrfs/139 +1
-1@@ -43,7 +43,7 @@ SUBVOL=$SCRATCH_MNT/subvol _run_btrfs_util_prog subvolume create $SUBVOL _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit -e 1G $SUBVOLtests/btrfs/153 +1
-1@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 100M 0/5 $SCRATCH_MNT testfile1=$SCRATCH_MNT/testfile1tests/btrfs/193 +1
-1@@ -43,7 +43,7 @@ _scratch_mkfs > /dev/null _scratch_mount $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null -$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null +$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" >/dev/null $BTRFS_UTIL_PROG qgroup limit -e 256M "$SCRATCH_MNT" # Create a file with the following layout:tests/btrfs/210 +0
-0@@ -46,7 +46,7 @@ _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" >
/dev/nullQuoted 11 lines
tests/btrfs/210 +1
-2# 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.26.2
Quoted 19 lines · Marcos Paulo de Souza
Quoted 8 lines · Filipe Manana
Quoted 4 lines · Marcos Paulo de Souza
From: Marcos Paulo de Souza <[email protected]>
Some recent test already ignore this output, while older ones do
not.
Quoted 1 line
It can sometimes make tests fail because "quota rescan" can show
Quoted 8 lines
the
Quoted 2 lines
message "quota rescan started". Ignoring the output of the command solves this problem.
Hi Marcos,
Can you elaborate exactly how it fails?
Quoted 8 lines
QA output created by 210
quota rescan started
Silence is goldenSure, my fault to not clarifying the error I was facing. This only happens with btrfs/210, which fails for me:QA output created by 210
quota rescan started
Silence is golden
Then this patch should only touch 210.
Quoted 9 lines
I've never seen those tests fail due to an unexpected "quota rescan
Quoted 6 lines
started" message.
I also don't see how this change fixes anything, because:
1) The quota rescans are always executed - so we should always see such failure;
Quoted 7 lines
Yes, it's interesting because running other tests touched by this patchset do not trigger the issue, but I thought it would be nice to have this pattern among all tests that start a quota rescan. Any ideas why this happens?
With this patch, specifically with the change on btrfs/210 solves the issue for me as the message is dropped.
So we should have a changelog that explains why the issue happens.
Looking at 210, my guess is that the rescan command starts the rescan worker before the quota enable ioctl does (causing the message to be printed),
as starting it is done asynchronously (iirc there were several bugs by this in the past, I fixed some of them, others fixed other similar problems).
This needs to be checked/confirmed and then mentioned in the change log.
Redirecting stdout to /dev/null or the .full file fixes the problem, and I'm fine with it if the above is indeed the cause for the unexpected message.
Thanks.
Quoted 235 lines
Thanks,
MarcosQuoted 230 lines
2) More importantly
_run_btrfs_util_progis:
_run_btrfs_util_prog()
{
run_check$BTRFS_UTIL_PROG $*
}and
run_check:
run_check(){ echo "# $@" >> $seqres.full 2>&1 "$@" >> $seqres.full 2>&1 || _fail "failed: '$@'" }So any output from
_run_btrfs_util_progis redirected to the test's .full file.
It will not cause a mismatch with the golden output.tests/btrfs/017 $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE
Quoted 22 lines
Signed-off-by Marcos Paulo de Souza <[email protected]>--- tests/btrfs/017 | 2 +- tests/btrfs/022 | 4 ++-- tests/btrfs/028 | 2 +- tests/btrfs/057 | 2 +- tests/btrfs/091 | 2 +- tests/btrfs/104 | 2 +- tests/btrfs/123 | 2 +- tests/btrfs/126 | 2 +- tests/btrfs/139 | 2 +- tests/btrfs/153 | 2 +- tests/btrfs/193 | 2 +- tests/btrfs/210 | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-)tests/btrfs/017 +0
-0@@ -64,7 +64,7 @@ $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE$SCRATCH_MNT/foo \
tests/btrfs/017 $CLONER_PROG -s 0 -d 0 -l $EXTENT_SIZE $SCRATCH_MNT/foo \ · line 67
Quoted 5 lines
tests/btrfs/017 +1
-1$SCRATCH_MNT/snap/foo-reflink2 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/nullSo this is pointless, as mentioned before, any output is already redirected to the test's .full file.
The same applies to all changes below.So I fail to see what problem you are trying to solve.
Thanks.
Quoted 13 lines
tests/btrfs/017 +0
-0rm -fr $SCRATCH_MNT/foo* rm -fr $SCRATCH_MNT/snap/foo*tests/btrfs/022 +1
-1@@ -38,7 +38,7 @@ _basic_test() echo "=== basic test ===" >> $seqres.full _run_btrfs_util_prog subvolume create $SCRATCH_MNT/a _run_btrfs_util_prog quota enable $SCRATCH_MNT/a - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNTQuoted 3 lines
/dev/null
subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT a) $BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT | grep$subvolid >> \
Quoted 9 lines
$seqres.full 2>&1tests/btrfs/022 +1
-1@@ -77,7 +77,7 @@ _rescan_test() echo "qgroup values before rescan: $output" >> $seqres.full refer=$(echo $output | awk '{ print $2 }') excl=$(echo $output | awk '{ print $3 }') - _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT + _run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
/dev/nulloutput=$($BTRFS_UTIL_PROG qgroup show $units $SCRATCH_MNT |grep "0/$subvolid")
Quoted 7 lines
echo "qgroup values after rescan: $output" >> $seqres.full [ $refer -eq $(echo $output | awk '{ print $2 }') ] || \
tests/btrfs/028 +0
-0tests/btrfs/028 _scratch_mkfs >/dev/null · line 47
Quoted 7 lines
tests/btrfs/028 +1
-1@@ -42,7 +42,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Increase the probability of generating de-refer extent, anddecrease
tests/btrfs/057 run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w
Quoted 6 lines
tests/btrfs/028 +0
-0# other.tests/btrfs/057 +0
-0@@ -47,7 +47,7 @@ run_check $FSSTRESS_PROG -d $SCRATCH_MNT/snap1 -w-p 5 -n 1000 \
tests/btrfs/091 _run_btrfs_util_prog subvolume create
Quoted 13 lines
tests/btrfs/057 +1
-1$FSSTRESS_AVOID >&/dev/null _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null echo "Silence is golden" # btrfs check will detect any qgroup number mismatch.tests/btrfs/091 +0
-0@@ -59,7 +59,7 @@ _run_btrfs_util_prog subvolume create$SCRATCH_MNT/subv2
tests/btrfs/091 _run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv2
Quoted 7 lines
tests/btrfs/091 +1
-1_run_btrfs_util_prog subvolume create $SCRATCH_MNT/subv3 _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # if we don't support noinode_cache mount option, then we shoulddouble check
tests/btrfs/091 _run_btrfs_util_prog subvolume create · line 65
Quoted 1 line
tests/btrfs/091 +0
-0# whether inode cache is enabled before executing the real testpayload.
tests/btrfs/104 _explode_fs_tree 1 $SCRATCH_MNT/snap2/files-
Quoted 5 lines
tests/btrfs/104 +0
-0@@ -113,7 +113,7 @@ _explode_fs_tree 1 $SCRATCH_MNT/snap2/files-snap2
Quoted 26 lines
tests/btrfs/104 +1
-1# Enable qgroups now that we have our filesystem prepared. This # will kick off a scan which we will have to wait for. _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # Remount to clear cache, force everything to disk _scratch_cycle_mounttests/btrfs/123 +1
-1@@ -56,7 +56,7 @@ sync # enable quota and rescan to get correct number _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null # now balance data block groups to corrupt qgroup _run_btrfs_balance_start -d $SCRATCH_MNT >> $seqres.fulltests/btrfs/126 +0
-0tests/btrfs/126 _scratch_mkfs >/dev/null · line 47
Quoted 8 lines
tests/btrfs/126 +1
-1@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount "-o enospc_debug" _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 512K 0/5 $SCRATCH_MNT # The amount of written data may change due to different nodesizeat mkfs time,
tests/btrfs/210 _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" >
Quoted 44 lines
tests/btrfs/139 +1
-1@@ -43,7 +43,7 @@ SUBVOL=$SCRATCH_MNT/subvol _run_btrfs_util_prog subvolume create $SUBVOL _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit -e 1G $SUBVOLtests/btrfs/153 +1
-1@@ -41,7 +41,7 @@ _scratch_mkfs >/dev/null _scratch_mount _run_btrfs_util_prog quota enable $SCRATCH_MNT -_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT +_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT >/dev/null _run_btrfs_util_prog qgroup limit 100M 0/5 $SCRATCH_MNT testfile1=$SCRATCH_MNT/testfile1tests/btrfs/193 +1
-1@@ -43,7 +43,7 @@ _scratch_mkfs > /dev/null _scratch_mount $BTRFS_UTIL_PROG quota enable "$SCRATCH_MNT" > /dev/null -$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" > /dev/null +$BTRFS_UTIL_PROG quota rescan -w "$SCRATCH_MNT" >/dev/null $BTRFS_UTIL_PROG qgroup limit -e 256M "$SCRATCH_MNT" # Create a file with the following layout:tests/btrfs/210 +0
-0@@ -46,7 +46,7 @@ _pwrite_byte 0xcd 0 16M "$SCRATCH_MNT/src/file" >
/dev/nullQuoted 11 lines
tests/btrfs/210 +1
-2# 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.26.2
Signature · 3 lines
Filipe David Manana, “Whether you think you can, or you think you can't — you're right.”