]> granicus.if.org Git - zfs/commitdiff
Block_device_wait does not return an error code
authorRichard Elling <Richard.Elling@RichardElling.com>
Fri, 7 Jun 2019 17:12:42 +0000 (10:12 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 10 Jun 2019 16:21:08 +0000 (09:21 -0700)
Reviewed by: John Kennedy <john.kennedy@delphix.com>
Reviewed-by: Giuseppe Di Natale <guss80@gmail.com>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Elling <Richard.Elling@RichardElling.com>
Closes #8839

tests/zfs-tests/include/blkdev.shlib
tests/zfs-tests/tests/functional/rsend/send-wDR_encrypted_zvol.ksh
tests/zfs-tests/tests/functional/slog/slog_replay_volume.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_009_pos.ksh
tests/zfs-tests/tests/functional/snapshot/snapshot_010_pos.ksh

index 9cac7184f9fc44b2f2dcf26e8f3780ea93f1048c..e9d584af4b6a6c7c7903ffca2417c901918a8b7d 100644 (file)
@@ -56,6 +56,9 @@ function scan_scsi_hosts
 #
 # 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
index 49b846e9c332ca55df9ba5b3c79347416edfee9c..443887bfa2385673d35912a7ff4a926f8ae66fc9 100755 (executable)
@@ -62,7 +62,7 @@ log_must eval "echo 'password' > $keyfile"
 
 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
@@ -82,7 +82,7 @@ done
 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
 
index 2cdcb38dc257f2c9ebe7d458a6e3dc1cf89d1147..c8a3cbbf43c4b3b5a29dbb16c57683dbc3eb84f0 100755 (executable)
@@ -86,7 +86,7 @@ log_must zfs create -V 128M $TESTPOOL/$TESTVOL
 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
@@ -149,7 +149,7 @@ log_must zpool export $TESTPOOL
 # `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
 
 #
index 6607d4ca497448e8552c9665eedbc63ff5995860..1ee7e33c2ac2a528bb64cb93923c582f07a626bd 100755 (executable)
@@ -88,7 +88,7 @@ else
 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 \
index 0f876ad6d61e1ca1576478100a66f2a0e108a5c2..128b443c6fc924118c29328364d9d2df7190d23f 100755 (executable)
@@ -83,7 +83,7 @@ else
 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
@@ -92,7 +92,7 @@ for snap in $snapctr $snapctrvol $snapctrclone $snapctrfs; do
                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