lvm2.git
9 months agolvcreate: accept lockopt option 1670143193
David Teigland [Thu, 13 Feb 2025 17:36:54 +0000 (11:36 -0600)]
lvcreate: accept lockopt option

The redundant lvcreate.c implementation of accepted options needs
to be removed.

9 months agotest: improve for use with older systems 1669332258
Zdenek Kabelac [Thu, 13 Feb 2025 09:50:23 +0000 (10:50 +0100)]
test: improve for use with older systems

Improve test, so it's also working on systems without delay_dev
and test is actually more 'race' resistant.

9 months agoraid: remove struct overlap with possible_takeover
Zdenek Kabelac [Wed, 12 Feb 2025 23:12:41 +0000 (00:12 +0100)]
raid: remove struct overlap with possible_takeover

After reorganizing elements in `possible_takeover_reshape_type`
(in commit 5b92ce741f6bcb9b3d3c19c0fc13b972f950c560),
it became apparent that the code relied on struct overlap,
which is somewhat unsafe. This commit removes it and ensures
proper `const` qualification for the struct usage.

9 months agolvmlockd: lockd_vg return value cleanup 1668155952
David Teigland [Tue, 11 Feb 2025 21:32:51 +0000 (15:32 -0600)]
lvmlockd: lockd_vg return value cleanup

9 months agolcov: ignore some errors 1667775074
Zdenek Kabelac [Wed, 12 Feb 2025 13:52:09 +0000 (14:52 +0100)]
lcov: ignore some errors

While building lcov files - ignore errors from 'negative' counter
(perhaps we can use -fprofile-update=atomic - but it would be another
slowdown of test runs)

Also ignore unexecuted blocks warnings with 'gcov'.

Failure of lcov goal is not supposed to error whole make build.

9 months agocleanup: match prototype
Zdenek Kabelac [Tue, 11 Feb 2025 10:28:26 +0000 (11:28 +0100)]
cleanup: match prototype

9 months agocleanup: use full source path to header
Zdenek Kabelac [Tue, 11 Feb 2025 13:25:47 +0000 (14:25 +0100)]
cleanup: use full source path to header

9 months agotest: handle lvmpolling case
Zdenek Kabelac [Wed, 12 Feb 2025 14:10:37 +0000 (15:10 +0100)]
test: handle lvmpolling case

When test runs with lvmpolld - we cannot check
messages from pvmove - as those are visible through
output of lvmpolld - so just skip this and
only check LVs are in expected state.

9 months agocoverity: cleanup model code
Zdenek Kabelac [Tue, 11 Feb 2025 16:31:09 +0000 (17:31 +0100)]
coverity: cleanup model code

9 months agogcc: better structure padding
Zdenek Kabelac [Tue, 11 Feb 2025 14:41:12 +0000 (15:41 +0100)]
gcc: better structure padding

Since we use '.option' to assign struct member - just suffle
structure element for better padding.

9 months agogcc: fabsf float based operation
Zdenek Kabelac [Wed, 19 Jul 2017 22:54:46 +0000 (00:54 +0200)]
gcc: fabsf float based operation

Use 'float' version of 'fabs()' to compare floats.

9 months agoclang: just use regular final else
Zdenek Kabelac [Tue, 11 Feb 2025 12:18:42 +0000 (13:18 +0100)]
clang: just use regular final else

There is no need to compare, so just keep 'if' part as the comment.

9 months agosanlock: more variable structure part to the end
Zdenek Kabelac [Tue, 11 Feb 2025 12:17:34 +0000 (13:17 +0100)]
sanlock: more variable structure part to the end

Move variable part so there is no need to use 'gnu' compiler extension.

9 months agomirror: make sure 0 is not clz arg
Zdenek Kabelac [Tue, 11 Feb 2025 13:26:26 +0000 (14:26 +0100)]
mirror: make sure 0 is not clz arg

Just make sure there will be never ever used '0'
as parameter for clz().

9 months agolvmcmdline: fix printed error messages
Zdenek Kabelac [Tue, 11 Feb 2025 12:19:33 +0000 (13:19 +0100)]
lvmcmdline: fix printed error messages

Since long_opt was changed to char[], we were only comparing pointers
that always exist, whereas the original intention of the test was
to verify the presence of a string
(i.e., checking that the first byte is not \0).

