Previously when user tried to allocate to big bio he recieved NULL. As the
behavior was changed to `BUG()` passing out of range value is no longer legal.
Limiting the requested bio size to BIO_MAX_PAGES (on the older kernels) or to
BIO_MAX_VECS (on the newer ones) eliminates the problem as the macros represent
the max possible value.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.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>
Update function returning size of free memory to use available statistic
if that's supported by given kernel. This function is used to check
whether there is enough memory to start cache, and available statistic is
preferred for this check over free statistic, as it does include size of
page cache allocations which can be easily reclaimed by the system.
Signed-off-by: Robert Baldyga <robert.baldyga@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>
Kmemleak is a tool which allows to detect memory leaks in kernel. It requires
`CONFIG_DEBUG_KMEMLEAK` to be enabled during kernel compilation. Otherwise all
the kmemleak_* functions are NOPs.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
As we no longer have in flight upgrade, all exported objects are guaranteed
to be destroyed before cas_cache module is unloaded, so this deinit
mechanism is not needed anymore.
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>