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

19524 Commits

Author SHA1 Message Date
Zdenek Kabelac
b4af2571db tests: use put_time 2024-08-09 15:10:24 +02:00
Zdenek Kabelac
a06a49b549 tests: search for delimiter in bounded buffer 2024-08-09 15:10:24 +02:00
Zdenek Kabelac
aa75e1f0bf cov: annotate known case 2024-08-09 15:10:24 +02:00
Zdenek Kabelac
e150931fc4 cov: validate list emptiness
Emit internal error for empty list.
2024-08-09 15:10:18 +02:00
Zdenek Kabelac
d1c6da2f66 cov: validate altdev list is not empty 2024-08-09 15:10:18 +02:00
Zdenek Kabelac
22672be97d cov: check for dev_iter_create result
dev_iter_create() may fail in malloc so check
for its error code.
2024-08-09 15:10:18 +02:00
Zdenek Kabelac
76936f2832 cov: drop unused header inclusion 2024-08-09 13:20:44 +02:00
Zdenek Kabelac
426c3c7b88 cov: avoid expression overflow
Use 64bit math to multiply extent_size.
2024-08-09 13:20:44 +02:00
David Teigland
78d14a805c integrity: add --integritysettings for tuning
The option can be used in multiple ways (like --cachesettings):

--integritysettings key=val
--integritysettings 'key1=val1 key2=val2'
--integritysettings key1=val1 --integritysettings key2=val2

Use with lvcreate or lvconvert when integrity is first enabled
to configure:
journal_sectors
journal_watermark
commit_time
bitmap_flush_interval
allow_discards

Use with lvchange to configure (only while inactive):
journal_watermark
commit_time
bitmap_flush_interval
allow_discards

lvchange --integritysettings "" clears any previously configured
settings, so dm-integrity will use its own defaults.

lvs -a -o integritysettings displays configured settings.
2024-08-07 17:40:34 -05:00
David Teigland
07576f7e51 devices: fix dev_dm_uuid
If a non-dm device is passed, the dm code doesn't fail and returns
some dm uuid.
2024-08-01 11:32:56 -05:00
Peter Rajnoha
ae8d5113f4
WHATS_NEW: update 2024-07-30 10:32:25 +02:00
Peter Rajnoha
7fdba39b3f tests: add tests for autoswitching to JSON format for log messages 2024-07-24 09:50:26 +00:00
Peter Rajnoha
0e8c429e30 make: generate 2024-07-24 09:50:26 +00:00
Peter Rajnoha
14dbf6ca7b reporter: simplify checking output format setting in report_format_init 2024-07-24 09:50:26 +00:00
Peter Rajnoha
3eecdcbd64 config_settings: fix typo 2024-07-24 09:50:26 +00:00
Peter Rajnoha
8281f7c111 config: use default log/command_log_report=1 for json/json_std output format
log/command_log_report config setting defaults to 1 now if json or json_std
output format is used (either by setting report/output_format config
setting or using --reportformat cmd line arg).

This means that if we use json/json_std output format, the command log
messages are then part of the json output too, not interleaved as
unstructured text mixed with the json output.

If log/command_log_report is set explicitly in the config, then we still
respect that, no matter what output format is used currently. In this
case, users can still separate and redirect the output by using
LVM_OUT_FD, LVM_ERR_FD and LVM_REPORT_FD so that the different types
do not interleave with the json/json_std output.
2024-07-24 09:50:26 +00:00
Heinz Mauelshagen
be229b0cd1 WHATS_NEW 2024-07-19 13:28:30 +02:00
Heinz Mauelshagen
557b2850ce lv_manip: avoid unreleased memory pool(s) message on RAID extend
In case of different PV sizes in a VG, the lvm2 allocator falls short
to define extended segments resiliently asked for 100%FREE RaidLV extension
and a RAID distinct allocation check fails.  Fix is to release a memory pool
on the resulting error path.

