makefs/zfs/tests: Force-destroy md devices
Most of these tests create a md(4) device backed by a makefs-generated image, then import the pool, using the md device as a pool vdev. When a test finishes, it destroys the pool, then destroys the md device. Once in a while md device destruction fails with EBUSY. This happens when a GEOM consumer is holding the device open; kern_mddetach_locked() simply fails if any consumers are present. zpool destruction is synchronous so ZFS is innocent, rather, the problem seems to be that GEOM re-tastes the device after the zpool reference goes away. This operation creates a transient reference that causes the spurious failure. Use "mdconfig -o force" to work around this. MFC after: 2 weeks
This commit is contained in:
@@ -51,7 +51,7 @@ common_cleanup()
|
||||
if [ -f "$TEST_MD_DEVICE_FILE" ]; then
|
||||
md=$(cat $TEST_MD_DEVICE_FILE)
|
||||
if [ -c /dev/"$md" ]; then
|
||||
mdconfig -d -u "$md"
|
||||
mdconfig -o force -d -u "$md"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@@ -210,7 +210,7 @@ compression_body()
|
||||
|
||||
atf_check zpool destroy ${ZFS_POOL_NAME}
|
||||
atf_check rm -f ${TEST_ZFS_POOL_NAME}
|
||||
atf_check mdconfig -d -u $(cat ${TEST_MD_DEVICE_FILE})
|
||||
atf_check mdconfig -o force -d -u $(cat ${TEST_MD_DEVICE_FILE})
|
||||
atf_check rm -f ${TEST_MD_DEVICE_FILE}
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user