Merge pull request #228 from imjfckm/fix-removing-inactive-core

Fix removing clean inactive core
This commit is contained in:
Robert Baldyga 2019-12-11 16:15:36 +01:00 committed by GitHub
commit 691cd81f18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -819,9 +819,12 @@ int _cache_mngt_remove_core_prepare(ocf_cache_t cache, ocf_core_t core,
/* Flush core */ /* Flush core */
flush_result = _cache_mngt_core_flush_sync(core, flush_result = _cache_mngt_core_flush_sync(core,
flush_interruptible); flush_interruptible);
} else if (!ocf_mngt_core_is_dirty(core)) {
/* Clean core is always "flushed" */
flush_result = 0;
} else { } else {
printk(KERN_WARNING OCF_PREFIX_SHORT printk(KERN_WARNING OCF_PREFIX_SHORT
"Cannot remove inactive core " "Cannot remove dirty inactive core "
"without force option\n"); "without force option\n");
return -OCF_ERR_CORE_IN_INACTIVE_STATE; return -OCF_ERR_CORE_IN_INACTIVE_STATE;
} }