Commit Graph

500 Commits

Author SHA1 Message Date
Jan Musial
b5f014f689 Fix upgrade errors
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-14 09:53:03 +01:00
Michał Mielewczyk
dd908053fb
Merge pull request #272 from robertbaldyga/tests-enable-serial-log-plugin
tests: Enable serial_log plugin
2020-01-13 16:37:47 +01:00
Jan Musiał
64625b718b
Merge pull request #241 from robertbaldyga/test-cas-startup
tests: Add test for CAS startup on reboot
2020-01-13 16:09:58 +01:00
Robert Baldyga
5756edac1b tests: Enable serial_log plugin
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-13 16:09:25 +01:00
rafalste
4acc7fb328
Merge pull request #269 from imjfckm/dont-fail-on-missing-config
Don't fail boot if opencas config is missing
2020-01-13 11:55:31 +01:00
Jan Musial
7cdb71d5b7 Don't fail boot if opencas config is missing
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-13 10:42:19 +01:00
Katarzyna Łapińska
e435f3017a
Merge pull request #267 from mmichal10/remove-semicolon
Remove semicolons after 'if' condition
2020-01-07 15:56:45 +01:00
Michal Mielewczyk
79631867b8 Remove semicolons after 'if' condition
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-07 09:41:16 -05:00
Robert Baldyga
714552d300
Merge pull request #212 from liuhongtong/master-lht-casctl
utils: lengthen open-cas service timeout
2020-01-07 09:47:43 +01:00
Robert Baldyga
ee88cafc26 tests: Add test for CAS startup on reboot
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-07 09:43:55 +01:00
Michal Rakowski
8180736c67
Merge pull request #263 from robertbaldyga/tests-update-tf-plugins
tests: Update TF - plugins
2020-01-07 09:09:17 +01:00
Robert Baldyga
a38f76d28a tests: Update TF - plugins
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-07 08:59:00 +01:00
Robert Baldyga
74c9fcd01b
Merge pull request #239 from Ostrokrzew/security
Add security test
2020-01-04 11:12:32 +01:00
Robert Baldyga
d53c7bac78
Merge pull request #231 from mmichal10/ioclt-interrupt
Ioctl interrupt
2020-01-04 10:50:03 +01:00
Ostrokrzew
154fb6567f Add security test
Check if non-root user can change OpenCAS service status by casctl.
Check if non-root user can use casadm.

Signed-off-by: Ostrokrzew <slawomir.jankowski@intel.com>
2020-01-03 08:45:12 +01:00
Michal Mielewczyk
9a42ad730b Update OCF
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
2449ab0b17 Add extended error message to casadm.
If waiting for the operation to finish was interrupted, casadm should print
informative error message.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
36e34b5a69 Don't try to restore cache after stop error.
In current OCF cache stop implemetation no error should occur, so there is no
need to handle it in adapter.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
232f13a8a4 Allow to interrupt cache init, load and stop.
When device used as cache had a big size, it took a lot of time to initialize.
If user would interrupt waiting, asyc OCF init procedure would continue, but
after finish, there was nobody to perfrom kernel part of start nor error
handling.

Now error handling and kernel part of start procedure are moved to completion.
If user will interrupt waiting at any point, newly started cache instance will
be stopped.

Since cache init and load vary only with check for old metadata and initializing
exported objects, they are now merged into one function.

Async cache stop is part of this commit because it was needed for rollback path.

Load, init and stop have common context, because in case of non interrupted
attach CAS needs to wait for rollback to be completed. Common context makes
passing `struct completion` easier between load, init and stop.

This commit is part of patch that will allow to interrupt waiting for OCF
operations.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
0b5ed3f00b Allow flush operations to be interrupted.
When context was allocated on the stack and waiting for completion was
interrupted, completion function would attempt to save flush result in
memory which might in use by other process. This would cause a system crash.

To prevent such scenario, context is allocated dynamiclly and extended with
reference counter. In case of interrupt, completion function doesn't have to
save result in context, it can simply free it's memory.

This commit also enables possibility to interrupt regular flush properly, by
seding SIGING to casadm.

This commit is part of patch that will allow to interrupt waiting for OCF
operations.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
b7f1dd69a9 Allow waiting for metadata flush to be interrupted.
When context was allocated on the stack and waiting for completion was
interrupted, completion function would attempt to save flush result in
memory which might in use by other process. This would cause a system crash.

To prevent such scenario, context is allocated dynamiclly and extended with
reference counter. In case of interrupt, completion function doesn't have to
save result in context, it can simply free it's memory.

This commit is part of patch that will allow to interrupt waiting for OCF
operations.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
de823b15fc Allow cache r&w locks to be interrupted.
When context was allocated on the stack and waiting for completion was
interrupted, completion function would attempt to save lock/unlock result in
memory which might in use by other process. This would cause a system crash.

To prevent such scenario, context is allocated dynamiclly and extended with
reference counter. In case of interrupt, completion function doesn't have to
save result in context, it can simply free it's memory.

This commit is part of patch that will allow to interrupt waiting for OCF
operations.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
7af5d296e1 New error code for interrupted waiting.
This commit is part of patch that will allow to interrupt waiting for OCF
operation.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
f7d88c4b3f Don't allow core add, remove nor detach interruptions
They are usually not time comsuming operations, so risk of hung task is low.
So it's easier to temporarily disable interrupts instead of properly handle
async completion.

This commit is part of patch that will handle interrupt of waiting for OCF
operations.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
2ac8214379 Don't allow probe interruption.
Usually metadata probe is non time consuming. To avoid dealing with
synchronization problems, noninterruptible wait is performed.

