1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

3190 Commits

Author SHA1 Message Date
David Teigland
943e979079 lvmlockd: parse lockopt string into flags 2024-06-27 13:29:03 -05:00
Heinz Mauelshagen
d01e5ec126 raid_manip: prevent reshape with freed component SubLVs
In order to free SubLVs after a stripe removing reshape, lvconvert has
to be run without layout changes.   Prevent a layout changing request
in case any such freed SubLVs exist and inform the user about the fact
requesting to release them first.
2024-06-18 14:14:24 +02:00
Zdenek Kabelac
403ecb46fa cov: annotate known use of validated lv name 2024-05-27 16:35:23 +02:00
Zdenek Kabelac
e1fd179dc5 cleanup: replace strlen with sizeof
Use the string size from compile time.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
40cf4ce1e1 cleanup: struct reorder
Better alignments.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
45c06025da cleanup: some typos
Collection of some typos or invalid uppercase or doublespace cases.
2024-05-27 15:35:57 +02:00
David Teigland
47f8bda051 lvremove: remove device_id for PVs on LVs
When PVs are created on LVs, remove the devices file entries
for the PVs when the LVs are removed.  In general, the devices
file entries should be removed with lvmdevices --deldev when
the LVs are removed (lvremove is the equivalent of detaching
a device from the system when layering PVs on LVs.)
This change is effectively an automatic lvmdevices --deldev
command that is built into lvremove when the LV has a PV on it.
2024-05-22 15:32:17 -05:00
Zdenek Kabelac
5f1c799e6a cov: enum mapping cache format
Cleanly map cache metadata format enumeration.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
5818fbfbcf cov: enum matching type 2024-05-08 01:55:21 +02:00
Zdenek Kabelac
3f41b4af55 cov: check for overlow math
Add some extre protection to avoid integer overflow type of problems.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
5c7d6083a9 cov: annotate to silent some coverity warning 2024-05-08 01:55:21 +02:00
Zdenek Kabelac
bbf352892d cov: use literal for printf
Use literal for printf and just empty string if needed.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
d7c2fe9723 cov: use literal for printf format
Prepare suffix ahead and use literal for printf().
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
61a11f25a3 cov: check for valid raid0 LV segment
Add internal error to quiet Coverity fear of NULL pointer deref.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
099a4e2146 raid: easier prompt message
Use  printf capability of 'prompt()' funtions so use literal
when building this message.
2024-05-08 01:55:21 +02:00
Zdenek Kabelac
7f25e58f66 const: array for _vdo_split 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
0bcf2c6514 const: use arrays of strings
Such string is stored directly in '.rodata' section.
2024-05-04 01:01:57 +02:00
Zdenek Kabelac
9f506eb89e const: raid takover arrays 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
64cb8b5940 const: _ops segtype handler 2024-05-04 01:01:57 +02:00
Zdenek Kabelac
effafa8fc8 const: _ops text handler
Making sure these structures ends in '.data.rel.ro' section.
(instead of plain '.data' section).
2024-05-04 01:01:42 +02:00
Zdenek Kabelac
a6f4aed3c0 vdo: enhance error path
When the conversion to VDO fails, try to restore previous VG state
and also remove orphan DM node from table.
2024-05-04 00:57:14 +02:00
Zdenek Kabelac
2a39ed7741 writecache: reuse some API
Tiny code updates, reuse dm_pool_strdup().
2024-05-01 10:55:17 +02:00
Zdenek Kabelac
3fc34ac7ee vdo: fix setting VDO size when stacked
When VDO is used as data LV for thin-pool, we need
to use correct function to propagate this through
the stack of volumes.
2024-04-26 21:37:51 +02:00
Zdenek Kabelac
ecb8399005 lvm: use configure proc dir in lvm.conf
Update some code parts to use configurer /proc from lvm.conf
(so i.e. our testing can use some fake values)
2024-04-15 13:38:44 +02:00
Zdenek Kabelac
3ce83f923d cov: extra pointer validation
Add few more internal errors to enusure there is no use of NULL pointers
along the code path.
2024-04-10 00:03:09 +02:00
Zdenek Kabelac
2fdf3b137a thin-pool: avoid reactivation on new thin-pool
Shortens processing of 'lvcreate -L -V -T' command and
avoid deactivation and its activation with thin_check of the empty
created thin-pool that will be used for the new thin volume
made with a single lvcreate command.
2024-04-07 20:38:55 +02:00
Zdenek Kabelac
203c8b3997 vdo: fix status message parsing
When using message API for parsing VDO stats info, 0 was wrongly
used for fallback for trying the old sysfs API.

Switch to use  ULLONG_MAX for values that could not have been obtained
through the message call.