9 months agoraidintegrity: support removal of partial images 1664371337
David Teigland [Fri, 7 Feb 2025 18:32:26 +0000 (12:32 -0600)]
raidintegrity: support removal of partial images

vgreduce --removemissing --force replaces a partial image
with an error target.  When that image includes an integrity
layer, that layer needs to first be removed.

9 months agoWHATS_NEW: update 1663563867
Zdenek Kabelac [Sun, 9 Feb 2025 21:34:05 +0000 (22:34 +0100)]
WHATS_NEW: update

9 months agotest: aux gives more time for lvmdbusd start
Zdenek Kabelac [Mon, 10 Feb 2025 10:25:58 +0000 (11:25 +0100)]
test: aux gives more time for lvmdbusd start

Try 20s delay to see whether dbus service will be alive...

9 months agotest: split mirror with opened leg
Zdenek Kabelac [Sun, 9 Feb 2025 18:45:39 +0000 (19:45 +0100)]
test: split mirror with opened leg

9 months agotest: check layout for error and zero
Zdenek Kabelac [Sun, 9 Feb 2025 00:25:32 +0000 (01:25 +0100)]
test: check layout for error and zero

9 months agotest: pvmove with open temporary volumes
Zdenek Kabelac [Sat, 8 Feb 2025 21:52:52 +0000 (22:52 +0100)]
test: pvmove with open temporary volumes

Test pvmove logic when various pvmove mirror volumes are opened
while pvmove is finishing.

9 months agogcc: compare same signedness
Zdenek Kabelac [Sun, 9 Feb 2025 21:06:30 +0000 (22:06 +0100)]
gcc: compare same signedness

9 months agovdo: correctly size string array
Zdenek Kabelac [Sun, 9 Feb 2025 20:59:34 +0000 (21:59 +0100)]
vdo: correctly size string array

Fix logging of VDO configuration info message which has acutally
printed " and," using next element..
Increase the array element size so it can store >=5 bytes
for " and" + \0.

9 months agomirror: splitting handles opened devices
Zdenek Kabelac [Sun, 9 Feb 2025 18:38:43 +0000 (19:38 +0100)]
mirror: splitting handles opened devices

Similar to the pvmove update, enhance error path handling
for scenarios where legs or logs remain open and cannot be
closed during the splitting of a mirror image.

Remove the now obsolete _delete_lv() function,
as it will no longer be needed.

9 months agomirror: move status bit masking
Zdenek Kabelac [Sun, 9 Feb 2025 15:05:52 +0000 (16:05 +0100)]
mirror: move status bit masking

Use bit masking in replace_lv_with_error_segment().

9 months agodebug: update message for pvmove
Zdenek Kabelac [Sat, 8 Feb 2025 21:37:47 +0000 (22:37 +0100)]
debug: update message for pvmove

Add some more consistency to message printed for pvmove.

9 months agodebug: use more similar skipping messages
Zdenek Kabelac [Sat, 8 Feb 2025 09:49:54 +0000 (10:49 +0100)]
debug: use more similar skipping messages

9 months agodebug: reinitialize debug pid after fork
Zdenek Kabelac [Sat, 8 Feb 2025 09:43:14 +0000 (10:43 +0100)]
debug: reinitialize debug pid after fork

9 months agolv_manip: print layout for error and zero
Zdenek Kabelac [Sun, 9 Feb 2025 00:16:17 +0000 (01:16 +0100)]
lv_manip: print layout for error and zero

9 months agomirror: enhance error path for pvmove finish
Zdenek Kabelac [Sat, 8 Feb 2025 20:51:09 +0000 (21:51 +0100)]
mirror: enhance error path for pvmove finish

When the pvmove operation is completing, it attempts to deactivate
the temporary mirror and remove its mirror legs. However,
if an external tool holds these volumes open, the operation would
previously abort entirely, leaving the LVM2 metadata in a partially
unusable state that required manual administrative fixes.

To improve this, the code has been enhanced to handle such scenarios
more gracefully. It will now complete the pvmove operation even
if some volumes cannot be deactivated, marking them in the metadata
with an error segment. While the command will report errors,
the metadata will remain in a usable state. The administrator
can then remove the orphaned volumes when they are no longer in use.

9 months agodevices file: fix backup limit 1658000880
David Teigland [Thu, 6 Feb 2025 02:40:59 +0000 (20:40 -0600)]
devices file: fix backup limit

