From 509f8ae5747a356b0eaeef998ce41ac79033c148 Mon Sep 17 00:00:00 2001 From: Richard Laager Date: Sat, 1 Aug 2020 12:32:10 -0500 Subject: [PATCH] zvol_wait: Ignore locked zvols Thanks: James Dingwall Signed-off-by: Richard Laager --- cmd/zvol_wait/zvol_wait | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/zvol_wait/zvol_wait b/cmd/zvol_wait/zvol_wait index 9a3948da5564..1e8dde5e0089 100755 --- a/cmd/zvol_wait/zvol_wait +++ b/cmd/zvol_wait/zvol_wait @@ -26,18 +26,21 @@ filter_out_deleted_zvols() { list_zvols() { zfs list -t volume -H -o \ - name,volmode,receive_resume_token,redact_snaps | + name,volmode,receive_resume_token,redact_snaps,keystatus | 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}') + keystatus=$(echo "$zvol_line" | awk '{print $5}') # - # /dev links are not created for zvols with volmode = "none" - # or for redacted zvols. + # /dev links are not created for zvols with volmode = "none", + # redacted zvols, or encrypted zvols for which the key has not + # been loaded. # [ "$volmode" = "none" ] && continue [ "$redacted" = "-" ] || continue + [ "$keystatus" = "unavailable" ] && continue # # We also also ignore partially received zvols if it is # not an incremental receive, as those won't even have a block