Commit Graph

80 Commits

Author SHA1 Message Date
Adam Rutkowski
91866a4efe statistics error handling in standby mode
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-03-29 23:04:34 +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
Michal Mielewczyk
c11e80d085 casadm: more informative logging on standby detach
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-24 10:46:30 +01:00
Michal Mielewczyk
5c8f9a0d8f casadm: more informative logging on activate
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-24 10:46:30 +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
Michal Mielewczyk
637484f88f casadm: initialize variable
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-21 07:26:03 +01:00
Michal Mielewczyk
a628833ae1 casadm: list cache exp obj only when it exists
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2022-03-03 10:10:32 +01:00
Krzysztof Majzerowicz-Jaszcz
72b67aefdd Fix for casadm output when listing detached cache
Fix for issue #1020 - make casadm produce a meaningful output when
listing a detached cache

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2022-02-25 16:39:25 +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
Piotr Debski
038631af2a fix for issue 1021
cache device path for standby mode in Try `casadm --help | -H' for more information.

Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-01-30 02:52:32 +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
Adam Rutkowski
8f53682954 extended error messages in casadm --failover-activate
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-12-01 00:58:09 +01:00
Michal Mielewczyk
3d8d5c2e99 casadm: fix memory leak
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-26 12:32: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
ajrutkow
5a5bf31e04 whitelist drbd device
Signed-off-by: ajrutkow <adam.j.rutkowski@intel.com>
2021-10-08 15:20:52 +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
17aa424319 Introduce cache bind operation
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-09-10 08:56:54 +02:00
Michal Mielewczyk
ba8d49d6be casadm: fix typo in an error message
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-08-20 10:24:27 +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
a98473afac Better detect if the same device is being added twice
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-07-28 15:49:46 +02:00
Robert Baldyga
3b0236aca9 Fix error message when removing unplugged cache
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-07-28 15:22:35 +02:00
Adam Rutkowski
7aa883dbd3 OCF update (removed configurable eviction policy)
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-06-21 22:56:51 +02:00
Michal Mielewczyk
4e680bb50a Reorganize remove-inacitve command
Don't remove inactive core if it has dirt cache lines assigned unless `force`
flag is specified.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-04-12 13:48:28 +02:00
Michal Mielewczyk
083d6fe93e Clean-up 'remove-core' command
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-04-09 19:57:07 +02:00
Slawomir Jankowski
6ea3dcbd65 Allow to add special deviced as cores to the cache
Add below devices to whitelist:
* CAS device partitions - fix,
* RAM devices - new,
* null block devices - new.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-04-08 21:59:33 +02:00
Adam Rutkowski
048f25379b Check dirty status in case of metadata mismatch
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-04-06 15:37:44 -05:00
Slawomir Jankowski
2514f5fa5b Add "remove inactive" command to casadm
Add `remove_inactive_core` function to casadm's code
to handle `remove inactive` command.
Print messages based on errors returned when command fails.
Add documentation comment to new function.
Add CLI part of introduced command.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-03-10 14:39:07 +01:00
Slawomir Jankowski
2bf6e42dea Print separate messages for different "remove core" return codes
Change extended error message for `KCAS_ERR_REMOVED_DIRTY`.
Print informative messages when `remove core` command fails.
Make separate error messages for detaching.
Update help printouts.
Update documentation comments.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-03-10 14:26:09 +01:00
Michal Mielewczyk
ffaaaa0a34 casadm: don't cast a float to an int explicitly
If an underflowed float number was casted to an int explicitly, it's value was
rounded to a lower value.

Using `round()` function ensures that the number will be always rounded to a
nearest integer.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-01-29 09:25:16 -05:00
Adam Rutkowski
4c98949cac Add force option to zero-metadata
Force option is used to enforce metadata erasure despite
dirty data, metadata mistmatch and/or dirty shutdown.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 15:50:17 -06:00
Adam Rutkowski
68b68db9c0 Zero metadata if on-disk version differs from current
Kernel adapter now returns is_cache_device=1 and newly added
metadata_compatible=0 in case of metadata detected with
differing version (instead of is_cache_device = 0).

This allows zero-superblock command to recognize old
cache instance and clear it.

casadm --script --check-cache-device still returns 'Is cache'='no'
in this case, as this layer only cares about metadata in current
version to be able to detect dirty datas tatus.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 14:47:54 -06:00
Robert Baldyga
63eb23ba40
Merge pull request #648 from rafalste/update_copyright
Update copyright statements (2021)
2021-01-21 13:27:51 +01:00
Adam Rutkowski
2b739d1165 Check exclusive device access before probing metadata
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 14:03:36 -06:00
Adam Rutkowski
5f65d93a36 Replace cache started check with exclusive open in zero superblock.
This check covers the previous case (cache started) as well as
other potential incorrect usages of the command. Also now
the check is made exactly at the moment of opening the
device to write to.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 14:03:36 -06:00
Adam Rutkowski
1fcb175fee Fix probing cache device in casadm
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 14:03:36 -06:00
Adam Rutkowski
1fb5fd9662 Verify whether input device path is actually a block device
This applies to add/momove core, start/stop cache, zero superblock
commands.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 14:03:36 -06:00
Slawomir Jankowski
5f5c150c30 Add comment about calling only after normalizing path
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-01-21 14:03:36 -06:00
Slawomir Jankowski
636e083e22 Remove unneccesary variable
Remove unused `buff` from `print_slow_atomic_cache_start_info()`

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-01-21 14:03:36 -06:00
Slawomir Jankowski
035ed3e7f9 Fix listing caches with path outside /dev/disk/by-id
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-01-21 14:03:26 -06:00
Rafal Stefanowski
43f43068ad Update copyright statements (2021)
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-01-21 13:15:38 +01:00
Slawomir Jankowski
3df6305254 Change strnlen to sizeof in set_device_path()
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-01-20 14:14:29 +01:00
Robert Baldyga
cbc1de7a37
Merge pull request #614 from Ostrokrzew/message
Move message about by-id path higher
2021-01-08 12:25:36 +01:00
Slawomir Jankowski
fb8fb63f06 Add path sanitizing
to `print_slow_atomic_cache_start_info` after removing check from lower
function `_check_cache_device`.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-01-08 11:45:52 +01:00
Michal Mielewczyk
92ab19999e casadm: prevent acccess to uninitialized variables
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-01-05 09:54:17 -05:00
Slawomir Jankowski
be87b59303 Move message about by-id path higher
Not every usage of `set_device_path()` needs to print message.
Sometimes it's internal operation and can contain misleading info.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-01-05 14:40:35 +01:00
Adam Rutkowski
6d1af42478 More meaningful error messages around by-id path
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-12-31 12:24:03 +01:00
Robert Baldyga
309b674fd8
Merge pull request #535 from Ostrokrzew/by-id
Disallow to use other than by-id path to core or cache device
2020-12-23 14:38:07 +01:00