public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: fstests@vger.kernel.org
Cc: Eryu Guan <eguan@redhat.com>
Subject: [PATCH] common: make sure dm error device is all settled before removing it
Date: Thu, 24 Mar 2016 20:08:31 +0800	[thread overview]
Message-ID: <1458821311-18968-1-git-send-email-eguan@redhat.com> (raw)

_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


             reply	other threads:[~2016-03-24 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 12:08 Eryu Guan [this message]
2016-03-24 12:34 ` [PATCH] common: make sure dm error device is all settled before removing it Filipe Manana
2016-03-24 13:17   ` Eryu Guan
2016-03-24 13:25 ` [PATCH v2] common: make sure dm " Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1458821311-18968-1-git-send-email-eguan@redhat.com \
    --to=eguan@redhat.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox