From: Boyang Xue Date: Wed, 18 Jan 2017 09:27:23 +0000 (+0800) Subject: common/dmthin: call $UDEV_SETTLE_PROG before 'dmsetup remove' X-Git-Tag: v2022.05.01~2218 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6f4776c4b50bddfb0f7e8e0cf823a0225609b335;p=users%2Fhch%2Fxfstests-dev.git common/dmthin: call $UDEV_SETTLE_PROG before 'dmsetup remove' Wait for device to be fully settled so that 'dmsetup remove' doesn't fail due to EBUSY. Signed-off-by: Boyang Xue Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/dmthin b/common/dmthin index 3cd206a6b..e774175a6 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