zvol_wait should ignore redacted zvols

zvol_wait waits for zvol links to be created under /dev/zvol for each zvol.
Links are not created for redacted zvols so we should ignore those.

Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Reviewed-by: Matt Ahrens <matt@delphix.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Closes #9545
This commit is contained in:
Pavel Zakharov 2019-11-06 13:51:19 -05:00 committed by Brian Behlendorf
parent ae38e00968
commit 1c47c2c42c
1 changed files with 6 additions and 2 deletions

View File

@ -25,15 +25,19 @@ filter_out_deleted_zvols() {
}
list_zvols() {
zfs list -t volume -H -o name,volmode,receive_resume_token |
zfs list -t volume -H -o \
name,volmode,receive_resume_token,redact_snaps |
while read -r zvol_line; do
name=$(echo "$zvol_line" | awk '{print $1}')
volmode=$(echo "$zvol_line" | awk '{print $2}')
token=$(echo "$zvol_line" | awk '{print $3}')
redacted=$(echo "$zvol_line" | awk '{print $4}')
#
# /dev links are not created for zvols with volmode = "none".
# /dev links are not created for zvols with volmode = "none"
# or for redacted zvols.
#
[ "$volmode" = "none" ] && continue
[ "$redacted" = "-" ] || continue
#
# We also also ignore partially received zvols if it is
# not an incremental receive, as those won't even have a block