Skip to content

Commit bd7f1a8

Browse files
zvol_wait: properly handle zvol_volmode sysctl being 3/none
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
1 parent 488e386 commit bd7f1a8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cmd/zvol_wait/zvol_wait

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,25 @@ filter_out_deleted_zvols() {
2525
}
2626

2727
list_zvols() {
28+
read -r default_volmode < /sys/module/zfs/parameters/zvol_volmode
2829
zfs list -t volume -H -o \
2930
name,volmode,receive_resume_token,redact_snaps |
3031
while IFS=" " read -r name volmode token redacted; do # IFS=\t here!
31-
#
32+
3233
# /dev links are not created for zvols with volmode = "none"
3334
# or for redacted zvols.
34-
#
3535
[ "$volmode" = "none" ] && continue
36+
[ "$volmode" = "default" ] && [ "$default_volmode" = "3" ] &&
37+
continue
3638
[ "$redacted" = "-" ] || continue
37-
#
39+
3840
# We also ignore partially received zvols if it is
3941
# not an incremental receive, as those won't even have a block
4042
# device minor node created yet.
41-
#
4243
if [ "$token" != "-" ]; then
43-
#
44+
4445
# Incremental receives create an invisible clone that
4546
# is not automatically displayed by zfs list.
46-
#
4747
if ! zfs list "$name/%recv" >/dev/null 2>&1; then
4848
continue
4949
fi

0 commit comments

Comments
 (0)