public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common: make sure dm error device is all settled before removing it
@ 2016-03-24 12:08 Eryu Guan
  2016-03-24 12:34 ` Filipe Manana
  2016-03-24 13:25 ` [PATCH v2] common: make sure dm " Eryu Guan
  0 siblings, 2 replies; 4+ messages in thread
From: Eryu Guan @ 2016-03-24 12:08 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

_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@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-24 13:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-24 12:08 [PATCH] common: make sure dm error device is all settled before removing it Eryu Guan
2016-03-24 12:34 ` Filipe Manana
2016-03-24 13:17   ` Eryu Guan
2016-03-24 13:25 ` [PATCH v2] common: make sure dm " Eryu Guan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox