openzfs / zfs

OpenZFS on Linux and FreeBSD
https://openzfs.github.io/openzfs-docs
Other
10.56k stars 1.74k forks source link

Changing zvol_volmode to/from 3 doesn't hide/expose devices #11874

Open nabijaczleweli opened 3 years ago

nabijaczleweli commented 3 years ago

System information

Type Version/Name
Distribution Name Debian
Distribution Version Buster
Linux Kernel Linux tarta 4.19.0-16-amd64 #1 SMP Debian 4.19.181-1 (2021-03-19) x86_64 GNU/Linux
Architecture amd64
ZFS Version 2.0.3-1~bpo10+1

Describe the problem you're observing

zfsprops(8) says:

volmode=default | full | geom | dev | none

Value default means that volumes exposition is controlled by system-wide tunable zvol_volmode, where full, dev and none are encoded as 1, 2 and 3 respectively. The default value is full.

(the default value is "default" actually, but that's beside the point)

and zfs-module-parameters(5) says:

zvol_volmode (uint)

Defines zvol block devices behaviour when volmode is set to default. Valid values are 1 (full), 2 (dev) and 3 (none).

Since changing volmode to/from none on an existent dataset hides/exposes it, I'd expect setting zvol_volmode to 3 to do the same.

Describe how to reproduce the problem

# zfs create -sV 1M pool/dset
# zfs get volmode pool/dset
NAME       PROPERTY  VALUE    SOURCE
pool/dset  volmode   default  default
# cat /sys/module/zfs/parameters/zvol_volmode
1
# lsblk | grep 1M
zd80     230:80   0     1M  0 disk

# zfs set volmode=none pool/dset
# lsblk | grep 1M

# zfs set volmode=default pool/dset
# echo 3 > /sys/module/zfs/parameters/zvol_volmode
# lsblk | grep 1M
zd80     230:80   0     1M  0 disk
# zfs set volmode=default pool/dse
# lsblk | grep 1M
# echo 1 > /sys/module/zfs/parameters/zvol_volmode
# lsblk | grep 1M
stale[bot] commented 2 years ago

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

nabijaczleweli commented 2 years ago

Re-tested, still the case on zfs-2.1.4-1.1

stale[bot] commented 1 year ago

This issue has been automatically marked as "stale" because it has not had any activity for a while. It will be closed in 90 days if no further activity occurs. Thank you for your contributions.

nabijaczleweli commented 1 year ago

Repros on zfs-2.1.9-1~bpo11+1 w/zfs-kmod-2.1.7-1