Add asserts in case of detached cache.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
parent
ea66039326
commit
f62c53862d
@ -1232,9 +1232,15 @@ int cache_mng_init_instance(struct ocf_mngt_cache_config *cfg,
|
||||
}
|
||||
|
||||
if (cmd) {
|
||||
ocf_volume_t cache_obj = ocf_cache_get_volume(cache);
|
||||
struct bd_object *bd_cache_obj = bd_object(cache_obj);
|
||||
struct block_device *bdev = bd_cache_obj->btm_bd;
|
||||
ocf_volume_t cache_obj;
|
||||
struct bd_object *bd_cache_obj;
|
||||
struct block_device *bdev;
|
||||
|
||||
cache_obj = ocf_cache_get_volume(cache);
|
||||
BUG_ON(!cache_obj);
|
||||
|
||||
bd_cache_obj = bd_object(cache_obj);
|
||||
bdev = bd_cache_obj->btm_bd;
|
||||
|
||||
/* If we deal with whole device, reread partitions */
|
||||
if (bdev->bd_contains == bdev)
|
||||
@ -1641,6 +1647,7 @@ int cache_mng_get_info(struct kcas_cache_info *info)
|
||||
|
||||
if (info->info.attached) {
|
||||
uuid = ocf_cache_get_uuid(cache);
|
||||
BUG_ON(!uuid);
|
||||
strlcpy(info->cache_path_name, uuid->data,
|
||||
min(sizeof(info->cache_path_name), uuid->size));
|
||||
|
||||
|
@ -543,6 +543,8 @@ void _blockdev_set_exported_object_flush_fua(ocf_core_t core)
|
||||
struct request_queue *core_q, *exp_q, *cache_q;
|
||||
bool flush, fua;
|
||||
|
||||
BUG_ON(!cache_vol);
|
||||
|
||||
bd_core_vol = bd_object(core_vol);
|
||||
bd_cache_vol = bd_object(cache_vol);
|
||||
|
||||
@ -624,6 +626,8 @@ static int _blockdev_set_geometry(struct casdsk_disk *dsk, void *private)
|
||||
cache = ocf_core_get_cache(core);
|
||||
core_vol = ocf_core_get_volume(core);
|
||||
cache_vol = ocf_cache_get_volume(cache);
|
||||
BUG_ON(!cache_vol);
|
||||
|
||||
bd_cache_vol = bd_object(cache_vol);
|
||||
path = ocf_volume_get_uuid(core_vol)->data;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user