mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 19:19:32 +03:00
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 <hutter2@llnl.gov> Reviewed-by: Damian Szuberski <szuberskidamian@gmail.com> Thanks: James Dingwall <james-launchpad@dingwall.me.uk> Signed-off-by: Richard Laager <rlaager@wiktel.com> Closes #10662
This commit is contained in:
parent
0cdda2edb3
commit
7eba3891e9
@ -28,15 +28,17 @@ filter_out_deleted_zvols() {
|
|||||||
list_zvols() {
|
list_zvols() {
|
||||||
read -r default_volmode < /sys/module/zfs/parameters/zvol_volmode
|
read -r default_volmode < /sys/module/zfs/parameters/zvol_volmode
|
||||||
zfs list -t volume -H -o \
|
zfs list -t volume -H -o \
|
||||||
name,volmode,receive_resume_token,redact_snaps |
|
name,volmode,receive_resume_token,redact_snaps,keystatus |
|
||||||
while IFS=" " read -r name volmode token redacted; do # IFS=\t here!
|
while IFS=" " read -r name volmode token redacted keystatus; do # IFS=\t here!
|
||||||
|
|
||||||
# /dev links are not created for zvols with volmode = "none"
|
# /dev links are not created for zvols with volmode = "none",
|
||||||
# or for redacted zvols.
|
# redacted zvols, or encrypted zvols for which the key has not
|
||||||
|
# been loaded.
|
||||||
[ "$volmode" = "none" ] && continue
|
[ "$volmode" = "none" ] && continue
|
||||||
[ "$volmode" = "default" ] && [ "$default_volmode" = "3" ] &&
|
[ "$volmode" = "default" ] && [ "$default_volmode" = "3" ] &&
|
||||||
continue
|
continue
|
||||||
[ "$redacted" = "-" ] || continue
|
[ "$redacted" = "-" ] || continue
|
||||||
|
[ "$keystatus" = "unavailable" ] && continue
|
||||||
|
|
||||||
# We also ignore partially received zvols if it is
|
# We also ignore partially received zvols if it is
|
||||||
# not an incremental receive, as those won't even have a block
|
# not an incremental receive, as those won't even have a block
|
||||||
|
Loading…
Reference in New Issue
Block a user