Fixes lvdisplay info for freshly created VDO volume with 0 used data
blocks.
2024-04-05 13:09:10 +02:00
Zdenek Kabelac
f9fefaaabe refactor: update dm_strncpy to _dm_strncpy
For checked versions of dm_strncpy use inline wrapper _dm_strncpy.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
995ff58903 refactor: remove (void) from dm_strncpy usage
Start to use dm_strncpy() as unchecked version within source tree.
2024-04-04 19:38:21 +02:00
Zdenek Kabelac
fc477192e5 cleanup: drop unused code
Code was related to long time obsoleted  vgconvert
for lvm1 to lvm2 conversion.
This code likely was missed to be removed.
2024-03-28 18:18:37 +01:00
Zdenek Kabelac
0dbd90d74e gcc: match signed integers 2024-03-27 01:11:00 +01:00
Zdenek Kabelac
a0776fe409 thin: remove stack external origins
Ensure external origin is deactivated during removal.
Only unused external origins can be deactivated.
2024-03-17 13:17:53 +01:00
Zdenek Kabelac
edc91caffb thin: external origins across thin-pool
Fix/support creation and usage of the external origin
across thin-pools - so thin LV can use thin LV from
some other thin-pool as external origin (read-only).
2024-03-16 10:40:54 +01:00
Zdenek Kabelac
27bdd038a8 thin: validate usable volume for external origin
When creating external origin via 'lvcreate --type thin'
add the validation for LV being usable as external origin
since certain LVs cannot be really used this way.
Also call this function early during lvcreate cmdline arg
validation se we do not need to do unecesary operation.
2024-03-16 10:40:54 +01:00
Zdenek Kabelac
55937f9c8e vdo: read VDO stats via dm message
As the sysfs interface is seen somewhat obsolete, swith code
to prefer using DM 'stats' message to get our currently needed
info for VDO pool target.
2024-02-19 14:20:39 +01:00
Zdenek Kabelac
5533f034e2 thin_pool: correct refactoring chunk_size
Function to recalc chunk_size according to dev hints needs to be
used after chunk_size is being set to thin pool segment - correct
this ordering mistake introduced in previous refactoring commit.
2024-01-17 17:31:19 +01:00
Zdenek Kabelac
9d9e43b87f vdo: correct vdo header size
Previous patch that introduced support for thinpool with vdo
not correctly handled header size - as this part is not fully usable
yet.  We are going to try to use the 0, but current state of code is not
yet compliant to this logic so keep vdo_header_size during conversion
and alos correctly pass through virtual_extents to vdo formating.
2024-01-17 17:30:10 +01:00
Zdenek Kabelac
db0de73d6e vdo: support creation of compressed thin-pools
Add code to handle creation of  thin-pool with VDO data backend
which can be seen as compressed deduplicated thin-pool.

To avoid need of changing to many internal APIs, pass the conversion
parameters for create thin-pool data volume via cmd_context.
2024-01-10 14:02:22 +01:00
Zdenek Kabelac
6ec2f1f44b vdo: refactor conversion to vdo lv
Introduce struct vdo_convert_params {} to pass-in all the parameters
needed for the conversion of an LV to a vdopool + vdo LV.

Function convert_vdo_lv() is also able to create a new LV and swap
segments, so the passed in LV can be later on use for futher
conversion so this refactoring makes it ready for more enhanced
usage.
2024-01-10 14:02:22 +01:00
Zdenek Kabelac
7544b9fc10 vdo: refactor vdo_params passing
Introduce vdo_convert_params and use vdo_params from this structure
also with lvcreate_params.

Later we will use this for convertion of thin-pool data volume to VDO.
2024-01-10 14:02:22 +01:00
Zdenek Kabelac
4ccedceaa8 thin_pool: introduce --pooldatavdo
Introducing new arg --pooldatavdo y|n
2024-01-10 14:02:22 +01:00
Zdenek Kabelac
c496f80379 pool: code refactoring
Move pool related manipulation code to pool_manip.c.
2024-01-10 14:02:22 +01:00
Zdenek Kabelac
a176184b7d thin_pool: code refactoring
Move common code into thin_pool_set_params()
(just like we use  cache_set_params).
2024-01-10 14:02:22 +01:00
Zdenek Kabelac
2135bbe558 vdo: flip return value to int
Change API to return just 0/1.
2024-01-10 14:02:22 +01:00
Zdenek Kabelac
b058498404 lv: remove unused declaration 2024-01-10 14:02:22 +01:00
David Teigland
0e4fd4485f lvs: set first attr flag for raid integrity images
The first lv_attr flag is 'i' or 'I' for a raid image.
(i: raid image, I: out of sync raid image)
For integrity raid images (_iorig), the flag was not being set.
2023-11-17 13:26:23 -06:00
Zdenek Kabelac
d019c41f7a typo: update 2023-10-20 00:21:13 +02:00
Heinz Mauelshagen
e41da923a3 lvconvert: fix "lvconvert -m 0" for in-sync legs
With commit d7e922480e
lvconvert -m   may fail if we try to remove 1st. leg that
is out-of-sync while other leg is in-sync.

Hot fix allows to proceed with such down conversion.

Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
2023-10-20 00:20:15 +02:00
Zdenek Kabelac
9668d40d5a resize: reduce without prompt for no-fs case
Apply the same logic for 'lvreduce' which exists for newer
systems (compiled with HAVE_BLKID_SUBLKS_FSINFO)
also for older systems for one very common practical case where
the active LV does not have any blkid known signature/filesystem.

New variant recognized this situation and allowed to proceed
without requesting a prompt, while the older variant always
requested confirmation prompt.

With this patch command now works equily for both variants
for 'active LV' without signature and allows to reduce LV
without prompting.
2023-10-14 23:10:21 +02:00
Zdenek Kabelac
46eeb62b04 pool: fix recalculate of pool chunk_size
Before checking seg_type of the first area, check there is
some existing area.
Since we now support error and zero segtypes, these do not have
any PV area present.
2023-10-14 01:04:10 +02:00