Fix the code that limited the total number of backup files.
It failed, and left excess files, when the file version
number was greated than 9999, exceeding the four digit suffix.

Now, after version 9999, the suffix intentionally grows beyond
four digits as needed, and is not a fixed width, or zero padded.

9 months agolvmlockd: correct prototype for sanlock-less build 1652912328
Zdenek Kabelac [Mon, 3 Feb 2025 09:45:09 +0000 (10:45 +0100)]
lvmlockd: correct prototype for sanlock-less build

9 months agolvmlockd: compilation fixes 1652245956
Zdenek Kabelac [Sun, 2 Feb 2025 19:06:10 +0000 (20:06 +0100)]
lvmlockd: compilation fixes

9 months agogcc: std=c11 for test suite as well
Zdenek Kabelac [Fri, 31 Jan 2025 15:01:09 +0000 (16:01 +0100)]
gcc: std=c11 for test suite as well

9 months agodebug: missed stack tracing
Zdenek Kabelac [Fri, 31 Jan 2025 20:50:19 +0000 (21:50 +0100)]
debug: missed stack tracing

9 months agoraid: refactor code to _raid_leg_degraded
Zdenek Kabelac [Sun, 2 Feb 2025 11:11:04 +0000 (12:11 +0100)]
raid: refactor code to _raid_leg_degraded

Move common code into _raid_leg_degraded().

10 months agolvmlockd: fix free_lv immediately after init_lv
David Teigland [Sat, 1 Feb 2025 00:38:39 +0000 (18:38 -0600)]
lvmlockd: fix free_lv immediately after init_lv

Fix for recent commit "lvmlockd: free resource structs for LVs"

When a vg_write() fails in lvcreate, lvmlockd sees init_lv()
followed by free_lv().  The LV lock is not acquired prior to
free_lv, and no prior resource struct exists. This wasn't being
handled.

10 months agolvmlockd: log correct name in error path 1649334055
David Teigland [Thu, 30 Jan 2025 22:37:21 +0000 (16:37 -0600)]
lvmlockd: log correct name in error path

fix for recent "lvmlockd: free resource structs for LVs"

10 months agovg_read: correct error path for DM cache update 1649108783
Zdenek Kabelac [Thu, 30 Jan 2025 18:55:21 +0000 (19:55 +0100)]
vg_read: correct error path for DM cache update

New code for updating DM cache traveled through couple destination
however in this place only 'return_0' is missing unlocking in
error path.

10 months agotests: more info from test 1648900613
Zdenek Kabelac [Thu, 30 Jan 2025 16:20:40 +0000 (17:20 +0100)]
tests: more info from test

10 months agodev-type: require 4k only for some topology attrs
Zdenek Kabelac [Thu, 30 Jan 2025 16:20:05 +0000 (17:20 +0100)]
dev-type: require 4k only for some topology attrs

Previous commit 5f71cebcbecc37b5291018da35b3efe9636bf6c3 was not
correct. 4k requirement cannot be put on attribute_offset - where
it is valid to have this only 512b aligned.
The rule might get more complicated to recognized invalid values.
For this moment however add more easier requirement - we
impose 4K restriction on minimal and optimal io size if they
are bigger then 1 sector (512B).

10 months agoWHATS_NEW: update 1648484769
Zdenek Kabelac [Thu, 23 Jan 2025 14:15:48 +0000 (15:15 +0100)]
WHATS_NEW: update

10 months agocov: annotate
Zdenek Kabelac [Tue, 28 Jan 2025 15:28:14 +0000 (16:28 +0100)]
cov: annotate

10 months agocov: ensure buffer does not underflow
Zdenek Kabelac [Tue, 28 Jan 2025 15:23:00 +0000 (16:23 +0100)]
cov: ensure buffer does not underflow

Add explicit check for having always positive value.

10 months agocov: avoid expression overflow
Zdenek Kabelac [Tue, 28 Jan 2025 15:19:11 +0000 (16:19 +0100)]
cov: avoid expression overflow

Keep max memory in MiB  (>> 20).

10 months agocov: explicitly ignore return codes
Zdenek Kabelac [Thu, 23 Jan 2025 14:45:32 +0000 (15:45 +0100)]
cov: explicitly ignore return codes

10 months agocov: add validation of FID pointer
Zdenek Kabelac [Thu, 23 Jan 2025 14:41:13 +0000 (15:41 +0100)]
cov: add validation of FID pointer

