Commit Graph

1592 Commits

Author SHA1 Message Date
Adam Rutkowski
b78c36ccdd pyocf: add missing import Volume in cache
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
6a03145acf pyocf: cache/core object volume fixes
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
ebb107f1a1 posix env: print call stack in case of BUG()
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
2dde108cd9 pyocf: collision addr helper
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
978620f9e3 pyocf: move C wrappers to newly added "c" diretory
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
f66eefb3bd pyocf: remember queue name
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
7c186f5d0e pyocf: make queues a required rio param
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:18 +02:00
Adam Rutkowski
c37ffea4c2 pyocf: add from_page() method to Size class
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-05-16 15:40:16 +02:00
Robert Baldyga
3aa12793a1
Merge pull request #713 from robertbaldyga/use-ocf-div-round-up
Use internal implementation of DIV_ROUND_UP
2022-05-13 21:21:26 +02:00
Robert Baldyga
703f5b7e23
Merge pull request #704 from robertbaldyga/disable-cleaner
Add disable_cleaner option
2022-05-10 14:07:19 +02:00
Robert Baldyga
ad7a40feaf Use internal implementation of DIV_ROUND_UP
It's required, because environments other than Linux kernel may not define
their own DIV_ROUND_UP. Moving it to env would just generate boilerplate,
because its implementation is trivial and portable.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-05-10 09:52:17 +02:00
Robert Baldyga
50bff0285d
Merge pull request #708 from KamilLepek/fix_perm
Fix permissions for verify_header.sh
2022-05-05 16:06:50 +02:00
Kamil Lepek
3464bb5da7 Fix permissions for verify_header.sh
Signed-off-by: Kamil Lepek <kamil.lepek@intel.com>
2022-05-05 13:49:05 +02:00
Robert Baldyga
32dbb2d355
Merge pull request #707 from Open-CAS/KamilLepek-patch-1
Added header verification script
2022-05-05 11:40:31 +02:00
Kamil Łepek
0ce8ced578 Added header verification script
Signed-off-by: Kamil Lepek <kamil.lepek@intel.com>
2022-05-04 16:52:11 +02:00
Robert Baldyga
ed012411d3 Add disable_cleaner field to CacheAttachConfig
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
94aca1e8e4 pyocf: Remove non-existing field from CacheAttachConfig
This field has been moved to CacheDeviceConfig.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
d4df912f46 Add option to disable cleaner
This allows to avoid allocating cleaner metadata section and effectively
save up to 20% of metadata memory footprint.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
761ff2f053 pyocf: Add test designs for disable_cleaner option
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-28 13:04:27 +02:00
Robert Baldyga
c088faf711 doc: Add disable_cleaner requirements documentation
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-27 16:09:14 +02:00
Adam Rutkowski
650511df4e pyocf: remove Queue objects from Cache::start() params
... since a started cache is required to construct a queue object.
Instead add params to control whether to construct and register
management and default I/O queue in start().

Additionally introducing Cache method to register additional I/O
queues.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-13 10:38:57 +02:00
Adam Rutkowski
1f9c3dd24f pyocf: add test fixture with 2 ctxts
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-13 10:38:56 +02:00
Robert Baldyga
fa6c0f3573
Merge pull request #699 from mmichal10/alleviation-for-static-analysers
Alleviation for static analyzers
2022-04-11 17:31:32 +02:00
Michal Mielewczyk
e8e4e00bb7 alru: explicit upcasting
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-11 15:21:37 +02:00
Michal Mielewczyk
cd4d894348 acp: skip the first bucket on recovering acp
Since the threshold for the first bucket is always zero and the condition to
exit from the loop is never met in the first iteration it is save to start
iterating from `1`

