Commit Graph

99 Commits

Author SHA1 Message Date
Michal Mielewczyk
e6d8af673f configure: make_req_type: Fix argument list
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>
2024-10-03 15:32:58 +02:00
Michal Mielewczyk
c7857f161a configure: make_req_type: Remove invalid negation
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-10-03 15:32:58 +02:00
Michal Mielewczyk
8fbbf31734 configure framework: detect make_req_fn type
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-09-25 15:59:21 +02:00
Robert Baldyga
17d2b9fecc
Merge pull request #1528 from mmichal10/nomerges-explained
Restore the explanation for NOMERGES flag
2024-09-20 18:43:05 +02:00
Robert Baldyga
c73686fa50 Remove unused configure.d symbols
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-09-20 18:03:06 +02:00
Michal Mielewczyk
a1629790af Restore the explanation for NOMERGES flag
The comment was remved in 1e5355eba1

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-09-20 09:29:09 +02:00
Michal Mielewczyk
853e8f9357 configure: refactor cas_copy_queue_limits()
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-09-09 15:57:35 +02:00
Michal Mielewczyk
33721e7c92 Set NOMERGES flag for cache volume
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
2024-09-09 15:57:30 +02:00
Michal Mielewczyk
0836101b85 configure: refactor bdev_{close|open}() API
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-07-31 07:13:12 +02:00
Michal Mielewczyk
cc7ac0f551 Close block devices in a synchronous manner
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>
2024-07-31 07:12:01 +02:00
Robert Baldyga
d3a1ce8987 Add support for kernel v6.9
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-07-08 14:16:14 +02:00
Michael Lyulko
7e7a93132d configure: add missing include
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
2024-06-21 09:42:02 +02:00
Robert Baldyga
b9aa65f254 Add support for Linux kernel up to 6.8
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-05-14 08:47:45 +02:00
Tamar Levovitz
a202d8c9f5 Add support for Linux kernel up to 6.5
Signed-off-by: Tamar Levovitz <tamar.levovitz@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-05-14 08:47:21 +02:00
Robert Baldyga
77980308f1
Merge pull request #1437 from mmichal10/fix-configure
configure: remove unused 1_write_flag.conf
2023-01-09 10:55:44 +01:00
Michal Mielewczyk
26f836507e configure: remove unused 1_write_flag.conf
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2023-01-05 14:39:02 +01:00
Robert Baldyga
9db73b2fb6 Set gd->queue to NULL after queue cleanup
Otherwise put_disk() tries to access the queue which leads to
kernel panic.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-12-30 15:18:07 +01:00
Michal Mielewczyk
4753374b1b Change CAS_BIO_MAX_VECS value
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>
2022-12-28 13:59:20 +01:00
Krzysztof Majzerowicz-Jaszcz
a4326627e0 Version comparison logic fix for RHEL workaround.
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>
2022-12-19 08:35:19 -05:00
Krzysztof Majzerowicz-Jaszcz
f1bf2eb909 Kernel 6.0 support
This patch introduces kernel 6.0 support for Open CAS

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-10-28 09:41:43 +02:00
Robert Baldyga
4bf7bbdd25
Merge pull request #1379 from robertbaldyga/openshift-workaround
Workaround for 4.18.0-305.45.1 OpenShift kernel
2022-10-25 11:04:33 +02:00
Robert Baldyga
cefaa3b415
Merge pull request #1380 from robertbaldyga/available-memory-check
Use available memory statistic when possible
2022-10-25 11:04:15 +02:00
Krzysztof Majzerowicz-Jaszcz
f0af7cb52d Open CAS Linux kernel 5.18 support
This patch introduces the support for 5.18 kernel.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-10-24 09:53:01 +00:00
Robert Baldyga
b00de9c940 Use available memory statistic when possible
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>
2022-10-12 08:12:42 +02:00
Robert Baldyga
52279d257e Workaround for 4.18.0-305.45.1 OpenShift kernel
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-10-11 20:55:12 +02:00
Rafal Stefanowski
3964f30edb Fix missing include in 1_bio_dev.conf in configure scripts
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2022-10-06 12:34:37 +02:00
Krzysztof Majzerowicz-Jaszcz
dfcb80abae Fix for incorrect header file handling in ./configure
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>
2022-10-05 15:22:27 +02:00
Robert Baldyga
64420d7ce7 Remove blkdev_can_hndl_bio() function
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>
2022-09-27 16:39:33 +02:00
Robert Baldyga
70cc908b39
Merge pull request #1345 from robertbaldyga/consolidate-cas-modules
Consolidate Open CAS modules
2022-09-19 14:55:30 +02:00
Robert Baldyga
4ed64582a6 Remove cas_disk from naming in code
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-19 10:38:21 +02:00
Michal Mielewczyk
1b084e5475 configure: fix rhel 8.5 workaround check
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>
2022-09-12 09:32:03 +02:00
Rafal Stefanowski
91f5d497ef copyright/license: Add missing file extensions
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>
2022-09-07 15:23:11 +02:00
Krzysztof Majzerowicz-Jaszcz
28bb302b5f RHEL 8.5 workaround - version check fix
Fix the version check for the RHEL8.5 workaround

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-08-26 11:26:57 +02:00
Krzysztof Majzerowicz-Jaszcz
da885a8ade Fix for a build failure for Ubuntu 18.04 kernel 4.15
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>
2022-08-18 13:43:00 +02:00
Krzysztof Majzerowicz-Jaszcz
e997f768b0 Rework for RHEL8.5
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>
2022-08-16 13:50:59 +02:00
Krzysztof Majzerowicz-Jaszcz
b983eeb751 RHEL8.5 kernel 4.18 support fix
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>
2022-08-12 08:52:36 +02:00
Michal Mielewczyk
e4bc62bd18 Add missing semicolons in configure scripts
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>
2022-08-11 13:33:31 +02:00
Robert Baldyga
a4610f96cc configure: Add get_define() helper function
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-08-10 12:13:15 +02:00
Robert Baldyga
51dc893fc1 configure: Don't append semicolon by default
This allows to pass not only C code, but also preprocessor directives.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-08-09 19:49:38 +02:00
Robert Baldyga
d460d39374 configure: Fix coding style
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-08-09 19:49:38 +02:00
Adam Rutkowski
ae1bede207 remove unused config options
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-06-27 16:25:15 +02:00
Krzysztof Majzerowicz-Jaszcz
b3140ed863 Fix for #1224 - kernel crash in the IO path
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>
2022-06-14 05:12:48 -04:00
Krzysztof Majzerowicz-Jaszcz
24fd2d1140 Fix compilation issues on rhel's 4.18 kernel
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>
2022-06-10 09:08:29 -04:00
Krzysztof Majzerowicz-Jaszcz
12ddca1cf3 OpenCAS Linux kernel 5.15 adaptation
This patch adapts OpenCAS Linux to compile and work with kernel v5.15