Ensure NULL theoretical NULL FID pointer is not
dereferenced.

10 months agocov: limit buffer size for sscanf
Zdenek Kabelac [Thu, 23 Jan 2025 17:25:43 +0000 (18:25 +0100)]
cov: limit buffer size for sscanf

Limit sscanf parser buffer width for string.

10 months agocov: use bigger buffer
Zdenek Kabelac [Thu, 23 Jan 2025 15:22:25 +0000 (16:22 +0100)]
cov: use bigger buffer

Since pvck's  _check_vgname_start is actually checking
up-to (NAME_LEN + 2) bytes  (130),
use at least this size for (MAX_LINE_CHECK + 3).

10 months agocov: limit log levels to 7
Zdenek Kabelac [Thu, 23 Jan 2025 15:19:10 +0000 (16:19 +0100)]
cov: limit log levels to 7

lvm2 is using 7 levels for logging.
(Which might be already probably too much...)

10 months agocov: add sscanf width specifiers for lvmlockctl
Zdenek Kabelac [Tue, 28 Jan 2025 16:12:27 +0000 (17:12 +0100)]
cov: add sscanf width specifiers for lvmlockctl

10 months agocov: add space for string 0
Zdenek Kabelac [Thu, 23 Jan 2025 15:04:05 +0000 (16:04 +0100)]
cov: add space for string 0

Sscan may automatically add 0 after field width mark,
and since it's not exactlu trivial to do a macro calculation
for PATH_MAX - 1, rather make buffer for sscanf results bigger.

Also use matching FSTYPE_MAX as field width specifier.

10 months agocov: add extra byte for 0
Zdenek Kabelac [Thu, 23 Jan 2025 14:50:54 +0000 (15:50 +0100)]
cov: add extra byte for 0

Since we use 'DM_NAME_LEN' size for sscanf - it may need to store
extra string 0, which is added automatically after 'maximum field
width' specifier.

10 months agogcc: updates for use with std=c11
Zdenek Kabelac [Tue, 28 Jan 2025 14:53:09 +0000 (15:53 +0100)]
gcc: updates for use with std=c11

Let gcc -std=c11 pass...
Useful i.e. to get working Coverity scan ATM.
(as gcc15 and stdbool changes makes it problematic.)

10 months agodebug: drop double '/' in created pathname
Zdenek Kabelac [Mon, 20 Jan 2025 13:08:20 +0000 (14:08 +0100)]
debug: drop double '/' in created pathname

Our cmd->dev_dir already has '/dev/' so do not use '/dev//devname'.

10 months agotests: update topology test
Zdenek Kabelac [Wed, 29 Jan 2025 15:47:58 +0000 (16:47 +0100)]
tests: update topology test

Check lvm2 create usable VG for optimal_io_size 16776704
(which is not divisible by 4KiB).

10 months agodev-types: ignore non-4K divisible topology values
Zdenek Kabelac [Wed, 29 Jan 2025 14:12:59 +0000 (15:12 +0100)]
dev-types: ignore non-4K divisible topology values

When topology value is bigger then 1 sector (512b)
we require 4K divisibility for them.

10 months agoconfig: check for 0 from read
Zdenek Kabelac [Tue, 28 Jan 2025 23:00:23 +0000 (00:00 +0100)]
config: check for 0 from read

When the read returns 0, it could mean the file
was trimmed or some other type of problem.
In this case abort the potentially endless loop.

10 months agovg_read: matching missed empty cache
Zdenek Kabelac [Thu, 23 Jan 2025 13:32:39 +0000 (14:32 +0100)]
vg_read: matching missed empty cache

lvm2 is caching DM nodes with the use of DM_LIST_DEVICES ioctl().
And tried to preserve the cached structure for the same list,
however there was 1 case where cache was empty, and new LIST ioctl
returned some elements - if this DM table change has happened
in the moment of 'scanning' and locking -  lvm2 has then continued
to use 'invalid' empty cache.

Fix by capturing this missed case and update cache properly.

TODO: we could possibly use plain memcmp() with previous ioctl result.

10 months agovg_read: rescanning DM cache after taking lock
Zdenek Kabelac [Tue, 28 Jan 2025 11:45:39 +0000 (12:45 +0100)]
vg_read: rescanning DM cache after taking lock

