summaryrefslogtreecommitdiffstats
path: root/module/zfs/zvol.c
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-07-31 20:07:05 +0200
committerTony Hutter <[email protected]>2017-08-02 11:21:14 -0700
commit20c88dc3efd7e83aa872fad786f9e74ab5e350b9 (patch)
tree81af4b343f02ca9e6de86f6804052b19631afd27 /module/zfs/zvol.c
parent0c8fedeb355b00322f2785442929d29591cf00c8 (diff)
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 <[email protected]> Signed-off-by: loli10K <[email protected]> Closes #6426
Diffstat (limited to 'module/zfs/zvol.c')
-rw-r--r--module/zfs/zvol.c3
1 files changed, 3 insertions, 0 deletions
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);