diff --git a/src/mngt/ocf_mngt_core.c b/src/mngt/ocf_mngt_core.c index 8f22dd2..de29774 100644 --- a/src/mngt/ocf_mngt_core.c +++ b/src/mngt/ocf_mngt_core.c @@ -63,10 +63,12 @@ static int _ocf_uuid_set(const struct ocf_volume_uuid *uuid, if (result) return result; - result = env_memset(muuid->data + uuid->size, - sizeof(muuid->data) - uuid->size, 0); - if (result) - return result; + if (uuid->size < sizeof(muuid->data)) { + result = env_memset(muuid->data + uuid->size, + sizeof(muuid->data) - uuid->size, 0); + if (result) + return result; + } muuid->size = uuid->size; diff --git a/src/mngt/ocf_mngt_core_pool.c b/src/mngt/ocf_mngt_core_pool.c index 5555d58..c76dba9 100644 --- a/src/mngt/ocf_mngt_core_pool.c +++ b/src/mngt/ocf_mngt_core_pool.c @@ -44,7 +44,7 @@ int ocf_mngt_core_pool_add(ocf_ctx_t ctx, ocf_uuid_t uuid, uint8_t type) result = ocf_volume_open(volume, NULL); if (result) { - ocf_volume_deinit(volume); + ocf_volume_destroy(volume); return result; } diff --git a/src/mngt/ocf_mngt_flush.c b/src/mngt/ocf_mngt_flush.c index a7d9460..8960c87 100644 --- a/src/mngt/ocf_mngt_flush.c +++ b/src/mngt/ocf_mngt_flush.c @@ -664,9 +664,6 @@ void ocf_mngt_cache_flush(ocf_cache_t cache, OCF_CHECK_NULL(cache); - if (ocf_cache_is_standby(cache)) - OCF_CMPL_RET(cache, priv, -OCF_ERR_CACHE_STANDBY); - if (ocf_cache_is_standby(cache)) { ocf_cache_log(cache, log_err, "Cannot flush cache - cache is standby\n"); OCF_CMPL_RET(cache, priv, -OCF_ERR_CACHE_STANDBY); diff --git a/src/ocf_volume.c b/src/ocf_volume.c index 58328a8..b3ed1ea 100644 --- a/src/ocf_volume.c +++ b/src/ocf_volume.c @@ -263,8 +263,10 @@ void ocf_volume_submit_io(struct ocf_io *io) ENV_BUG_ON(!volume->type->properties->ops.submit_io); - if (!volume->opened) + if (!volume->opened) { io->end(io, -OCF_ERR_IO); + return; + } volume->type->properties->ops.submit_io(io); } @@ -275,8 +277,10 @@ void ocf_volume_submit_flush(struct ocf_io *io) ENV_BUG_ON(!volume->type->properties->ops.submit_flush); - if (!volume->opened) + if (!volume->opened) { io->end(io, -OCF_ERR_IO); + return; + } if (!volume->type->properties->ops.submit_flush) { ocf_io_end(io, 0); @@ -290,8 +294,10 @@ void ocf_volume_submit_discard(struct ocf_io *io) { ocf_volume_t volume = ocf_io_get_volume(io); - if (!volume->opened) + if (!volume->opened) { io->end(io, -OCF_ERR_IO); + return; + } if (!volume->type->properties->ops.submit_discard) { ocf_io_end(io, 0);