[PATCH] fstests: btrfs/132: Use better method to wait the writer to avoid EBUSY

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



The kill and wait method will only wait for the children process to
exit, while the xfs_io can still run at background.

This makes the test always fails on HDD backed physical machine.

Use the "while ps aux | grep" method in btrfs/069 to truely wait the
xfs_io to finish.

Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
---
 tests/btrfs/132 | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/btrfs/132 b/tests/btrfs/132
index 0516177..db0dcb0 100755
--- a/tests/btrfs/132
+++ b/tests/btrfs/132
@@ -94,9 +94,10 @@ sleep $sleep_time
 kill $pids
 wait
 
-# Sync the fs to avoid EBUSY while umount, which is quite common for btrfs
-# compression
-sync
+# Wait all writers really exits
+while ps aux | grep "$SCRATCH_MNT" | grep -qv grep; do
+	sleep 1
+done
 
 echo "Silence is golden"
 status=0
-- 
2.7.4



--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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