#
# Wait for newly created block devices to have their minors created.
#
+# Note: there is no meaningful return code if udevadm fails. Consumers
+# should not expect a return code (do not call as argument to log_must)
+#
function block_device_wait
{
if is_linux; then
log_must zfs create -o dedup=on -o encryption=on -o keyformat=passphrase \
-o keylocation=file://$keyfile -V 128M $TESTPOOL/$TESTVOL
-log_must block_device_wait
+block_device_wait
log_must eval "echo 'y' | newfs -t ext4 -v $zdev"
log_must mkdir -p $mntpnt
log_must eval "zfs send -wDR $TESTPOOL/$TESTVOL@snap$snap_count > $sendfile"
log_must eval "zfs recv $TESTPOOL/recv < $sendfile"
log_must zfs load-key $TESTPOOL/recv
-log_must block_device_wait
+block_device_wait
log_must mount $recvdev $recvmnt
log_must zfs set compression=on $TESTPOOL/$TESTVOL
log_must zfs set sync=always $TESTPOOL/$TESTVOL
log_must mkdir -p $TESTDIR
-log_must block_device_wait
+block_device_wait
echo "y" | newfs -t ext4 -v $VOLUME
log_must mkdir -p $MNTPNT
log_must mount -o discard $VOLUME $MNTPNT
# `zpool import -f` because we can't write a frozen pool's labels!
#
log_must zpool import -f $TESTPOOL
-log_must block_device_wait
+block_device_wait
log_must mount $VOLUME $MNTPNT
#
fi
log_must zfs snapshot -r $snappool
-log_must block_device_wait
+block_device_wait
#verify the snapshot -r results
for snap in $snappool $snapfs $snapvol $snapctr $snapctrvol \
fi
log_must zfs snapshot -r $snappool
-log_must block_device_wait
+block_device_wait
#select the $TESTCTR as destroy point, $TESTCTR is a child of $TESTPOOL
log_must zfs destroy -r $snapctr
log_fail "The snapshot $snap is not destroyed correctly."
done
-for snap in $snappool $snapfs $snapvol $ctrfs@$TESTSNAP1;do
+for snap in $snappool $snapfs $snapvol $ctrfs@$TESTSNAP1; do
! snapexists $snap && \
log_fail "The snapshot $snap should be not destroyed."
done