Commit Graph

156 Commits

Author SHA1 Message Date
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
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
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
Piotr Debski
9273b39d5d Fix error message for cache already in standby detach state
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-08-19 12:36:22 +02:00
Piotr Debski
dd95c8be4d Add core, try-add script missing core-id parameter fix
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-07-12 11:14:44 +02:00
Robert Baldyga
c3f5a209c0
Merge pull request #1246 from robertbaldyga/dev-conf-lifecycle-fix
Fix device config life cycle management
2022-06-27 12:04:23 +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
Robert Baldyga
f2adc702e7 Fix device config life cycle management
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-06-24 08:52:32 +02:00
Michal Mielewczyk
d9e643a41a Leave space for terminating buffers with null
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-06-24 08:05:11 +02:00
Robert Baldyga
7e6c8b97d7 Fix required memory check in the fallback path
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-06-22 20:41:27 +02:00
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
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
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
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
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
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
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
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
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
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
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
b189a7147e Update OCF - dynamic metadata update in standby mode
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-19 17:02:32 +01:00
Rafal Stefanowski
2097f8029b Set promote_on_threshold sequential cutoff flag
Due to linux thread scheduling nature, we prefer to promote streams
as early as we reasonably can. One way to achieve that is to set
promotion count really low, which unfortunately significantly increases
number of accesses to shared structures. The other way is to promote
streams which reach cutoff threshold, as we can reasonably assume that
they are likely be continued after thread is rescheduled to another CPU.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-11-09 13:41:49 +01:00
Robert Baldyga
5431f83273
Merge pull request #962 from Open-CAS/passive_api
Passive state - API changes
2021-11-03 10:11:08 +01:00
Krzysztof Majzerowicz-Jaszcz
3185564869 Standby state API changes
Don't print statistics for a cache in passive state
Passive cache - casadm set/get cache param disabled in passive state
Obsolete "cache_get_param" function removed
Error in layer_cache_management.c fixed
Flushing cache/core disabled with error for passive mode
Core addition disabled in passive mode
IO class setting disabled for passive mode
Counters reset disabled for passive mode
Ioctl handling changes to reflect OCF API changes

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2021-10-29 12:34:33 +02: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
Adam Rutkowski
90d8584bd7 failover detach
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-10-08 15:20:52 +02:00
Robert Baldyga
f8e39fa104 Introduce activate operation
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-10 08:56:59 +02:00
Robert Baldyga
17aa424319 Introduce cache bind operation
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-10 08:56:54 +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
1064cecbb9
Merge pull request #921 from mmichal10/remove-atomics
Remove remains of atomic writes support
2021-08-18 09:19:53 +02:00
Michal Mielewczyk
c68de77799 Remove remains of atomic writes support
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-08-16 16:01:21 +02:00
Robert Baldyga
3983cea2b5 Fix cache_priv deallocation
Since cache_priv is allocated with vmalloc() it should be deallocated
with vfree().

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-08-16 05:16:15 +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
Michal Mielewczyk
a6d3c70b1d Async API for switching cleaning policy
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-07-27 16:15:09 +02:00
Robert Baldyga
2a35bd09be Introduce lazy helper thread abstraction to avoid hung task
Some helper threads are created at the very beginning of cache start/stop
operations, but they are used only after OCF start/stop finishes, which
may take significant amount of time. Kernel by default creates threads
that wait for the first wake up in uninterruptible state, which may trigger
hung task warning if the first wake up is called more than 120 seconds
after thread creation. To mitigate this problem we create lazy thread
abstraction that waits for a wake up in interruptible state.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-07-13 10:07:25 +02:00