[PATCH] common: make sure dm error device is all settled before removing it

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



_dmerror_cleanup() may fail to remove error-test device due to EBUSY and
cause subsequent tests to fail.

Fix it by calling $UDEV_SETTLE_PROG before remove error-test device to
make sure no one is using it.

Signed-off-by: Eryu Guan <eguan@xxxxxxxxxx>
---
 common/dmerror | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/dmerror b/common/dmerror
index 004530d..5d2c1b6 100644
--- a/common/dmerror
+++ b/common/dmerror
@@ -54,6 +54,9 @@ _dmerror_unmount()
 _dmerror_cleanup()
 {
 	$UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1
+	# wait for device to be fully settled so that 'dmsetup remove' doesn't
+	# fail due to EBUSY
+	$UDEV_SETTLE_PROG >/dev/null 2>&1
 	$DMSETUP_PROG remove error-test > /dev/null 2>&1
 }
 
-- 
2.5.5

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