Since we started to use DM cache now also for basic checks
whether the DM devices is present in DM table, this cache
now needs to be actually refreshed when the LOCK is taken.
This hiddenly happend if there was enabled 'scan_lvs' however
still not at the right place.

Move this explicit cache update call right after the moment
vg_read grabs the lock.

TODO: in the optimal case, we should mark the 'cache invalid'
and later refresh this cache, when the first reader appears,
but since this would be large patch, do this little fix step patch
first and improve performance later.

10 months agolvmlockd: fix thin locking case for cow snapshot 1647658447
David Teigland [Thu, 30 Jan 2025 00:10:00 +0000 (18:10 -0600)]
lvmlockd: fix thin locking case for cow snapshot

The case of lvcreate creating a cow snapshot of a thin volume was
caught by the sanity check for any missed instances of thin locking.

10 months agolvmlockd: free resource structs for LVs 1638754456
David Teigland [Thu, 23 Jan 2025 21:57:46 +0000 (15:57 -0600)]
lvmlockd: free resource structs for LVs

Once created, resource structs for LVs were never being freed.
If LVs are activated, then later removed or never used again,
the unused structs waste memory and cause the resource list
to grow.

10 months agolvmlockd: thin locking improvements 1630435831
David Teigland [Tue, 14 Jan 2025 16:29:34 +0000 (10:29 -0600)]
lvmlockd: thin locking improvements

There was a lot of messy and inefficient locking calls sent from
a command to lvmlockd when working with thin volumes, e.g.
- requesting a lock numerous times that was already held
- releasing a lock numerous times that was already unlocked
- repeating lock/unlock/lock/unlock rather than holding the
  lock until it was no longer needed

Mistakes in the locking could easily hide among all the noise.

The mess was largely because thin-related commands involve a
lot of internal LV manipulations, and lvmlockd calls were done
at the lower level of LV activation/deactivation.  This change
adds locking code that is more specific to the thin command
being run, so it can be more intelligent in acquiring and
releasing locks where needed.

10 months agolvmlockd: debug log message improvements
David Teigland [Fri, 17 Jan 2025 20:01:17 +0000 (14:01 -0600)]
lvmlockd: debug log message improvements

10 months agolvmlockd: reject bogus lease offset values
David Teigland [Fri, 17 Jan 2025 20:00:34 +0000 (14:00 -0600)]
lvmlockd: reject bogus lease offset values

10 months agodoc: Release Notes for 2.03.30 1625067691
Marian Csontos [Tue, 14 Jan 2025 19:57:47 +0000 (20:57 +0100)]
doc: Release Notes for 2.03.30

10 months agopost-release
Marian Csontos [Tue, 14 Jan 2025 19:55:33 +0000 (20:55 +0100)]
post-release

10 months agopre-release 2.03.30 1625067908 v2_03_30
Marian Csontos [Tue, 14 Jan 2025 19:55:33 +0000 (20:55 +0100)]
pre-release 2.03.30

10 months agoWHATS_NEW: update
Marian Csontos [Fri, 10 Jan 2025 16:19:16 +0000 (17:19 +0100)]
WHATS_NEW: update

10 months agodoc: Try to test limit of release notes
Marian Csontos [Wed, 11 Dec 2024 14:57:10 +0000 (15:57 +0100)]
doc: Try to test limit of release notes

This works with newer ikiwiki when building locally, but not on the
gitlab.

10 months agomemlock: skip locking unused libs 1617968974
Zdenek Kabelac [Thu, 9 Jan 2025 13:16:32 +0000 (14:16 +0100)]
memlock: skip locking unused libs

Skip memlocking libraries unused in critical section.

10 months agoWHATS_NEW: update 1617037414
Zdenek Kabelac [Wed, 8 Jan 2025 22:05:12 +0000 (23:05 +0100)]
WHATS_NEW: update

10 months agoconfigure: autoreconf
Zdenek Kabelac [Tue, 7 Jan 2025 14:37:29 +0000 (15:37 +0100)]
configure: autoreconf

10 months agoconfigure.ac: notify_dbus works fine with older version
Zdenek Kabelac [Tue, 7 Jan 2025 14:36:24 +0000 (15:36 +0100)]
configure.ac: notify_dbus works fine with older version

Picking version 218 for notify_dbus support - maybe older works too,
but not being tested...

