Currently an rbd_device structure gets destroyed from the release
routine for the device embedded within it. Stop doing that, instead
calling rbd_dev_image_release() right after rbd_bus_del_dev()
wherever the latter is called.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
rbd_dev->major = 0;
rbd_dev_id_put(rbd_dev);
rbd_dev_mapping_clear(rbd_dev);
-
- rbd_dev_image_release(rbd_dev);
}
static void rbd_dev_remove_parent(struct rbd_device *rbd_dev)
}
rbd_assert(second);
rbd_bus_del_dev(second);
+ rbd_dev_image_release(second);
first->parent = NULL;
first->parent_overlap = 0;
goto done;
ret = count;
rbd_bus_del_dev(rbd_dev);
+ rbd_dev_image_release(rbd_dev);
module_put(THIS_MODULE);
done:
mutex_unlock(&ctl_mutex);