Commit Graph

64 Commits

Author SHA1 Message Date
Rafal Stefanowski
6a275773ce Kernel 6.13: Introduce cas_queue_max_discard_sectors()
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
2025-02-05 17:29:45 +01:00
Rafal Stefanowski
e5607fe9dd Kernel 6.13: Introduce cas_queue_set_nonrot()
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@huawei.com>
2025-02-05 17:29:45 +01:00
Robert Baldyga
1e80f2d0c2 Update after removing struct ocf_io
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-09-13 12:38:26 +02:00
Toby Roth
988ac5f645 Do not submit IO in complete flush
Signed-off-by: Toby Roth <toby.roth@huawei.com>
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-09-10 14:36:43 +02:00
Michal Mielewczyk
bb8fc64ed5 Enable adding core to detached cache instance
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>
2024-09-09 15:57:35 +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
Robert Baldyga
5c4b5634cb Add missing "static" to the local functions
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-05-14 08:22:34 +02:00
Robert Baldyga
334cc31a5c Set exp_obj rotational=0
Signed-off-by: Robert Baldyga <robert.baldyga@huawei.com>
2024-04-03 12:11:42 +02:00
Krzysztof Majzerowicz-Jaszcz
2eef5ce36b Fix for using uninitialized variable in printk
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>
2022-11-08 11:47:23 +00: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
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
5e2c1c15cf Merge exp obj create/activate
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-23 14:21:37 +02:00
Robert Baldyga
2f54aea87d Remove exported object kobj
Simplify exported object lifecycle.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-23 14:21:36 +02:00
Robert Baldyga
1fe83b4972 Manage lifetime of exported object in top adapter
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-23 14:20:42 +02:00
Robert Baldyga
6d2266f7ee Remove cas_disk_claim()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-09-19 15:37:56 +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
Robert Baldyga
8eb512a743 Remove cas_disk symbol lookup
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-08-25 13:02:25 +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
Krzysztof Majzerowicz-Jaszcz
bd9548cff4 Potential double IO completion fix
In specific circumstances, IO could be completed twice.
This patch fixes this problem.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-08-10 11:28:43 +02:00
Krzysztof Majzerowicz-Jaszcz
2739d83bec Fix for null pointer dereference bug
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>
2022-06-24 06:06:49 -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
Robert Baldyga
8fae9e2476 Destroy exp obj workqueue properly
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-08 17:16:04 +02:00
Robert Baldyga
df36c027a6 Do not destroy expobj_wq if destroying exporting object failed
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-31 21:36:27 +02:00
Robert Baldyga
76db828e4c Skip already removed exported objects on cache stop
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-25 21:35:07 +01:00
Robert Baldyga
e4d4750f96 Don't propagate bio flags to OCF for discard I/O
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>
2022-03-16 13:44:44 +01:00
Robert Baldyga
d28881588d Map OCF error codes to errno in io path
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-25 17:11:07 +01:00
Robert Baldyga
6743c02033 Return kernel error codes on I/O path
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-22 14:35:24 +01:00
Rafal Stefanowski
acec05060d Fix license
Change license to BSD-3-Clause

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-10-28 12:46:42 +02:00
Robert Baldyga
c0110a4d01 Introduce cache exported object
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-09 22:34:56 +02:00
Robert Baldyga
1dd8f12242 Rework exported object management functions
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-08-25 15:38:22 +02:00
Robert Baldyga
c968285d9f Remove upgrade-in-flight feature
Due to changes in Linux kernel this feature is not working anymore.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-08-11 20:33:16 +02:00
Robert Baldyga
2e4c460702 Use cache line size as discard granularity
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-07-15 22:47:08 +02:00
Robert Baldyga
517d98a6ed Split big IO requests
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>
2021-07-07 18:52:22 +02:00
Robert Baldyga
34dbbc056d Fix exported object deinitialization
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-24 14:24:04 +02:00
Robert Baldyga
e5e0697da4 Add support for kernel 5.11
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
2d7b94fa21 Remove block_dev_start_bio()
Now submit_bio path has no fallback to request queue, so we can simplify
io accounting.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
62eb6dc3fd Remove unused functions from top volume
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
5e17d0833f Remove unused callbacks from cas_disk ops
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
7f89e59b1a Remove CAS_FLUSH_SUPPORTED
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>
2021-06-15 18:59:08 +02:00
Robert Baldyga
b82b338c53 Remove blk request handling path
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 18:59:08 +02:00
Robert Baldyga
7343cb55fa Handle all io on bio handler
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-06-15 16:52:35 +02:00
Robert Baldyga
fbc3906576 Replace removed kernel API function with new one
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-05-26 23:35:30 +02:00
Michal Mielewczyk
0387ba18d7 Fix max discard size
`blk_queue_max_discard_sectors()` accepts 32bit parameter

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-05-07 11:14:46 +02:00
Kozlowski Mateusz
a45f0c854f Fix _blockdev_set_bio_data iteration
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>
2021-04-08 12:28:35 +02:00
Rafal Stefanowski
43f43068ad Update copyright statements (2021)
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-01-21 13:15:38 +01:00
Robert Baldyga
bbd0cb57a5 configure: Update generic_acct wrapper to kernel 5.8
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-12-22 11:33:38 +01:00
Michal Mielewczyk
8b64206570 configure: add CAS_BLK_BIDI_RQ() macro
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>
2020-08-25 08:46:24 -04:00
Michal Mielewczyk
017c4261b0 cas_cache: log failed creating exported object
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>
2020-07-07 08:28:53 -04:00