From patchwork Wed Jan 18 09:27:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boyang Xue X-Patchwork-Id: 9522947 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 C2D5D601C3 for ; Wed, 18 Jan 2017 09:27:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B73B428553 for ; Wed, 18 Jan 2017 09:27:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AB12D2855A; Wed, 18 Jan 2017 09:27:52 +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 4B03B28553 for ; Wed, 18 Jan 2017 09:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751515AbdARJ1o (ORCPT ); Wed, 18 Jan 2017 04:27:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45546 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751983AbdARJ1h (ORCPT ); Wed, 18 Jan 2017 04:27:37 -0500 Received: from smtp.corp.redhat.com (int-mx16.intmail.prod.int.phx2.redhat.com [10.5.11.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5036081129 for ; Wed, 18 Jan 2017 09:27:33 +0000 (UTC) Received: from fs-qe.usersys.redhat.com (ibm-x3250m4-06.rhts.eng.pek2.redhat.com [10.73.4.177]) by smtp.corp.redhat.com (Postfix) with ESMTP id 59B3CB5BA4; Wed, 18 Jan 2017 09:27:32 +0000 (UTC) From: bxue@redhat.com To: fstests@vger.kernel.org Cc: Boyang Xue Subject: [PATCH v2 1/2] common/dmthin: call $UDEV_SETTLE_PROG before 'dmsetup remove' Date: Wed, 18 Jan 2017 17:27:23 +0800 Message-Id: <1484731644-7453-1-git-send-email-bxue@redhat.com> X-Scanned-By: MIMEDefang 2.74 on 10.5.11.28 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Wed, 18 Jan 2017 09:27:33 +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