mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-01-25 10:12:13 +03:00
ZVOL: Return early, if volmode is ZFS_VOLMODE_NONE on FreeBSD side
Return from zvol_os_create_minor() function immediately after dsl_prop_get_integer() call if volmode property value is set to 'none', like it is doing on Linux side. Sponsored-by: vStack, Inc. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <alexander.motin@TrueNAS.com> Signed-off-by: Fedor Uporov <fuporov.vstack@gmail.com> Closes #17405
This commit is contained in:
parent
ce9c3b4b94
commit
dea0fc969b
@ -1402,9 +1402,13 @@ zvol_os_create_minor(const char *name)
|
||||
|
||||
error = dsl_prop_get_integer(name,
|
||||
zfs_prop_to_name(ZFS_PROP_VOLMODE), &volmode, NULL);
|
||||
if (error || volmode == ZFS_VOLMODE_DEFAULT)
|
||||
if (error)
|
||||
goto out_dmu_objset_disown;
|
||||
|
||||
if (volmode == ZFS_VOLMODE_DEFAULT)
|
||||
volmode = zvol_volmode;
|
||||
error = 0;
|
||||
if (volmode == ZFS_VOLMODE_NONE)
|
||||
goto out_dmu_objset_disown;
|
||||
|
||||
/*
|
||||
* zvol_alloc equivalent ...
|
||||
@ -1496,7 +1500,7 @@ out_dmu_objset_disown:
|
||||
}
|
||||
out_doi:
|
||||
kmem_free(doi, sizeof (dmu_object_info_t));
|
||||
if (error == 0) {
|
||||
if (error == 0 && volmode != ZFS_VOLMODE_NONE) {
|
||||
rw_enter(&zvol_state_lock, RW_WRITER);
|
||||
zvol_insert(zv);
|
||||
zvol_minors++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user