Fix exported object cleanup in case of cache stop failure

In case of error during cache stop exported object is not being restored after destroying.
This may result in bug in case of calling stop once more.
This commit fixes this issue - exported objects are restored.

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
This commit is contained in:
Michal Rakowski
2019-07-16 16:12:43 +02:00
parent ee6cba515a
commit eee7a0e220
3 changed files with 29 additions and 3 deletions

View File

@@ -724,7 +724,10 @@ int casdsk_exp_obj_destroy(struct casdsk_disk *dsk)
struct casdsk_exp_obj *exp_obj;
BUG_ON(!dsk);
BUG_ON(!dsk->exp_obj);
if (!dsk->exp_obj)
return -ENODEV;
BUG_ON(!dsk->exp_obj->locked_bd);
CASDSK_DEBUG_DISK_TRACE(dsk);