diff options
author | Boris Protopopov <[email protected]> | 2017-05-26 20:50:25 -0400 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-05-26 17:50:25 -0700 |
commit | 2d82116e80ba88fb8efbc3e573ee8a924323b32a (patch) | |
tree | 9dd86b21abc4e91346b35ac6fe49c6ddefc458ac /module/zfs/zvol.c | |
parent | 9210e43a1660bd1b742e80bfc121b86e2cfad57a (diff) |
Fix ida leak in zvol_create_minor_impl
Added missing ida_simple_remove() in the error handling path.
Reviewed-by: Chunwei Chen <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: George Melikov <[email protected]>
Signed-off-by: Boris Protopopov <[email protected]>
Closes #6159
Closes #6172
Diffstat (limited to 'module/zfs/zvol.c')
-rw-r--r-- | module/zfs/zvol.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/module/zfs/zvol.c b/module/zfs/zvol.c index 121f75e4e..8ca510b79 100644 --- a/module/zfs/zvol.c +++ b/module/zfs/zvol.c @@ -1164,6 +1164,12 @@ zvol_resume(zvol_state_t *zv) int error = 0; ASSERT(RW_WRITE_HELD(&zv->zv_suspend_lock)); + + /* + * Cannot take zv_state_lock here with zv_suspend_lock + * held; however, the latter is held in exclusive mode, + * so it is not necessary to do so + */ if (zv->zv_open_count > 0) { VERIFY0(dmu_objset_hold(zv->zv_name, zv, &zv->zv_objset)); VERIFY3P(zv->zv_objset->os_dsl_dataset->ds_owner, ==, zv); @@ -1620,6 +1626,7 @@ zvol_create_minor_impl(const char *name) zv = zvol_find_by_name_hash(name, hash); if (zv) { mutex_exit(&zvol_state_lock); + ida_simple_remove(&zvol_ida, idx); return (SET_ERROR(EEXIST)); } |