Commit id's from the kernel affecting OpenCAS:

commit 0e0ccdecb3cff95a350b4364e7ebbaa754d0e47d
    block: remove bdget_disk

commit 9c2b9dbafc067e173db30c4fd0636392d27944e8
    block: remove alloc_disk and alloc_disk_node

commit a8698707a1835be3abd12a3b28079a80999f8dee
    block: move bd_mutex to struct gendisk

commit 2cece3778475abc855084d897a3cf61249798ad9
    scsi: scsi_ioctl: Remove scsi_req_init()

commit 2f4731dcd0bb73379fbb9e3eb07ae7324125caef
    block: remove bdput

commit 14cf1dbb55bb07427babee425fd2a8a9300737cc
    block: remove bdgrab

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-06-09 08:49:32 +02:00
Gal Hammer
4ed8a59402 configure/bio_max_vecs: adapt to kernel 5.12
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>
2022-03-08 16:06:03 +02:00
Gal Hammer
1d64bc5294 configure/bd_first_part: adapt to kernel 5.12
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>
2022-03-07 09:44:35 +01:00
Gal Hammer
3c3cb6bdf1 configure/bio_dev: adapt to kernel 5.12
Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
2022-03-07 09:44:35 +01:00
Gal Hammer
4bb435555f configure/bd_part_count: adapt to kernel 5.12
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>
2022-03-07 09:44:35 +01:00
Gal Hammer
fea5e72d8c configure/module_mutex: adapt to kernel 5.12
The module_mutex is internal to the module loader since kernel
commit 922f2a7c.

Signed-off-by: Gal Hammer <gal.hammer@huawei.com>
Signed-off-by: Shai Fultheim <shai.fultheim@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-07 09:41:59 +01:00
Robert Baldyga
46e6d92732 configure: trigger compilation error on pointer type incompatibility
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-29 16:45:11 +01:00