Manage lifetime of exported object in top adapter
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
parent
8945b482ce
commit
1fe83b4972
@ -149,9 +149,10 @@ error_kmem:
|
||||
|
||||
static void __cas_disk_close(struct cas_disk *dsk)
|
||||
{
|
||||
BUG_ON(dsk->exp_obj);
|
||||
|
||||
close_bdev_exclusive(dsk->bd, CAS_DISK_OPEN_FMODE);
|
||||
|
||||
cas_exp_obj_free(dsk);
|
||||
kobject_put(&dsk->kobj);
|
||||
}
|
||||
|
||||
|
@ -582,12 +582,17 @@ static int kcas_volume_destroy_exported_object(ocf_volume_t volume)
|
||||
|
||||
result = cas_exp_obj_destroy(bvol->dsk);
|
||||
if (result)
|
||||
goto out;
|
||||
goto err;
|
||||
|
||||
bvol->expobj_valid = false;
|
||||
destroy_workqueue(bvol->expobj_wq);
|
||||
|
||||
out:
|
||||
cas_exp_obj_unlock(bvol->dsk);
|
||||
cas_exp_obj_free(bvol->dsk);
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
cas_exp_obj_unlock(bvol->dsk);
|
||||
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user