This commit is part of patch that will handle interrupt of waiting for OCF
operations.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 18:34:30 -05:00
Michal Mielewczyk
d483951ebe Free thread memory after it is stopped.
After marking thread as ready to stop, CAS was waiting this for thread to exit
out of main execution loop (in _cas_io_queue_thread()). In case of management
queue it lead to deadlock because both stoping queue and main execution loop was
performed in the same execution context.

Since freeing memory is the only operation after stopping thread, it can be
moved just after the main thread loop. After this little reordering,
synchronising between _cas_stop_thread() and _cas_io_queue_thread() in no longer
needed, and no deadlock will occur.

This change is needed to put management qeueue from completion context. Without
this cachnge, there will be no possiblitiy to stop cache from completion context
and to make rollback.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 09:22:13 -05:00
Michal Mielewczyk
3eda503095 Additional null check when starting cache instance
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 09:22:13 -05:00
Michal Mielewczyk
49c87c9527 Fix legacy error messages.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-01-02 09:22:13 -05:00
Daniel Madej
0d663a37f1
Merge pull request #230 from Ostrokrzew/init2
Cache configuration load - every mode - 1 cache 1 or 4 cores
2020-01-02 13:03:46 +01:00
Jan Musial
cefd12edc5 utils: lengthen settle timeout in open-cas service
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-02 09:35:33 +01:00
Ostrokrzew
e2ad1a47f3 Add initialize tests
Verify that cache loading works properly with extra params - every mode - 1 cache and 1 or 4 cores.
Verify that cache loading works properly with no extra params - every mode - 1 cache and 1 or 4 cores.
Verify that cache loading works properly with different extra params - every mode - 1 cache and 1 or 4 cores.

Signed-off-by: Ostrokrzew <ostrokrzew@protonmail.com>
2020-01-02 08:58:06 +01:00
Robert Baldyga
8676dd2384
Merge pull request #197 from Ostrokrzew/last
Add fault injection tests and update stress tests file
2019-12-30 18:58:23 +01:00
Daniel Madej
b1bd3578db
Merge pull request #223 from mariuszbarczak/introducing-new-io-class-caching-rule-file-name-prefix
Introducing a new IO class caching rule - file name prefix
2019-12-30 10:57:47 +01:00
Robert Baldyga
7f86961447 tests: Add test for classification by file name prefix
Signed-off-by: Mariusz Barczak <mariusz.barczak@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-12-27 14:09:15 +01:00
Mariusz Barczak
7facb1e926 Introducing a new IO class caching rule - file name prefix
Signed-off-by: Mariusz Barczak <mariusz.barczak@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-12-27 14:08:32 +01:00
Robert Baldyga
9286c0eae7
Merge pull request #168 from Deixx/effective-ioclass
Test for determining effective io class
2019-12-27 12:24:35 +01:00
Adam Rutkowski
d836a054a7
Merge pull request #249 from micrakow/atomic_fix
atomic: move setting up context before sub io allocation
2019-12-23 17:48:19 +01:00
Daniel Madej
02e19e466c Test for determining effective io class
Signed-off-by: Daniel Madej <daniel.madej@intel.com>
2019-12-23 13:51:09 +01:00
Slawomir_Jankowski
40c91426ba Add fault injection tests
Try load cache with core device already mounted.
OpenCAS prevents stop when partition is mounted.
Check if used in one CAS instance core device can be added to second CAS instance.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-12-23 12:00:38 +01:00
Slawomir_Jankowski
4c77a7a4ff Test update
Update test after separating functions from this test to other files.
Add 'dut_config' to .gitignore.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-12-23 12:00:38 +01:00
Sławomir Jankowski
8356174d80
Merge pull request #236 from rafalste/tests_cache_mode_switching
Add tests for dynamic cache mode switching
2019-12-23 11:59:49 +01:00
Ostrokrzew
b6028a8787 Minor fixes in CAS API
Add casting to int in few cleaning policy params.
Fix few typos.
Add equation overload in cleaning policy params' classes.

Signed-off-by: Ostrokrzew <ostrokrzew@protonmail.com>
2019-12-23 11:47:13 +01:00
Michal Rakowski
33ad073dfd atomic: use proper step_size in sub io allocation
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-12-23 11:11:08 +01:00
Rafal Stefanowski
d0f19af99a Add tests for dynamic cache mode switching
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2019-12-20 16:38:10 +01:00
Jan Musiał
662129aa40
Merge pull request #226 from katlapinka/incremental-load-tests
Add incremental load tests
2019-12-20 13:30:55 +01:00
Katarzyna Łapińska
e6135fcd5e
Merge pull request #234 from katlapinka/corepool-tests
Add incremental load tests with core pool
2019-12-20 11:01:09 +01:00
Katarzyna Lapinska
844411864f Add incremental load tests with core pool 2019-12-20 10:13:25 +01:00
Michal Rakowski
135863e744
Merge pull request #235 from katlapinka/add-detached-core
Enable try-add method in CAS test-framework API
2019-12-20 09:54:03 +01:00
Michal Rakowski
a62458808d
Merge pull request #247 from robertbaldyga/ocf-fix-null-ptr-def-in-cleaner
Update OCF: Fix NULL pointer dereference in cleaner
2019-12-19 18:08:12 +01:00
Robert Baldyga
6a1d31cc04 Update OCF: Fix NULL pointer dereference in cleaner
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-12-19 17:05:31 +01:00