mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 10:54:35 +03:00
ZVOL: Make zvol_inhibit_dev module parameter platform-independent
The module parameter now is represented in FreeBSD sysctls list with name: 'vfs.zfs.vol.inhibit_dev'. The default value is '0', same as on Linux side. Sponsored-by: vStack, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Rob Norris <rob.norris@klarasystems.com> Signed-off-by: Fedor Uporov <fuporov.vstack@gmail.com> Closes #17384
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
# 5. Verify "volmode=default" behaves accordingly to "volmode" module parameter
|
||||
# 6. Verify "volmode" property is inherited correctly
|
||||
# 7. Verify "volmode" behaves correctly at import time
|
||||
# 8. Verify "volmode" behaves accordingly to zvol_inhibit_dev (Linux only)
|
||||
# 8. Verify "volmode" behaves accordingly to zvol_inhibit_dev
|
||||
#
|
||||
|
||||
verify_runnable "global"
|
||||
@@ -64,10 +64,8 @@ function sysctl_inhibit_dev # value
|
||||
{
|
||||
typeset value="$1"
|
||||
|
||||
if is_linux; then
|
||||
log_note "Setting zvol_inhibit_dev tunable to $value"
|
||||
log_must set_tunable32 VOL_INHIBIT_DEV $value
|
||||
fi
|
||||
log_note "Setting zvol_inhibit_dev tunable to $value"
|
||||
log_must set_tunable32 VOL_INHIBIT_DEV $value
|
||||
}
|
||||
|
||||
#
|
||||
@@ -230,31 +228,29 @@ log_must_busy zfs destroy $SUBZVOL
|
||||
blockdev_missing $ZDEV
|
||||
blockdev_missing $SUBZDEV
|
||||
|
||||
# 8. Verify "volmode" behaves accordingly to zvol_inhibit_dev (Linux only)
|
||||
if is_linux; then
|
||||
sysctl_inhibit_dev 1
|
||||
# 7.1 Verify device nodes not are not created with "volmode=full"
|
||||
sysctl_volmode 1
|
||||
log_must zfs create -V $VOLSIZE -s $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
set_volmode full $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
log_must_busy zfs destroy $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
# 7.1 Verify device nodes not are not created with "volmode=dev"
|
||||
sysctl_volmode 2
|
||||
log_must zfs create -V $VOLSIZE -s $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
set_volmode dev $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
log_must_busy zfs destroy $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
# 7.1 Verify device nodes not are not created with "volmode=none"
|
||||
sysctl_volmode 3
|
||||
log_must zfs create -V $VOLSIZE -s $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
set_volmode none $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
fi
|
||||
# 8. Verify "volmode" behaves accordingly to zvol_inhibit_dev
|
||||
sysctl_inhibit_dev 1
|
||||
# 7.1 Verify device nodes not are not created with "volmode=full"
|
||||
sysctl_volmode 1
|
||||
log_must zfs create -V $VOLSIZE -s $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
set_volmode full $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
log_must_busy zfs destroy $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
# 7.1 Verify device nodes not are not created with "volmode=dev"
|
||||
sysctl_volmode 2
|
||||
log_must zfs create -V $VOLSIZE -s $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
set_volmode dev $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
log_must_busy zfs destroy $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
# 7.1 Verify device nodes not are not created with "volmode=none"
|
||||
sysctl_volmode 3
|
||||
log_must zfs create -V $VOLSIZE -s $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
set_volmode none $ZVOL
|
||||
blockdev_missing $ZDEV
|
||||
|
||||
log_pass "Verify that ZFS volume property 'volmode' works as intended"
|
||||
|
||||
Reference in New Issue
Block a user