aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorRichard Laager <[email protected]>2022-04-22 17:37:03 -0500
committerGitHub <[email protected]>2022-04-22 15:37:03 -0700
commit7eba3891e9d0c211a1650ecfdfc78c654be055f8 (patch)
tree739ccf90ffe3ae9868ae8c1f9007c01a3e58c1de /cmd
parent0cdda2edb3f312d56518934811960ad57564c1bb (diff)
zvol_wait: Ignore locked zvols
"When an encrypted zvol is locked the zfs-volume-wait service does not start. The /sbin/zvol_wait should not wait for links when the volume has property keystatus=unavailable." -- https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/1888405 Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Damian Szuberski <[email protected]> Thanks: James Dingwall <[email protected]> Signed-off-by: Richard Laager <[email protected]> Closes #10662
Diffstat (limited to 'cmd')
-rwxr-xr-xcmd/zvol_wait/zvol_wait10
1 files changed, 6 insertions, 4 deletions
diff --git a/cmd/zvol_wait/zvol_wait b/cmd/zvol_wait/zvol_wait
index 2aa929b0c..f1fa42e27 100755
--- a/cmd/zvol_wait/zvol_wait
+++ b/cmd/zvol_wait/zvol_wait
@@ -28,15 +28,17 @@ filter_out_deleted_zvols() {
list_zvols() {
read -r default_volmode < /sys/module/zfs/parameters/zvol_volmode
zfs list -t volume -H -o \
- name,volmode,receive_resume_token,redact_snaps |
- while IFS=" " read -r name volmode token redacted; do # IFS=\t here!
+ name,volmode,receive_resume_token,redact_snaps,keystatus |
+ while IFS=" " read -r name volmode token redacted keystatus; do # IFS=\t here!
- # /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
[ "$volmode" = "default" ] && [ "$default_volmode" = "3" ] &&
continue
[ "$redacted" = "-" ] || continue
+ [ "$keystatus" = "unavailable" ] && continue
# We also ignore partially received zvols if it is
# not an incremental receive, as those won't even have a block