ZTS: Improve block_device_wait on FreeBSD

FreeBSD doesn't have an equivalent to udevadm settle, so we have been
resorting to a three second sleep to wait for device changes to take
effect.  This is far from ideal.

We are mainly waiting for volmode=geom zvols to appear in /dev, so as
a hack, reading the geom config will have the desired effect of
quiescing the geom state.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #10768
This commit is contained in:
Ryan Moeller 2020-08-24 11:50:15 -04:00 committed by GitHub
parent 07ce8961e5
commit b0e75805ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -81,7 +81,9 @@ function block_device_wait
log_note udevadm settle time too long: $elapsed log_note udevadm settle time too long: $elapsed
elif is_freebsd; then elif is_freebsd; then
if [[ ${#@} -eq 0 ]]; then if [[ ${#@} -eq 0 ]]; then
sleep 3 # Do something that has to go through the geom event
# queue to complete.
sysctl kern.geom.conftxt >/dev/null
return return
fi fi
fi fi