Null pointer dereference occurs when terminating cache is standby detached state.
This fixes this problem.
Fixes#1235
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
Changing cache mode to the same mode is a special case that in OCL is
handled on the kernel level, without calling an OCF API. In result it
seemed to succeed even in standby mode, which should return an error.
Explicitly check for standby to return an appropriate error code.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Instead of stopping passive instance in case of every possible error, allow it
to remain in standby mode if the error was handleable
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Cache priv is being allocated on starting cache instance and is freed only when
stopping cache. This cachnge allows to properly handle rollback if activate has
failed. Without setting this flag managment queue is not being stopped despite
its cache doesn't exist.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Moved cas_blk_get_part_count function to configure section after the
the disk's partitions table was changed to xarray.
Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
It is legal to call KCAS_IOCTL_INSERT_CORE against non-existing cache
(in try_add mode), however in that case core_id has to be provded.
Return error code in case when given cache id does not exist and core_id
is set to OCF_CORE_MAX.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Due to linux thread scheduling nature, we prefer to promote streams
as early as we reasonably can. One way to achieve that is to set
promotion count really low, which unfortunately significantly increases
number of accesses to shared structures. The other way is to promote
streams which reach cutoff threshold, as we can reasonably assume that
they are likely be continued after thread is rescheduled to another CPU.
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
Don't print statistics for a cache in passive state
Passive cache - casadm set/get cache param disabled in passive state
Obsolete "cache_get_param" function removed
Error in layer_cache_management.c fixed
Flushing cache/core disabled with error for passive mode
Core addition disabled in passive mode
IO class setting disabled for passive mode
Counters reset disabled for passive mode
Ioctl handling changes to reflect OCF API changes
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>