10 months agoconfigure.ac: report 'none' when nvme_wwid is missing
Zdenek Kabelac [Tue, 7 Jan 2025 14:35:42 +0000 (15:35 +0100)]
configure.ac: report 'none' when nvme_wwid is missing

10 months agocov: check syscall
Zdenek Kabelac [Wed, 8 Jan 2025 23:17:54 +0000 (00:17 +0100)]
cov: check syscall

10 months agocov: just be sure nsid is defined
Zdenek Kabelac [Wed, 8 Jan 2025 23:14:33 +0000 (00:14 +0100)]
cov: just be sure nsid is defined

10 months agocov: remove unused header
Zdenek Kabelac [Wed, 8 Jan 2025 23:10:40 +0000 (00:10 +0100)]
cov: remove unused header

10 months agocov: some error path updates
Zdenek Kabelac [Tue, 7 Jan 2025 14:33:58 +0000 (15:33 +0100)]
cov: some error path updates

10 months agotests: cleanup typo
Zdenek Kabelac [Thu, 19 Dec 2024 14:43:10 +0000 (15:43 +0100)]
tests: cleanup typo

10 months agoman: fix double words
Masanari Iida [Sat, 7 Dec 2024 07:11:53 +0000 (16:11 +0900)]
man: fix double words

This patch fixes double words found in man.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
10 months agotests: test unsupported lvresize of origin vdo lv
Zdenek Kabelac [Wed, 8 Jan 2025 21:57:29 +0000 (22:57 +0100)]
tests: test unsupported lvresize of origin vdo lv

10 months agotests: check memory locking
Zdenek Kabelac [Wed, 8 Jan 2025 17:29:31 +0000 (18:29 +0100)]
tests: check memory locking

Check reserved memory and stack is able to disable mlocking.

10 months agolvresize: vdo origin resize is unsupported
Zdenek Kabelac [Wed, 8 Jan 2025 21:56:33 +0000 (22:56 +0100)]
lvresize: vdo origin resize is unsupported

Add explicit error message for not (yet) supported resize
of origin VDO volume.

10 months agolvmcmdline: memlock init after config parsing
Zdenek Kabelac [Wed, 8 Jan 2025 17:27:04 +0000 (18:27 +0100)]
lvmcmdline: memlock init after config parsing

Since we now support disabling memory locking by setting
reserved memory or stack to 0 - it would be useful if this would
work also with cmdline --config option.

TODO: rework creation and usage of cmdtool context so we avoid
several places in the code which do try to initialized something...

10 months agomemlock: check for proper reserved size
Zdenek Kabelac [Wed, 8 Jan 2025 16:48:53 +0000 (17:48 +0100)]
memlock: check for proper reserved size

Fix regression introduced with commit:
964012fdb924076e9ab97fabe00e759ddbf7c3bd
that effectively disabled memory locking before suspending volumes.
From merging/testing there remained wrong condition
as we really want to check for 0 memory reservation value
for both checked settings.

10 months agoWHATS_NEW: update 1613200875
Peter Rajnoha [Mon, 6 Jan 2025 14:35:44 +0000 (15:35 +0100)]
WHATS_NEW: update

10 months agotests: adjust lvresize-xfs tests for recent lvextend changes dev-prajnoha-lvextend-early-fsinfo
Peter Rajnoha [Fri, 3 Jan 2025 14:26:27 +0000 (15:26 +0100)]
tests: adjust lvresize-xfs tests for recent lvextend changes

Because now, we are doing the fsinfo check before extending an LV and if
that check fails, we do not proceed to the LV extension itself and the
lvextend command bails out immediatelly.

10 months agofilesystem: add new_size_bytes to struct fs_info
Peter Rajnoha [Fri, 3 Jan 2025 12:06:27 +0000 (13:06 +0100)]
filesystem: add new_size_bytes to struct fs_info

It seems we need new_size_bytes in places where struct fs_info is also
passed. Store the new_size_bytes inside the struct fs_info so we
can just pass that one to all the functions we call and hence make
the code a bit cleaner and easier to follow.

10 months agolv_manip: check fs resize is supported before LV extension
Peter Rajnoha [Fri, 3 Jan 2025 09:52:47 +0000 (10:52 +0100)]
lv_manip: check fs resize is supported before LV extension

