aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-07-31 20:07:05 +0200
committerBrian Behlendorf <[email protected]>2017-07-31 11:07:05 -0700
commitc7a7601c08d3f7db42dfca46e0ad8aa287df43da (patch)
tree90c1469b35fc69dab920a2caa7a578af7bd5e346 /module
parent1e0565d10a5f75bd15104df3db3264554e8b2dd1 (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')
-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);