As now exported object path is not printed for cores that do not have
active exported object, there are needed some changes in tests that
relied on previous behavior.
Replace exported object based lookup with cache_id/core_id pair.
Signed-off-by: Robert Baldyga <robert.baldyga@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>
When dir is ignored, and 0 is passed instead, each flush request will
appear as READ request, which is not supported by some block device
drivers.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
One of the steps of discarding data in cache is invalidating OCF metadata.
If a cache line which is supposed to be discarded is dirty, invalidating
it will require flushing metadata. Unfortunately, OCF allocates flushing
requests with the exactly the same flags as the original IO (in this case
discard flag is set) so the page on the disk is discarded instead of being
flushed. In case of power failure occurring before the metadata is flushed
to the disk, the data may be corrupted even if recovery will succeed.
Disabling propagation of original I/O flags for discard requests solves
this problem.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Adjust manner of calculating some of the traits to the newer kernel version.
New way of calculating them have been introduced in kernel with commit
97f433c3601a24d3513d06f575a389a2ca4e11e4.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
The bio_alloc_bioset() function now BUG() if trying to allocate a bio
with more than BIO_MAX_VECS vectors.
A no-limit value (-1) is defined in order not to change old kernels'
behaviour.
Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>