Until the lvm2 allocator gets enhanced (WIP) to do such complex (and other)
allocations proper, a workaround is to extend a RaidLV to any free space on
its already allocated PVs by defining those PVs on the lvextend command line
then iteratively run further such lvextend commands to extend it to its
final intended size.  Mind, this may be a non-trivial extension interation.
2024-07-18 14:36:47 +02:00
Marian Csontos
c288ddd6c8 pages: Update release note tag and timestamp 2024-07-12 12:50:20 +02:00
Marian Csontos
60fbbd5f5f post-release 2024-07-12 12:42:39 +02:00
Marian Csontos
0eef5ab6e1 pre-release 2024-07-12 12:42:39 +02:00
David Teigland
f8aa073a8d Revert "dev-cache: move global variables into cmd struct"
This reverts commit 77be3250d9.
2024-07-08 15:32:41 -05:00
David Teigland
39e65c8f59 Revert "bcache: move from global variable to cmd struct"
This reverts commit 5bf4efbab5.
2024-07-08 15:32:35 -05:00
David Teigland
5bf4efbab5 bcache: move from global variable to cmd struct 2024-07-03 12:58:18 -05:00
David Teigland
77be3250d9 dev-cache: move global variables into cmd struct
The cmd struct is now required in many more functions, and
it's added as a function arg for most direct dev-cache function
calls.  The cmd struct is added to struct device (dev->cmd) so
that it can be accessed in many other cases where dev-cache
functions are being called from places where getting the cmd
struct is too difficult.
2024-07-03 11:52:32 -05:00
David Teigland
57e9083c90 config_file: remove unused code
config_file_read() is only used for regular files, not devices.
2024-07-02 16:24:12 -05:00
David Teigland
76bd678ce3 devices: isolate fake device setup for config file
Freeing dev-cache from dumb fake device usage.
2024-07-02 16:18:09 -05:00
David Teigland
92fd2cb498 devices: isolate fake dev use for mirror checks
Freeing dev-cache from dumb fake device usage.
2024-07-02 15:07:43 -05:00
Zdenek Kabelac
82d145a372 lvmlockd: fix compilation with disabled lvmlockd
With updated functionality for lvmlockd some prototypes
needs to be updated for builds without lvmlockd.
2024-07-02 16:58:03 +02:00
David Teigland
ad1d688734 devices: simpler dm devs cache naming
The dm devs cache is separate from the ordinary dev cache,
so give the function names distinct prefixes, using
"dm_devs_cache" to prefix dm devs cache functions.
2024-07-01 11:50:59 -05:00
David Teigland
8b4701d7c4 devices: redo bcache invalidation of PVs on LV 2024-07-01 11:30:51 -05:00
David Teigland
5551e4a1e9 devices: update dm uuid cache naming
replace "dm uuid" with "dm devs" in case it begins
caching more than dm uuids.
2024-07-01 10:59:16 -05:00
David Teigland
5f26c05bf2 Revert "devices: simpler bcache invalidation of PVs on LVs"
This reverts commit 200b05cec0.

Doesn't work to depend on lv name.
2024-07-01 10:59:16 -05:00
Marian Csontos
2f8550a388 doc: release notes for 2.03.25 2024-07-01 15:33:37 +02:00
Marian Csontos
3ced86217c WHATS_NEW: update 2024-07-01 15:33:36 +02:00
David Teigland
200b05cec0 devices: simpler bcache invalidation of PVs on LVs
When a PV is stacked on an LV, the PV needs to be
dropped from bcache before the LV is processed.
The LV can be found in dev-cache using its name
rather than the devno.
2024-06-28 18:19:15 -05:00
David Teigland
b8869e2d4e dev-cache: unify dm uuid cache struct lifetimes
The list of dm devs was in the cmd struct and had a
different lifetime than the radix trees referencing
those dm devs.  Now the list and radix trees are
created and destroyed together.
2024-06-28 18:01:29 -05:00
David Teigland
24943fe9d3 devices: update function name to dm_device_is_usable 2024-06-28 14:05:57 -05:00
David Teigland
990f4f7c4f devices: dm uuid related function names
In the context of dm, 'device' refers to a dm device, but
in the context of lvm, 'device' refers to struct device.
Change some lvm function names to make that difference clearer.