This avoids a situation where we would extend an LV and then we would
not do anything to the FS on it because the FS info check failed for some
reason, like the type was not supported (e.g. swap) or we could not resize
the FS unless being in some supported state (e.g. XFS to be mounted for
the xfs_growfs to work).

Before this patch (LV resized, FS not resized):

❯  lvextend --fs resize -L+4M vg/swap
  Size of logical volume vg/swap changed from 32.00 MiB (8 extents) to 36.00 MiB (9 extents).
  File system extend is not supported (swap).
  File system extend error.
  Logical volume vg/swap successfully resized.

With this patch (LV not resized, FS not resized):

❯  lvextend --fs resize -L+4M vg/swap
  File system extend is not supported (swap).

11 months agoWHATS_NEW: update 1596141712
Zdenek Kabelac [Thu, 19 Dec 2024 13:57:43 +0000 (14:57 +0100)]
WHATS_NEW: update

11 months agomake: generate
Zdenek Kabelac [Thu, 19 Dec 2024 13:55:56 +0000 (14:55 +0100)]
make: generate

11 months agoargs: missed option all for vgdisplay
Zdenek Kabelac [Thu, 19 Dec 2024 13:55:25 +0000 (14:55 +0100)]
args: missed option all for vgdisplay

11 months agotests: check conversion of in-use volume
Zdenek Kabelac [Thu, 19 Dec 2024 13:50:32 +0000 (14:50 +0100)]
tests: check conversion of in-use volume

Thin-pool conversion fails early when trying to convert
volume which is in use  (simulated by sleep <)

11 months agothin: deactivate converted volume early
Zdenek Kabelac [Thu, 19 Dec 2024 13:47:16 +0000 (14:47 +0100)]
thin: deactivate converted volume early

Deactivate converted volume to pool early, so the conversion
exits early and does not leave some already created metadata
volumes that needed manual cleanup by user after command
aborted its conversion operation when the converted volume
was actually in-use  (i.e. when user tried to convert
a mounted LV into a thin-pool, 2 extra volumes needed removal).

11 months agoconfigure: autoreconf dev-dct-libnvme 1584733990
Zdenek Kabelac [Mon, 9 Dec 2024 13:35:16 +0000 (14:35 +0100)]
configure: autoreconf

11 months agoconfigure.ac: add support for libnvme
Zdenek Kabelac [Mon, 9 Dec 2024 13:33:39 +0000 (14:33 +0100)]
configure.ac: add support for libnvme

Add 2 new options for linking  libnvme with lvm2.
Option  --without-libnvme, --disable-nvme-wwid

11 months agodevice_id: nvme devices may use alternate wwids
David Teigland [Fri, 6 Dec 2024 21:02:20 +0000 (15:02 -0600)]
device_id: nvme devices may use alternate wwids

Device quirks may cause sysfs wwid file to change what it
displays, from a bogus eui... string to an nvme... string.

The old wwid may be saved in system.devices, so recognizing
the device requires finding the old value from libnvme.

After matching the old bogus value using libnvme, system.devices
is updated with the current sysfs wwid value.

11 months agodoc: Fix limit for inlined release notes 1580575289
Marian Csontos [Mon, 9 Dec 2024 16:38:52 +0000 (17:38 +0100)]
doc: Fix limit for inlined release notes

11 months agoudev: create /dev/disk/by-diskseq/<DISKSEQ> symlink for public DM devices 1580111766
Peter Rajnoha [Mon, 9 Dec 2024 12:05:03 +0000 (13:05 +0100)]
udev: create /dev/disk/by-diskseq/<DISKSEQ> symlink for public DM devices

All block devices have a disk sequence number assigned (an ever-increasing 64 bit
sequence number) since kernel v5.15 (February 2021). The number is exported through
/sys/block/<disk>/diskseq property and also as DISKSEQ udev event variable.
The diskseq helps with referencing a device throughout its existence in
race-free way.

By default, the /usr/lib/udev/rules.d/60-persistent-storage.rules set
/dev/disk/by-diskseq/<diskseq> symlink for each block device. However,
these rules do not apply for DM devices because we manage the symlinks
ourselves in 13-dm-disk.rules where it properly follows the
DM_UDEV_DISABLE_DISK_RULES flag, among other things.

Add a rule to 13-dm-disk.rules to create the /dev/disk/by-diskseq/<diskseq>.

This page took 0.087407 seconds and 5 git commands to generate.