Add missing mutex_exit(&zvol_state_lock)
With the recent ZVOL update zvol_set_volblocksize() accidentally lost its mutex_exit(). This was noticed when zvol_create_minor() blocked on the zvol_state_lock while it was holding the spa_namespace_lock(). This caused everything to get blocked up and hung the system.
This commit is contained in:
parent
b11386351e
commit
122e5b44e1
|
@ -342,11 +342,15 @@ zvol_set_volblocksize(const char *name, uint64_t volblocksize)
|
||||||
mutex_enter(&zvol_state_lock);
|
mutex_enter(&zvol_state_lock);
|
||||||
|
|
||||||
zv = zvol_find_by_name(name);
|
zv = zvol_find_by_name(name);
|
||||||
if (zv == NULL)
|
if (zv == NULL) {
|
||||||
return (ENXIO);
|
error = ENXIO;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (get_disk_ro(zv->zv_disk) || (zv->zv_flags & ZVOL_RDONLY))
|
if (get_disk_ro(zv->zv_disk) || (zv->zv_flags & ZVOL_RDONLY)) {
|
||||||
return (EROFS);
|
error = EROFS;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
tx = dmu_tx_create(zv->zv_objset);
|
tx = dmu_tx_create(zv->zv_objset);
|
||||||
dmu_tx_hold_bonus(tx, ZVOL_OBJ);
|
dmu_tx_hold_bonus(tx, ZVOL_OBJ);
|
||||||
|
@ -362,6 +366,8 @@ zvol_set_volblocksize(const char *name, uint64_t volblocksize)
|
||||||
if (error == 0)
|
if (error == 0)
|
||||||
zv->zv_volblocksize = volblocksize;
|
zv->zv_volblocksize = volblocksize;
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
|
mutex_exit(&zvol_state_lock);
|
||||||
|
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue