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:
Brian Behlendorf 2010-07-02 09:24:18 -07:00
parent b11386351e
commit 122e5b44e1
1 changed files with 10 additions and 4 deletions

View File

@ -342,11 +342,15 @@ zvol_set_volblocksize(const char *name, uint64_t volblocksize)
mutex_enter(&zvol_state_lock);
zv = zvol_find_by_name(name);
if (zv == NULL)
return (ENXIO);
if (zv == NULL) {
error = ENXIO;
goto out;
}
if (get_disk_ro(zv->zv_disk) || (zv->zv_flags & ZVOL_RDONLY))
return (EROFS);
if (get_disk_ro(zv->zv_disk) || (zv->zv_flags & ZVOL_RDONLY)) {
error = EROFS;
goto out;
}
tx = dmu_tx_create(zv->zv_objset);
dmu_tx_hold_bonus(tx, ZVOL_OBJ);
@ -362,6 +366,8 @@ zvol_set_volblocksize(const char *name, uint64_t volblocksize)
if (error == 0)
zv->zv_volblocksize = volblocksize;
}
out:
mutex_exit(&zvol_state_lock);
return (error);
}