Commit Graph

355 Commits

Author SHA1 Message Date
Jan Musial
6771f54b69 Use new OCF volume API
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-06-09 12:54:32 +02: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
Piotr Debski
f773d7fff3 standard error message for each disallowed management operation in standby mode
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-04-25 23:47:52 +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
Adam Rutkowski
5bcba78e7f Make sure classifier string is null terminated
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-08 16:42:25 +02:00
Michal Mielewczyk
531c7856bd Prevent uninitialized value
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 16:42:25 +02:00
Michal Mielewczyk
68cadd90f8 Destroy volume if it couldn't be opened
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 16:42:25 +02:00
Robert Baldyga
737d19f00d Wait for cleaner thread completion before destroying priv
_cas_stop_thread() function synchronizes with cleaner thread, so after
that we can be sure that there are no more ongoing cleaning requests.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-07 14:07:06 +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
Michal Mielewczyk
fb97333688 Don't remove core exported objects on standby stop
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-29 09:40:28 +02:00
Robert Baldyga
eae8bf92e5
Merge pull request #1134 from rafalste/permissions_cleanup
Packages and permissions improvements
2022-03-28 21:34:56 +02:00
Robert Baldyga
f73ab567ee
Merge pull request #1136 from robertbaldyga/cache-mode-standby-error
Return error on cache mode change in standby mode
2022-03-28 14:33:08 +02:00
Robert Baldyga
4ca0eb0530
Merge pull request #1135 from robertbaldyga/core-remove-fixes
Core remove fixes
2022-03-28 13:51:44 +02:00
Rafal Stefanowski
d19fc94d14 Improve package creation
- ddiskit related modifications
- fix for resolving weak-modules symlinks

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2022-03-28 12:05:59 +02:00
Rafal Stefanowski
cb8d1cffae Fix files/dirs permissions
- change modes to proper values
- replace 'mkdir' with 'install'
- remove unused files and dirs

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2022-03-28 11:49:38 +02:00
Robert Baldyga
fd1b2dc121 Do not print exported object path if it was removed
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-28 09:01:57 +02:00
Robert Baldyga
4c431bf71c Return error on cache mode change in standby mode
Changing cache mode to the same mode is a special case that in OCL is
handled on the kernel level, without calling an OCF API. In result it
seemed to succeed even in standby mode, which should return an error.

Explicitly check for standby to return an appropriate error code.


Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-27 21:31:29 +02:00
Robert Baldyga
59f2a86db0
Merge pull request #1085 from hammerg/bio_max_vecs
configure/bio_max_vecs: adapt to kernel 5.12
2022-03-25 22:21:45 +01: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
f7fa4ae140 Add missing ioctl codes to the index
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-25 21:34:22 +01:00
Michal Mielewczyk
3f525179e4 Put module in case of failing to finalize activate
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-24 09:16:50 +01:00
Michal Mielewczyk
387e22eaaa Remain in standby in case of minor activate error
Instead of stopping passive instance in case of every possible error, allow it
to remain in standby mode if the error was handleable

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-24 09:16:50 +01:00
Michal Mielewczyk
d9d8062f7c Mark cache priv as inited during activate
Cache priv is being allocated on starting cache instance and is freed only when
stopping cache. This cachnge allows to properly handle rollback if activate has
failed. Without setting this flag managment queue is not being stopped despite
its cache doesn't exist.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-24 09:16:50 +01:00
Michal Mielewczyk
8a8420be2a Fix error message about not enough amount of RAM
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-22 09:22:55 +01:00
Robert Baldyga
a185a6e595 Propagate io->dir flags when submitting flush bio in bottom volume
When dir is ignored, and 0 is passed instead, each flush request will
appear as READ request, which is not supported by some block device
drivers.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-17 20:43:15 +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
430d971bb9
Merge pull request #1088 from robertbaldyga/activate-ignore-part-check
Ignore partitions check on standby activate
2022-03-10 21:32:44 +01:00
Robert Baldyga
be328691af Remove extra whitespace
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-09 15:52:47 +01:00
Robert Baldyga
91508af014 Remove unused error code
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-09 15:52:47 +01:00
Robert Baldyga
8cd28d13ae Ignore partitions check on standby activate
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-09 12:02:06 +01:00
Robert Baldyga
7ba87f767d
Merge pull request #1082 from pdebski21/complete_reinit_fix
initializing completion twice replaced with reinit
2022-03-08 16:49:04 +01: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
Robert Baldyga
759338e742 Remove "metadata_layout" module parameter
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-08 08:53:47 +01:00
Robert Baldyga
1f15724b88
Merge pull request #1053 from hammerg/fix_kernel_5.12_v2
Add a support for kernel 5.12
2022-03-08 08:25:58 +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
Piotr Debski
e7a9f29d36 initializing completion twice replaced with reinit
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-02-27 02:50:20 +01:00
Piotr Debski
7b304d9f48 When core exported object name exists activation fails and cache is stopped
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-02-25 23:06:17 +01:00
Jan Musial
9da912e485 Forbid using load with other options in cas_cache
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-10 12:06:37 +01:00
Jan Musial
2ff055d689 Don't generate cache_id's on casadm side and use loaded cache params
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-10 12:06:37 +01:00
Robert Baldyga
7041517bf4
Merge pull request #1040 from robertbaldyga/fix-core-add-bug
Protect core config preparation function against non-existing cache
2022-01-12 12:29:54 +01:00
Robert Baldyga
05e0590fbc Protect core config preparation function against non-existing cache
It is legal to call KCAS_IOCTL_INSERT_CORE against non-existing cache
(in try_add mode), however in that case core_id has to be provded.
Return error code in case when given cache id does not exist and core_id
is set to OCF_CORE_MAX.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-10 20:03:50 +01:00
Robert Baldyga
63bab9584c Redesign failover standby management
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-05 16:17:52 +01:00
Robert Baldyga
b0a3c9cd45
Merge pull request #982 from robertbaldyga/remove-redundant-io-get-put
Remove redundant ocf_io_get()/ocf_io_put() from bottom volume
2021-12-27 15:21:32 +01:00
Adam Rutkowski
0f6a024025 Make device parameter obligatory in failover activate
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-12-01 00:58:09 +01:00
Robert Baldyga
990f55d250 Fix error mapping
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-26 09:29:37 +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
57a3938872 Improve error mapping code
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-25 17:11:07 +01:00
Robert Baldyga
73461fc26d Add missing error mappings
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-25 16:27:08 +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