Skip to contentSkip to conversation

btrfs: 210: Ignore output from "quota rescan" after "quota enable"

PATCH In review Marcos Paulo de Souza 2 participants 2 messages Jul 21, 2020 – Jul 22, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 btrfs: 210: Ignore output from "quota rescan" after "quota enable"

From: Marcos Paulo de Souza <[email protected]>

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.

---
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(-)
tests/btrfs/210 +1 -1
index daa76a87..13d1a87b 100755
@@ -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.27.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 13 lines · Marcos Paulo de Souza

From: Marcos Paulo de Souza <[email protected]>

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.

Quoted 4 lines

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

Looks good now, thanks.

Quoted 23 lines

---
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(-)
tests/btrfs/210 +1 -2
index daa76a87..13d1a87b 100755
@@ -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

Signature · 3 lines
Filipe David Manana,

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