Better detect if the same device is being added twice

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2021-07-28 15:49:46 +02:00
parent 3b0236aca9
commit a98473afac

View File

@ -1070,8 +1070,7 @@ int start_cache(uint16_t cache_id, unsigned int cache_init,
return FAILURE; return FAILURE;
} else { } else {
cas_printf(LOG_ERR, "Error inserting cache %d\n", cache_id); cas_printf(LOG_ERR, "Error inserting cache %d\n", cache_id);
if (OCF_ERR_NOT_OPEN_EXC == cmd.ext_err_code && if (FAILURE == check_cache_already_added(cache_device)) {
FAILURE == check_cache_already_added(cache_device)) {
cas_printf(LOG_ERR, "Cache device '%s' is already used as cache.\n", cas_printf(LOG_ERR, "Cache device '%s' is already used as cache.\n",
cache_device); cache_device);
} else { } else {