From aaa1327774761890928463c584d1f6e694730068 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Wed, 27 Nov 2024 07:41:49 +1100 Subject: [PATCH] fstests: per-test dmdust instances We can't run two tests that use dmdust at the same time because the device name is the same. hence they interfere with each other. Give dmdust devices their own per-test names to avoid this problem. Signed-off-by: Dave Chinner Reviewed-by: Zorro lang Signed-off-by: Zorro Lang --- common/dmdust | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/dmdust b/common/dmdust index 56fcc0e0f..37bb865c8 100644 --- a/common/dmdust +++ b/common/dmdust @@ -4,12 +4,14 @@ # # common functions for setting up and tearing down a dmdust device +export DUST_NAME="dust-test.$seq" + _init_dust() { local DEV_SIZE=`blockdev --getsz $SCRATCH_DEV` - DUST_DEV=/dev/mapper/dust-test + DUST_DEV=/dev/mapper/$DUST_NAME DUST_TABLE="0 $DEV_SIZE dust $SCRATCH_DEV 0 512" - _dmsetup_create dust-test --table "$DUST_TABLE" || \ + _dmsetup_create $DUST_NAME --table "$DUST_TABLE" || \ _fatal "failed to create dust device" } @@ -29,7 +31,7 @@ _cleanup_dust() { # If dmsetup load fails then we need to make sure to do resume here # otherwise the umount will hang - $DMSETUP_PROG resume dust-test > /dev/null 2>&1 + $DMSETUP_PROG resume $DUST_NAME > /dev/null 2>&1 $UMOUNT_PROG $SCRATCH_MNT > /dev/null 2>&1 - _dmsetup_remove dust-test + _dmsetup_remove $DUST_NAME } -- 2.51.0