Commit Graph

336 Commits

Author SHA1 Message Date
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
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
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
f909b21276 Remove redundant ocf_io_get()/ocf_io_put() from bottom volume
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-05 12:49:44 +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
6792c1b455
Merge pull request #930 from robertbaldyga/cache-passive-state
Add cache passive state
2021-09-10 13:09:23 +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
c0110a4d01 Introduce cache exported object
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-09 22:34:56 +02:00
Robert Baldyga
81108f74b7
Merge pull request #927 from jfckm/use-plugging-in-bottom-adapter
Use blk_plug mechanism in bottom block adapter
2021-09-02 11:23:37 +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
feb7134e34
Merge pull request #924 from jfckm/add_mq_blocking_config
Add config for BLK_MQ_F_BLOCKING flag
2021-08-20 10:21:11 +02:00
Robert Baldyga
a413e676e9
Merge pull request #925 from mmichal10/env-refactor
Env refactor
2021-08-20 10:20:17 +02:00
Jan Musial
6c6bc95b29 Use blk_plug mechanism in bottom block adapter
This is a suboptimal solution to CAS on top of MD RAID1 device. If using
only submit_bio API RAID1 would process all IOs in single thread.
Plugging bypasses this thread and processess IOs in blk_finish_plug
caller context improving performance drastically.

Testing showed no negative impact to other usecases and it's a thing
that Linux does in AIO, so it's vetted and proven to work.

Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-08-18 11:42:37 +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
Jan Musial
ac00bd503a Add config for BLK_MQ_F_BLOCKING flag
Signed-off-by: Jan Musial <jan.musial@intel.com>
2021-08-18 09:04:15 +02:00
Michal Mielewczyk
5e4fcb62be env: refactor rwmutex
All the operations on `count` are performed under the lock thus it doesn't need
to be atomic.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-08-17 15:52:25 +02:00