dev_manager_get_device_list() -> dev_manager_get_dm_active_devices()
get_device_list() -> get_dm_active_devices()
device_get_uuid() -> dev_dm_uuid(), devno_dm_uuid()
2024-06-28 14:05:53 -05:00
David Teigland
680f7bd676 lvmlockd: vgchange systemid doen't need global lock
The comment explained that the ex global lock was just
used to trigger global cache invalidation, which is no
longer needed.  This extra locking can cause problems
with LVM-activate when local and shared VGs are mixed
(and the incorrect exit code for errors was causing
problems.)
2024-06-27 13:29:03 -05:00
David Teigland
54a8562804 lvmlockd: after restart use existing dlm global lockspace
If lvmlockd is killed and restarted, let it adopt the
existing global lockspace.
2024-06-27 13:29:03 -05:00
David Teigland
f1d88007b0 lvmlockd: skip LV unlocking with no lvmlockd or no lockspace
vgchange -an vg is permitted when the vg lockspace
is not available, because LVs could still be active
for some reason, and they should be inactive when not
properly locked.  In case lvmlockd was not running, or
the lockspace was not started, the command was
unnecessarily trying and failing to unlock every LV,
printing errors for every LV.  We can skip this when
the lockspace is known to not be available.
2024-06-27 13:29:03 -05:00
David Teigland
d85ceff9c5 lvmlockd: let vgchange lockstop fail with EBUSY for orphans
vgchange --lockstop will fail with EBUSY if orphan locks in the
lock manager prevent stopping the lockspace.  The orphan locks
can then be adopted and released, and the lockspace then stopped
cleanly.
2024-06-27 13:29:03 -05:00
David Teigland
f32fd1fcb9 lvmlockd: adopt options
Lock adoption is not part of standard command behavior, but can
be used for manual recovery or cleanup from unexpected failure
cases.  Like other lockopt values, they are hidden options for
--lockopt.  Different lock managers will behave differently.
Adopting locks with lvmlockd -A1 is more accurate and automatic.

--lockopt adoptls
. for vgchange --lockstart
. adopt existing ls, or fail if no existing lockspace is found

--lockopt adoptgl | adoptvg | adoptlv
. for commands using lvmlockd locks
. adopt orphan gl/vg/lv lock, or fail the lock request if
  no orphan lock is found
. will fail if orphan lock exists with a different lock mode
. command may still continue with a failed shared lock request

--lockopt adopt
. for lockstart or any command using lvmlockd locks
. adopt existing lockspace, or start lockspace if none exists
. adopt orphan gl/vg/lv lock, or acquire new lock if no orphan found
. will fail if orphan lock exists with a different lock mode
. command may still continue with a failed shared lock request
. with dlm this option only works for ls
2024-06-27 13:29:03 -05:00
David Teigland
943e979079 lvmlockd: parse lockopt string into flags 2024-06-27 13:29:03 -05:00
David Teigland
9ea5ff3db5 lvmlockd: remove unused paramater
start_init option has never been used
2024-06-27 13:29:03 -05:00
David Teigland
4d8fb10af2 vgchange: improve some lvmlockd lockstart messages
Stop printing "Skipping global lock: lockspace not found or started"
for vgchange --lockstart, since it's generally an inherent limitation
that the global lock isn't available until after locking is started.

Update the start delay warning to "a few seconds".
2024-06-27 13:29:03 -05:00
David Teigland
bada03cd48 man: lvmlockd updates 2024-06-27 13:29:03 -05:00
David Teigland
e777ef720c lvmlockd: allow service options
command line options can be set in /etc/sysconfig/lvmlockd, e.g.
OPTIONS='-A1 -o2'
2024-06-27 13:29:03 -05:00
David Teigland
5e1d64a991 lvmlockd: reduce adopt delays 2024-06-27 13:29:03 -05:00