From c7a7601c08d3f7db42dfca46e0ad8aa287df43da Mon Sep 17 00:00:00 2001 From: LOLi Date: Mon, 31 Jul 2017 20:07:05 +0200 Subject: Fix volmode=none property behavior at import time At import time spa_import() calls zvol_create_minors() directly: with the current implementation we have no way to avoid device node creation when volmode=none. Fix this by enforcing volmode=none directly in zvol_alloc(). Reviewed-by: Brian Behlendorf Signed-off-by: loli10K Closes #6426 --- module/zfs/zvol.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'module/zfs/zvol.c') diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 623fb9b22..254760220 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -1603,6 +1603,9 @@ zvol_alloc(dev_t dev, const char *name) if (volmode == ZFS_VOLMODE_DEFAULT) volmode = zvol_volmode; + if (volmode == ZFS_VOLMODE_NONE) + return (NULL); + zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP); list_link_init(&zv->zv_next); -- cgit v1.2.3