Commit Graph

176 Commits

Author SHA1 Message Date
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
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
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
850c097e90 casadm: Error message for UUID_EXISTS error code
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-04-14 20:15:14 +02:00
Robert Baldyga
eaebdffa5b
Merge pull request #795 from robertbaldyga/fix-seq-cutoff-thresh-units
casadm: Fix seq cutoff threshold units
2021-04-12 15:06:34 +02:00
Robert Baldyga
61d704fbb9 casadm: Fix seq cutoff threshold units
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-04-12 14:22:58 +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
Michał Mielewczyk
7a3b248c35
Merge pull request #764 from mmkayPL/false_stats
Change method for calculating 'dirty_for' statistic
2021-03-31 12:23:53 +02:00
Robert Baldyga
f77e5a9b49
Merge pull request #768 from mmkayPL/fix-core-size-calculation
Change core size gb calculation to use 64bit parameter
2021-03-30 09:47:29 +02:00
Robert Baldyga
8306de7b99 casadm: Fix printing long device paths
Don't break line when first word in column is too long to fit into the
screen.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-03-29 18:35:25 +02:00
Kozlowski Mateusz
32b3c98527 Change core size gb calculation to use 64bit parameter
Fixes #766

Signed-off-by: Kozlowski Mateusz <mateusz.kozlowski@intel.com>
2021-03-29 13:27:47 +02:00
Slawomir Jankowski
584ef99143 Change time parameter type in printing
Type of `dirty_for` in structs needs to be unified.
Values stored in these fields (both in cache and core info structs)
are  unsigned 64-bits ints but `dirty_for`s were unsigned 32-bits ints
(vide changes in OCF).

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-03-26 13:46:09 +01:00
Robert Baldyga
880cfadde9 Makefile: improve uninstall error handling
Introduce helper functions to handle uninstall errors gracefully.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-03-19 15:37:55 +01:00
Robert Baldyga
feaafdfe06 Makefile: Little cleanup
Move files to components they belong to.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-03-19 15:27:03 +01:00
Michal Mielewczyk
5e035f4b52 casadm: improve error logging
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-12 14:12:02 +01:00
Michal Mielewczyk
12db6b4443 Remove redundant cache being stopped check
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-12 09:20:19 +01:00
Michal Mielewczyk
66f30dcf12 casadm: use constans for parsing seq cutoff params
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-12 09:12:45 +01: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
760b60628c Add KCAS_ERR_CORE_IN_ACTIVE_STATE error code.
New error code will allow to properly handle issues caused by wrong
usage of `remove inactive core` command.
It will also allow to print meaningful error messages.

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
35602acb8f Prohibit locking cache while its is being stopped
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-03-09 10:46:47 +01:00
Robert Baldyga
836726409a casadm: Add promotion count parameter
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-03-08 07:20:20 +01:00
Slawomir Jankowski
e35b8dd12f Fix for building OpenCAS
On some systems, e.g. Ubuntu, the order of linking `math` library is
important and when linking is done too early, openCAS making fails.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2021-02-09 10:54:11 +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
Michal Mielewczyk
6cbce57106 casadm: don't print Free entry for ioclass stats
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-01-12 05:11:09 -05: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
Robert Baldyga
2753bad018
Merge pull request #568 from mmichal10/occupancy-per-ioclass
Occupancy per ioclass
2020-12-23 14:36:02 +01:00
Michal Mielewczyk
c93d1f73ef casadm: occupancy per ioclass
Enable new ioclass config format with float allocation values

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-12-23 08:11:19 -05:00
Slawomir Jankowski
0f331cb650 casadm: Add option to print full /dev/by-id link
User can check path in runtime to use the same in config.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-12-22 16:29:06 +01:00
Slawomir Jankowski
10e5e017c1 Reject path which isn't by-id link
Check if path passed to core adding or cache starting is by-id link
otherwise do not allow to use it except it is exported object's path.
Do not resolve device's by-id path during core addition or cache starting.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-12-22 16:29:05 +01:00
Slawomir Jankowski
28b2e0610d Compare whole exported object path during core removal
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-12-17 17:38:19 +01:00
Slawomir Jankowski
6a803f0985 Add strcmp_s and strncmp_s to safe string library
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-11-26 10:35:23 +01:00
Robert Baldyga
90e588403e Blacklist /dev/disk/by-id/md-name* symlinks
This fixes startup bug when core was added to core pool by md-name*
symlink, but cache metadata contained md-uuid* path, which led to
incomplete configuration

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-10-05 15:38:21 +02:00
Robert Baldyga
bba3cbd9d8 Remove noop line causing compilation warning
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-09-17 09:46:44 +02:00
Robert Baldyga
a13287b4ff Replace deprecated ftime() with gettimeofday()
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-09-17 09:46:44 +02:00
Slawomir Jankowski
d4cd1fd4cf Add Werror compilation flag to casadm Makefile
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-08-26 16:40:36 +02:00
Slawomir Jankowski
dffadd5530 Fix previous fix
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-08-26 15:16:40 +02:00
Robert Baldyga
ecebb52b46
Merge pull request #505 from Ostrokrzew/fix
Few fixes after recent changes
2020-08-26 10:59:53 +02:00
Robert Baldyga
9283601d84
Merge pull request #500 from imjfckm/fix-core-add-message
Fix message when CAS can't open exclusively inactive core
2020-08-21 10:40:49 +02:00
Slawomir Jankowski
0d3b37b580 Fix notification about NVME device
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-08-19 15:56:12 +02:00
Jan Musial
b3fed25153 Fix message when CAS can't open exclusively inactive core
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-08-12 11:23:56 +02:00
Michal Rakowski
1cd1db2b45 Fully remove format nvme command
Since there is no kernel-kernel api available to communicate
with nvme driver it is more convenient to use some nvme-dedicated
software (e.g. nvme-cli) to manage nvme devices.
It is even not possible to format nvme device with CAS using current
implementation on newest kernels.

Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-08-11 06:10:31 -04:00
Robert Baldyga
b8cfee1883
Merge pull request #435 from rafalste/update_versioning
Version unifying
2020-07-27 18:34:46 +02:00
Slawomir Jankowski
a9a85fb01f Update use of *run_ioctl_interruptible* after changes
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-06-25 11:18:02 +02:00
Slawomir Jankowski
db35d5a299 Modify *run_ioctl_interruptible* function
Make *run_ioctl_interruptible* a wrapper for new function *run_ioctl_interruptible_retry_option*.
Make new function *run_ioctl_interruptible_retry* - a wrapper for *run_ioctl_interruptible_retry_option*.
*run_ioctl_interruptible_retry_option* is old *run_ioctl_interruptible*
function with one more parameter to decide if call *run_ioctl* or *run_ioctl_retry*.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-06-25 11:18:02 +02:00
Slawomir Jankowski
cfca19b024 Use *run_ioctl* and *run_ioctl_retry*
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-06-25 11:18:02 +02:00
Slawomir Jankowski
0d1730af37 Modify *run_ioctl* function
Make *run_ioctl* a simple wrapper for *ioctl* function.
*run_ioctl_retry* is old *run_ioctl* function.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-06-25 11:18:02 +02:00
Rafal Stefanowski
67e7f20770 Install cas_version metadata file
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-06-10 18:12:30 +02:00
Rafal Stefanowski
afa0c1b53f Modify version check flow
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-06-10 15:08:37 +02:00
Slawomir Jankowski
1b7c425fae Disable the possibility to use the 'load'
and 'force' flags at once

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-06-01 13:21:53 +02:00
Slawomir Jankowski
fe704f83cf Introduce zero-metadata command
Add function *zero_md* in *cas_lib* to handle
new command for zeroing metadata.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-05-25 10:54:53 +02:00
Slawomir Jankowski
9750883d99 Introduce zero-metadata command
Add 'zero-metadata' option to *casadm*.
Handle new option.
Add struct for new option.

Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-05-25 10:54:04 +02:00
Robert Baldyga
1e25420f86
Merge pull request #404 from rafalste/copyright_update
Update copyright statements
2020-05-19 11:25:11 +02:00
Michal Mielewczyk
3b62e40a2e Purge core command
Purge invalidates all cache lines which belongs to given core. It is very
usefull feature for tests.

