Instead of trying to access properties of potenially unavaliable cache device
use properties saved in cache priv
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit fixes the case of using unintialized variable in error
handling path after failed core addition.
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
This check will always return 0, as none of kernel versions supported
by Open CAS sets a barrier flag in for bio. Those flags are exclusive to
struct request, which is no longer used by Open CAS.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
Rework for RHEL8.5 compatibility to avoid potential bug of exiting queue
after IO completion on a different CPU.
Targeted RHEL kernel version corrected.
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
This patch adds support for RHEL8.5 with kernel 4.18.0.348.2.1.el8 and
later.
Additional request queue operations added for these kernels.
Configure scripts added/updated.
Fixes#1278
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
In specific circumstances, IO could be completed twice.
This patch fixes this problem.
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
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>
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>
OCF cannot allocate request map bigger than 4MiB (due to kmalloc
limitations), thus we need to split bigger IOs into series smaller
ones to reduce request map size.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
It's defined on every single supported kernel, so there is actually no need
for this define at all.
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
The data->size field can be initialized to a lower value than bio->bi_vcnt,
if the bio is split. The bio_for_each_segment then iterates based on the original
indexes and the mismatch eventually causes a BUG_ON.
Fixes#714
Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
Since commit 8b3238cabd50e27 in linux kernel removed blk_bidi_rq() marco, it
has to be wrapped in CAS `configure` script
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
To avoid logging the same message each time _cache_mngt_create_exported_object()
is called, print error message within it.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>