The commit c62b37d96b6eb3ec5 in the Linux Kernel not only moved
`make_request_fn` to `struct block_device_operations` and renamed it to
`submit_bio` but in also removed the request_queue from the argument list.
8fbbf31734 missed the last change
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
fput() doesn't wait for all references on the disk to be unclaimed but instead
it only schedules a worker that is supposed to cleanup resources once the device
is released.
During cache initialization we open device at least twice - to check its
properties and then to actually use it as cache. But since we use the async
fput() after the probe, the device might still be in use once we try to open it
for the second time (the second open returns -EBUSY).
Using synchronous __fput_sync() to close the device fixes the issue
__fput_sync() exists in the kernel API longer than bdev_file_open_by_path() and
the presence of the latter is the condition to use the synchronous put so it is
perfectly safe to get rid of fput() from the configure framework
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
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 patch fixes the RHEL 8.7 hung task problem by correcting the version comparison logic
in the RHEL workaround configure step.
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>
In specific cases, header files will be included incorrectly
during the configuration phase, leading to erroneous failure
of affected configure step.
This patch fixes this issue.
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>
In case the installed kernel doesn't have a minor version number the script
fails. Assigning default value removes this error.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Proper file extensions help 'copyright header checker' find files
that should contain copyright info. Extensions also clearly indicate
file type, and help to fit in with the file naming convention.
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
This patch fixes the problem of fs_bio_set being defined as a pointer in
kernels before 4.18, which results in build failure.
Fixes#1312
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@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>
Since commit 51dc893fc1 every script must take care about adding a semicolon at
the end of compilable line of code
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This fixes issue #1224 - null pointer dereference in kernel in the IO path with large IO's issued
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
RHELs patched kernel needs additional configure.d test in order to
configure OpenCAS. This patch implements this.
Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@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>
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>
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>