Calling purge is possbile with casadm `--script` swtich.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-05-12 11:32:01 -04:00
Michal Mielewczyk
d24288a9b1 Purge cache command
Purge invalidates all cache lines. It is very usefull feature for tests.

Calling purge is possbile with casadm `--script` swtich.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2020-05-12 11:32:01 -04:00
Rafal Stefanowski
44b4020cc1 Update copyright statements
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-05-04 16:47:38 +02:00
Robert Baldyga
d694228263 Update OCF and handle new error code
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-04-06 09:03:14 +02:00
Rafal Stefanowski
0d256b675d Makefile changes for building RPM
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2020-02-11 14:47:32 +01:00
Adam Rutkowski
3c6e76aa39 Remove obsolete ext3 & ext4 io class configs
These configs use legacy syntax and serve no purpose
on standard kernels.

Fixes #261

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2020-02-11 15:25:29 -05:00
Robert Baldyga
09c367e17e casadm: Add missing error message in ioclass stats
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-21 12:33:59 +01:00
Robert Baldyga
4f51b9c1c0 casadm: Fix printing of ioclass stats
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2020-01-21 12:14:16 +01:00
Jan Musial
7e2b2877c8 Update SeCoE Safe String Library
Signed-off-by: Jan Musial <jan.musial@intel.com>
2020-01-21 10:30:29 +01:00
Ostrokrzew
bbc03abdf7 Casadm update
Add extended error message in casadm.
Add shortened code mapping for new error code.

