From patchwork Wed Jan 18 05:48:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boyang Xue X-Patchwork-Id: 9522649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6117B6043A for ; Wed, 18 Jan 2017 05:49:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 44AF428517 for ; Wed, 18 Jan 2017 05:49:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35959285A7; Wed, 18 Jan 2017 05:49:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE61728517 for ; Wed, 18 Jan 2017 05:49:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751157AbdARFti (ORCPT ); Wed, 18 Jan 2017 00:49:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:48576 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750712AbdARFti (ORCPT ); Wed, 18 Jan 2017 00:49:38 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4D2CD7F7C3 for ; Wed, 18 Jan 2017 05:48:47 +0000 (UTC) Received: from fs-qe.usersys.redhat.com (ibm-x3250m4-06.rhts.eng.pek2.redhat.com [10.73.4.177]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0I5mjUu018770; Wed, 18 Jan 2017 00:48:46 -0500 From: bxue@redhat.com To: fstests@vger.kernel.org Cc: Boyang Xue Subject: [PATCH v1 1/2] common/dmthin: call $UDEV_SETTLE_PROG before 'dmsetup remove' Date: Wed, 18 Jan 2017 13:48:29 +0800 Message-Id: <1484718510-7433-1-git-send-email-bxue@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 18 Jan 2017 05:48:47 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Boyang Xue Wait for device to be fully settled so that 'dmsetup remove' doesn't fail due to EBUSY. Signed-off-by: Boyang Xue --- common/dmthin | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/dmthin b/common/dmthin index 3cd206a..e774175 100644 --- a/common/dmthin +++ b/common/dmthin @@ -38,6 +38,9 @@ DMTHIN_VOL_DEV="/dev/mapper/$DMTHIN_VOL_NAME" _dmthin_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 $DMTHIN_VOL_NAME> /dev/null 2>&1 $DMSETUP_PROG remove $DMTHIN_POOL_NAME> /dev/null 2>&1 $DMSETUP_PROG remove $DMTHIN_META_NAME> /dev/null 2>&1