This change is meant to avoid confusing static code analyzers

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-11 13:14:25 +02:00
Robert Baldyga
99608c9a30
Merge pull request #698 from mmichal10/secure-fixes
fixes for Coverity static analysis findings
2022-04-08 16:39:31 +02:00
Michal Mielewczyk
edd42fed98 Avoid zero-size memcpy
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 16:10:28 +02:00
Michal Mielewczyk
92fa8f7e59 Remove redundant standby check
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 15:34:14 +02:00
Michal Mielewczyk
bc30d2665b Prevent sending io to volume if it not opened
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 15:34:14 +02:00
Michal Mielewczyk
9734980be2 Free memory when failed to open core volume
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-04-08 15:34:14 +02:00
Robert Baldyga
a0bf8587a0
Merge pull request #697 from arutk/deinit_pio_in_stop
Add missing pio deinitialization in standby stop pipeline
2022-04-07 13:02:06 +02:00
Adam Rutkowski
8f24556cec Add missing pio deinitialization in standby stop pipeline
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-07 12:23:03 +02:00
Adam Rutkowski
550a479cde fix typo in cache mngmt
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-07 12:23:03 +02:00
Robert Baldyga
bbaffd96a3
Merge pull request #696 from robertbaldyga/remove-spaces-from-vol-names
Remove space from names of internal volumes
2022-04-06 14:00:21 +02:00
Robert Baldyga
dc9c076ef3 Remove space from names of internal volumes
Those names are used for creating allocators. In Linux kernel environment
starting from version 5.12 there is a kernel warning if allocator name
contains spaces. This patch resolves this problem by replacing spaces with
underscores.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-06 13:23:02 +02:00
Robert Baldyga
744c5d4164
Merge pull request #694 from robertbaldyga/fix-double-clp-init
Avoid double initialization of cleaning policy in standby mode
2022-04-04 12:55:50 +02:00
Robert Baldyga
c677f65212 Avoid double initialization of cleaning policy in standby mode
Cleaning policy is initialized on standby activate, after all the metadata
from primary cache is flushed and the actual recovery is being performed.
Thus initializing it earlier on standby attach is incorrect.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-04-04 12:08:27 +02:00
Robert Baldyga
65918344c0
Merge pull request #691 from arutk/fix_core_load_err
Fix core load cleanup loop
2022-04-01 14:57:58 +02:00
Adam Rutkowski
77380d6579 Fix core load cleanup loop
conf_meta->core_count is not modified during load/recovery in the latest
version. Thus in case of error in cores initialization, in order to
iterate over the initialized cores we must depend on core->added only,
regardles of conf_meta->core_count value. for_each_core() macro does
exactly this.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-04-01 13:53:25 +02:00
Robert Baldyga
fdb32541cb
Merge pull request #690 from kmajzero/fix_error_1155
Fix error code for superblock checksum mismatch
2022-04-01 13:15:15 +02:00
Krzysztof Majzerowicz-Jaszcz
1b3f0d44a8 Fix error code for superblock checksum mismatch
Fix error code for superblock checksum mismatch.
Superblock validation now returns a proper error on checksum check fail.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-04-01 07:23:49 +00:00
Robert Baldyga
48fb745686
Merge pull request #688 from robertbaldyga/manage-valid-core-bitmap
Manage valid_core_bitmap properly
2022-03-31 14:32:34 +02:00
Adam Rutkowski
09b73461b4 Always modify valid_core_map together with core_count
.. to assure that superblock config state on drive is consistent

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-31 13:37:42 +02:00
Adam Rutkowski
77a709c086
Merge pull request #689 from mmichal10/security-fix
pyocf: minor security test fixes
2022-03-31 11:32:21 +02:00
Michal Mielewczyk
09d2843468 pyocf: minor security test fixes
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-31 10:01:05 +02:00
Robert Baldyga
9ebb0de878 Do not modify core_count on cache load / activate
Increment core_count only on core addition, and decrement it only on core
removal.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-31 10:00:24 +02:00
Robert Baldyga
25434cb8d1 Explicitly validate valid_core_bitmap consistency
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-30 23:46:06 +02:00
Robert Baldyga
9c751dd2b8 Manage valid_core_bitmap properly
Set bit only on core addition and clean it on core removal.

This allows to avoid conf metadata modification in load / standby load
paths, which effectively prevents issues with metadata mismatch during
consequent standby activate attempts after initial activate failure.
Previously the first attempt changed the metadata, so on comparison with
metadata on drive failed on any following attempt, leading to inability
to activate the cache.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-30 23:46:06 +02:00
Robert Baldyga
d550c8f4ef Fix minor coding style issues
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-30 22:15:50 +02:00
Robert Baldyga
ca8531a421
Merge pull request #685 from arutk/stats2
Return error from stats API functions in standby
2022-03-30 11:57:10 +02:00