Signed-off-by: Ostrokrzew <slawomir.jankowski@intel.com>
Signed-off-by: Slawomir Jankowski <slawomir.jankowski@intel.com>
2020-01-15 14:30:58 +01: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
Slawomir_Jankowski
d4a419dc75 Typo fix
Fix missing space in phrase.

Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
2019-11-26 16:49:45 +01:00
Michal Rakowski
31bc2d2787 casadm: fix get/set seq cutoff param
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-11-22 09:45:50 +01:00
Michal Rakowski
db8ff10cd5 casadm: add err log in case of failed param getting/setting
Signed-off-by: Michal Rakowski <michal.rakowski@intel.com>
2019-11-20 07:52:05 +01:00
Robert Baldyga
9b17135694 casadm: Unify "4KiB Blocks" string
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2019-11-12 17:17:22 +01:00
Michal Mielewczyk
af7ac1f23e casadm: add description for occupied core id error.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-10-01 09:59:26 -04:00
Michal Mielewczyk
296db39ea0 Adapt to new OCF PP param set/get API.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-10-01 06:54:32 -04:00
Michal Mielewczyk
5cb7792678 Added description for occupied core id error.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 15:36:02 -04:00
Michal Mielewczyk
919a4701a1 Added description for new error code.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 09:44:07 -04:00
Kamil Łepek
b470052bf1
Merge pull request #111 from arutk/doc_update
Documentation update
2019-09-25 14:33:29 +02:00
Kamil Łepek
145c66cdfa
Merge pull request #123 from mmichal10/fix-ioclass-printing
Fix ioclass stats printing.
2019-09-25 14:31:44 +02:00
Michal Mielewczyk
753a6d650c Fix ioclass stats printing.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-25 08:17:24 -04:00
Michal Mielewczyk
50efb1e165 Enable setting acp params.
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2019-09-24 11:41:18 -04:00
Adam Rutkowski
1b31aed691 Remove reference to flush progress in casadm -L
The functionality of displaying flush progress in caches list
was removed. Updating casadm user message to reflect this.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2019-09-23 13:31:38 -04:00
Robert Bałdyga
8f45549cc7
Merge pull request #107 from robertbaldyga/cleanup-cas-version
Cleanup cas version
2019-09-19 13:45:17 +02:00