]> sourceware.org Git - lvm2.git/log
lvm2.git
2 years agospec: Use libedit for newer distributions
Marian Csontos [Wed, 27 Jul 2022 16:02:01 +0000 (18:02 +0200)]
spec: Use libedit for newer distributions

2 years agoshell: also output error message about max number of args hit with JSON format
Peter Rajnoha [Mon, 8 Aug 2022 13:15:32 +0000 (15:15 +0200)]
shell: also output error message about max number of args hit with JSON format

If using JSON format for lvm shell's output, the error message about
exceeding the maximum number of arguments was not reported on output if
this condition was ever hit.

This is because the JSON format (as well as any other future format)
requires extra formatting compared to "basic" format and so it also
requires extra calls when it comes to reporting. The report needs to
be added to a report group and then popped and put on output with
specialized "dm_report_group_output_and_pop_all".

This "output and pop" is normally executed after we execute the command
in the lvm shell. When we didn't get to the command exection at all because
some precondition was not met (like hitting the limit for the number of
arguments for the command here), we skipped this important call and
so there was no log report output.

Right now, it's only this exact error message for which we need to call
"output and pop" directly, all the other error messages are about
initializing and setting the log report itself which we can't report
obviously.

Before this patch:

  lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
  lvm>

With this patch applied:

  lvm> pvs 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
  {
      "log": [
          {"log_seq_num":"1", "log_type":"error", "log_context":"shell", "log_object_type":"cmd", "log_object_name":"", "log_object_id":"", "log_object_group":"", "log_object_group_id":"", "log_message":"Too many arguments, sorry.", "log_errno":"-1", "log_ret_code":"0"}
      ]
  }

If there's any other error message in the future before we execute the
command itself, we also need to call the "output and pop" directly.

2 years agoapply multipath_component_detection=0 to duplicate PV handling
David Teigland [Mon, 25 Jul 2022 18:50:43 +0000 (13:50 -0500)]
apply multipath_component_detection=0 to duplicate PV handling

multipath_component_detection=0 has always applied to the filter-based
component detection.  Also apply this setting to the duplicate-PV
handling which also eliminates multipath components (based on duplicate
PVs having the same wwid.)

2 years agomake: generate
Zdenek Kabelac [Sun, 10 Jul 2022 23:02:22 +0000 (01:02 +0200)]
make: generate

2 years agocov: restore disable_dm_devs also for error path
Zdenek Kabelac [Sat, 9 Jul 2022 00:50:08 +0000 (02:50 +0200)]
cov: restore disable_dm_devs also for error path

Keep the structure correct for failing error path,
alhtough likely this particual var will not be used.

2 years agocov: remove unused headers
Zdenek Kabelac [Sat, 9 Jul 2022 00:45:21 +0000 (02:45 +0200)]
cov: remove unused headers

2 years agovdo: suffle code for better error path handling
Zdenek Kabelac [Sat, 9 Jul 2022 19:33:57 +0000 (21:33 +0200)]
vdo: suffle code for better error path handling

For failing dm_ no need to report 2nd. error,
but we missed to report error with 'updated==NULL'.

2 years agovdo: enhance lvcreate validation
Zdenek Kabelac [Fri, 8 Jul 2022 21:38:34 +0000 (23:38 +0200)]
vdo: enhance lvcreate validation

When creating VDO pool based of  % values, lvm2 is now more clever
and avoids to create 'unsupportable' sizes of physical backend
volumes as 16TiB is maximum size supported by VDO target
(and also limited by maximum supportable slabs (8192) based on slab
size.

If the requested virtual size is approaching max supported size 4PiB,
switch header size to 0.

2 years agovdo: support v4 kernel target line
Zdenek Kabelac [Fri, 8 Jul 2022 21:35:06 +0000 (23:35 +0200)]
vdo: support v4 kernel target line

Check and use new available table line v4, if kernel supports it.

2 years agovdo: add reformating to extent size aligned virtual size
Zdenek Kabelac [Fri, 8 Jul 2022 22:42:01 +0000 (00:42 +0200)]
vdo: add reformating to extent size aligned virtual size

Newer VDO kernel target require to have matching virtual size - this
however cause incompatiblity when lvcreate is let to format VDO data
device and read the usable size from vdoformat.
Altough this is a kernel regression and will likely get fixed,
lvm2 can actually reformat VDO device to use properly aligned VDO LV
size to make this problem disappear.

2 years agovdo: check vdo memory constrains
Zdenek Kabelac [Fri, 8 Jul 2022 21:33:29 +0000 (23:33 +0200)]
vdo: check vdo memory constrains

Add function to check for avaialble memory for particular VDO
configuration - to avoid unnecessary machine swapping for configs
that will not fit into memory (possibly in locked section).

Formula tries to estimate RAM size machine can use also with
swapping for kernel target - but still leaving some amount of
usable RAM.

Estimation is based on documented RAM usage of VDO target.

If the /proc/meminfo would be theoretically unavailable, try to use
'sysinfo()' function, however this is giving only free RAM without
the knowledge about how much RAM could be eventually swapped.

TODO: move _get_memory_info() into generic lvm2 API function used
by other targets with non-trivial memory requirements.

2 years agovdo: report supported range in error path
Zdenek Kabelac [Sat, 9 Jul 2022 19:28:40 +0000 (21:28 +0200)]
vdo: report supported range in error path

2 years agovdo: use defines also for configuration defines
Zdenek Kabelac [Fri, 24 Jun 2022 13:54:08 +0000 (15:54 +0200)]
vdo: use defines also for configuration defines

Keep single source for most of values printed in lvm.conf
(still needs some conversion)

Correct max for logical threads to 60
(we may refuse some older configuration which might eventually
user higher numbers - but so far let's assume no user have ever set this
as it's been non-trivial and if would complicate code unnecessarily.)

Accept maximum of 4PiB for virtual size of VDO LV
(lvm2 will drop 'header borders to 0 for this case').

2 years agovdo: update info about memory
Zdenek Kabelac [Mon, 4 Jul 2022 13:00:26 +0000 (15:00 +0200)]
vdo: update info about memory

Add more info about kernel target memory allocation associated with
VDO pool usage.

2 years agovdo: use single validator
Zdenek Kabelac [Mon, 4 Jul 2022 14:08:30 +0000 (16:08 +0200)]
vdo: use single validator

Add era lenght validation into dm_vdo_validate_target_params()
and reuse this validator also for _check_lv_segment().

2 years agoman: space after size
Zdenek Kabelac [Mon, 4 Jul 2022 13:10:58 +0000 (15:10 +0200)]
man: space after size

Put space between size and SI unit.
Automatically make this 'space' as fixed size by Makefile sed script.

2 years agovdo: fix conversion of vdo_slab_size_mb 2nd
Zdenek Kabelac [Sun, 10 Jul 2022 23:07:24 +0000 (01:07 +0200)]
vdo: fix conversion of vdo_slab_size_mb 2nd

Patch 1b070f366ba57a6eb24df03241284732db5047e9 should have
been already fixing this issue but since it the incorrect
patch rebasing the change to vdo_slabSize got lost.
So again now with explicit one-line patch.

2 years agoexit with error when --devicesfile name doesn't exist
David Teigland [Tue, 5 Jul 2022 22:08:00 +0000 (17:08 -0500)]
exit with error when --devicesfile name doesn't exist

2 years agolvmdbustest: Add test for property "Get"
Tony Asleson [Tue, 7 Jun 2022 16:47:27 +0000 (11:47 -0500)]
lvmdbustest: Add test for property "Get"

We typically use "GetAll", so add test for "Get" and check values.

2 years agolvmdbusd: Remove try/except for mkfifo
Tony Asleson [Tue, 7 Jun 2022 13:21:03 +0000 (08:21 -0500)]
lvmdbusd: Remove try/except for mkfifo

We should never run into this error condition when using tempfile.mkdtemp.

2 years agolvmdusd: Remove non lvm JSON output support
Tony Asleson [Tue, 7 Jun 2022 13:20:06 +0000 (08:20 -0500)]
lvmdusd: Remove non lvm JSON output support

2 years agolvmdbustest: Increase number of LVs
Tony Asleson [Mon, 6 Jun 2022 15:01:18 +0000 (10:01 -0500)]
lvmdbustest: Increase number of LVs

As storage is getting faster, we need to create more LVs to pass this test.

2 years agolvmdbustest: Correct comment spelling/grammar
Tony Asleson [Mon, 6 Jun 2022 14:59:59 +0000 (09:59 -0500)]
lvmdbustest: Correct comment spelling/grammar

2 years agolvmdbustest: Test job remove path when job not complete
Tony Asleson [Mon, 6 Jun 2022 14:58:39 +0000 (09:58 -0500)]
lvmdbustest: Test job remove path when job not complete

2 years agolvmdbusd: Correct grammar in lvm shell proxy comments
Tony Asleson [Mon, 6 Jun 2022 14:57:20 +0000 (09:57 -0500)]
lvmdbusd: Correct grammar in lvm shell proxy comments

2 years agolvmdbusd: Don't require "lvm> " prompt for shell
Tony Asleson [Mon, 6 Jun 2022 14:56:32 +0000 (09:56 -0500)]
lvmdbusd: Don't require "lvm> " prompt for shell

Depending on how lvm is compiled, it may not present the "lvm> " prompt
when using the lvm shell.  Don't require it to be present.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2090391

2 years agolvmdbusd: Job prop. Get/GetAll exec. immediately
Tony Asleson [Mon, 6 Jun 2022 14:51:54 +0000 (09:51 -0500)]
lvmdbusd: Job prop. Get/GetAll exec. immediately

This allows API user the ability to check on the status of a long running
job without blocking in the request queue.

2 years agolvmdbusd: Remove the use of sub shell for lvm shell
Tony Asleson [Thu, 26 May 2022 15:44:02 +0000 (10:44 -0500)]
lvmdbusd: Remove the use of sub shell for lvm shell

This reduces the number of processes and improves security.

2 years agolvmdbusd: Fix env variable LVM_DBUSD_TEST_MODE
Tony Asleson [Wed, 25 May 2022 21:21:14 +0000 (16:21 -0500)]
lvmdbusd: Fix env variable LVM_DBUSD_TEST_MODE

Make it more logical.

2 years agolvmdbusd: Change unit test vdo minimum size
Tony Asleson [Wed, 25 May 2022 21:03:27 +0000 (16:03 -0500)]
lvmdbusd: Change unit test vdo minimum size

2 years agolvmdbusd: Add debug output for which lvm binary is used
Tony Asleson [Wed, 25 May 2022 20:59:11 +0000 (15:59 -0500)]
lvmdbusd: Add debug output for which lvm binary is used

2 years agolvmdbusd: re-work lvm shell main
Tony Asleson [Wed, 25 May 2022 20:58:15 +0000 (15:58 -0500)]
lvmdbusd: re-work lvm shell main

Add an optional single argument "bisect" to use with git bisect for
automation.  Normal case is no arguments when running stand-alone.

2 years agolvmdbusd: Simplify child process env
Tony Asleson [Wed, 25 May 2022 20:52:20 +0000 (15:52 -0500)]
lvmdbusd: Simplify child process env

We don't need to duplicate the entire env from the parent, supply only what
is needed.

2 years agolvmdbusd: Correct conditional for lvm child process running
Tony Asleson [Wed, 25 May 2022 20:51:14 +0000 (15:51 -0500)]
lvmdbusd: Correct conditional for lvm child process running

Poll returns None when process is running, else exit value.  If poll returns
0 we will fail to exit the select loop.

2 years agopvdisplay: restore --reportformat option
David Teigland [Fri, 24 Jun 2022 15:40:54 +0000 (10:40 -0500)]
pvdisplay: restore --reportformat option

Fixes commit b8f4ec846 "display: ignore --reportformat"
by restoring the --reportformat option to pvdisplay.
Adding -C to pvdisplay turns the command into a reporting
command (like pvs, vgs, lvs) in which --reportformat can
be useful.

2 years agofilter-mpath: get wwids from sysfs vpd_pg83
David Teigland [Mon, 6 Jun 2022 19:04:20 +0000 (14:04 -0500)]
filter-mpath: get wwids from sysfs vpd_pg83

to compare with wwids in /etc/multipath/wwids when
excluding multipath components.  The wwid printed
from the sysfs wwid file may not be the wwid used
in multipath wwids.  Save the wwids found for each
device on dev->wwids to avoid repeating reading
and parsing the sysfs files.

2 years agotests: skip running tests for non root user
Zdenek Kabelac [Mon, 30 May 2022 16:41:16 +0000 (18:41 +0200)]
tests: skip running tests for non root user

Testing needs 'root' privileges.
Only 'make run-unit-test' can work without them.

2 years agotests: update for wrapper
Zdenek Kabelac [Tue, 7 Jun 2022 14:52:30 +0000 (16:52 +0200)]
tests: update for wrapper

Update calling vdo manager since our vdo wrapper has a simple shell
arg parser so it needs args without '='

Also correct using  DM_DEV_DIR for 'pvcreate'

2 years agotests: add lvm_vdo_wrapper
Zdenek Kabelac [Tue, 31 May 2022 20:45:29 +0000 (22:45 +0200)]
tests: add lvm_vdo_wrapper

Introduce a replacement vdo manager wrapper for testing.
When using test suite on a system without vdo manager (which has got
deprecated) - we still need its functionality to prepare 'vdo volume'
for testing lvm_import_vdo.

Wrapper currently need 2 binaries from older 'vdo 6.2' package -
to be named:
oldvdoformat - format VDO metadata with older format
oldvdoprepareforlvm - shift vdo metadata by 1MiB

2 years agovdo: fix conversion of vdo_slab_size_mb
Zdenek Kabelac [Tue, 31 May 2022 20:48:38 +0000 (22:48 +0200)]
vdo: fix conversion of vdo_slab_size_mb

When converting VDO volume, the parameter vdo_slabSize was
incorrectly copied as vdo_blockMapCacheSize, however this parameter
is then no longer used for any table line creation so the wrong
value was only stored in metadata.

Also use just single get_kb_size_with_unit_ and remove it's duplicate
functionality with get_mb_size_with_unit_.

Use $VERB for vdo remove call.

2 years agofilter-mpath: handle other wwid types in blacklist
David Teigland [Mon, 6 Jun 2022 16:39:02 +0000 (11:39 -0500)]
filter-mpath: handle other wwid types in blacklist

Fixes commit 494372b4eed0c8f6040e3357939eb7511ac25745
  "filter-mpath: use multipath blacklist"
to handle wwids with initial type digits 1 and 2 used
for t10 and eui ids.  Originally recognized type 3 naa.

2 years agodevices file: fail if --devicesfile filename doesn't exist
David Teigland [Fri, 27 May 2022 19:27:03 +0000 (14:27 -0500)]
devices file: fail if --devicesfile filename doesn't exist

A typo of the filename after --devicesfile should result in a
command error rather than the command falling back to using no
devices file at all.  Exception is vgcreate|pvcreate which
create a new devices file if the file name doesn't exist.

2 years agodevices file: move clean up after command is run
David Teigland [Fri, 27 May 2022 17:38:43 +0000 (12:38 -0500)]
devices file: move clean up after command is run

devices_file_exit wasn't being called between lvm_shell
commands, so the file lock wouldn't be released.

2 years agopost-release
Marian Csontos [Wed, 18 May 2022 16:18:14 +0000 (18:18 +0200)]
post-release

2 years agopre-release v2_03_16
Marian Csontos [Wed, 18 May 2022 16:17:06 +0000 (18:17 +0200)]
pre-release

2 years agomake: generate
Marian Csontos [Wed, 18 May 2022 16:15:30 +0000 (18:15 +0200)]
make: generate

2 years agotoollib: fix segfault when handling selection with historical LVs
Peter Rajnoha [Thu, 5 May 2022 09:02:32 +0000 (11:02 +0200)]
toollib: fix segfault when handling selection with historical LVs

When processing historical LVs inside process_each_lv_in_vg for
selection, we need to use dummy "_historical_lv" for select_match_lv.

This is because a historical LV is not an actual LV, but only a tiny
representation with subset of original properties that we recorded
(name, uuid...).

To use the same processing functions we use for full-fledged non-historical
LVs, we need to use the prefilled "_historical_lv" structure which has all
the other missing properties hard-coded.

2 years agomake: generate
Zdenek Kabelac [Mon, 2 May 2022 11:16:25 +0000 (13:16 +0200)]
make: generate

2 years agovdo: support --vdosettings
Zdenek Kabelac [Wed, 13 Apr 2022 13:09:08 +0000 (15:09 +0200)]
vdo: support --vdosettings

Allow to use --vdosettings with lvcreate,lvconvert,lvchange.
Support settings currenly only configurable via lvm.conf.
With lvchange we require inactivate LV for changes to be applied.

Settings block_map_era_length has supported alias block_map_period.

2 years agoimprove description of devices option
David Teigland [Mon, 2 May 2022 14:46:28 +0000 (09:46 -0500)]
improve description of devices option

2 years agofilter-mpath: use multipath blacklist
David Teigland [Thu, 21 Apr 2022 18:45:01 +0000 (13:45 -0500)]
filter-mpath: use multipath blacklist

Explicit wwid's from these sections control whether the
same wwid in /etc/multipath/wwids is recognized as a
multipath component.  Other non-wwid keywords are not
used, and may require disabling the use of the multipath
wwids file in lvm.conf.

2 years agotests: devicesfile-edit.sh fix loop file name
David Teigland [Thu, 21 Apr 2022 16:31:06 +0000 (11:31 -0500)]
tests: devicesfile-edit.sh fix loop file name

don't remove dash from loop file name

2 years agodevices file: remove extraneous unlock in vgchange -u
David Teigland [Wed, 13 Apr 2022 17:16:57 +0000 (12:16 -0500)]
devices file: remove extraneous unlock in vgchange -u

vgchange -u exit path was unlocking the devices file in cases
when it wasn't needed, which produced an warning.

2 years agolvmlockd: return error from vgcreate init_vg_sanlock
David Teigland [Fri, 8 Apr 2022 16:28:53 +0000 (11:28 -0500)]
lvmlockd: return error from vgcreate init_vg_sanlock

in vgcreate for shared sanlock vg, if sanlock_write_resource
returns an unexpected error, then make init_vg_sanlock fail
which will cause the vgcreate to fail.

2 years agofilters: remove unused internal filter
David Teigland [Fri, 1 Apr 2022 20:09:18 +0000 (15:09 -0500)]
filters: remove unused internal filter

2 years agofilter: remove unused EAGAIN case and flag
David Teigland [Fri, 1 Apr 2022 20:06:03 +0000 (15:06 -0500)]
filter: remove unused EAGAIN case and flag

The case of filters returning EAGAIN and using the
FILTER_AFTER_SCAN flag is no longer used.

2 years agolvmdevices: --deldev using device id
David Teigland [Wed, 6 Apr 2022 17:29:26 +0000 (12:29 -0500)]
lvmdevices: --deldev using device id

When used with --deviceidtype, --deldev can specify
a device id to remove.

2 years agovgimportdevices: fix incorrect deviceidtype usage
David Teigland [Wed, 6 Apr 2022 17:20:26 +0000 (12:20 -0500)]
vgimportdevices: fix incorrect deviceidtype usage

When a VG has PVs with different device id types,
it would try to use the idtype of the previous PV
in the loop.  This would produce an unncessary warning,
or could lead to using the devname idtype when a better
idtype is available.

2 years agopvscan: warn about /dev/sda excluded by devices file
David Teigland [Thu, 31 Mar 2022 19:47:42 +0000 (14:47 -0500)]
pvscan: warn about /dev/sda excluded by devices file

In most installations, /dev/sda* or /dev/vda* should be included
in system.devices because the root, home, etc LVs are usually on
sda or vda.

Add a special case warning when a pvscan autoactivation command
sees that /dev/sda* or /dev/vda* are excluded by system.devices,
either not listed or having a different device id.

2 years agochange messages about filtered devices
David Teigland [Thu, 31 Mar 2022 16:38:08 +0000 (11:38 -0500)]
change messages about filtered devices

Change messages that refer to devices being "excluded by filters"
to say just "excluded".  This will avoid mistaking the word
"filters" with the lvm.conf filter setting.

2 years agolvmdevices update: correct multipath entries
David Teigland [Wed, 30 Mar 2022 21:28:35 +0000 (16:28 -0500)]
lvmdevices update: correct multipath entries

Remove multipath components.
Add multipath devs that have multipath components listed.

2 years agodevices file: warn about missing multipath entry
David Teigland [Tue, 29 Mar 2022 22:18:45 +0000 (17:18 -0500)]
devices file: warn about missing multipath entry

Warn if a scsi device is listed in the devices file that
is used by a multipath device that is not listed.  This
will happen if a scsi device is listed in the devices
file and then an mpath device is set up to use it.

The way to correct this would be to remove the devices
file entry for the component device and add a new entry
for the multipath device.

2 years agothin: fix message processing on thin-pool extension
Zdenek Kabelac [Wed, 30 Mar 2022 12:16:11 +0000 (14:16 +0200)]
thin: fix message processing on thin-pool extension

When thin-pool had queued some delete message on extension operation
such message has been 'lost' and thin-pool kernel metadata has been
left with a thin volume that no longer existed for lvm2 metadata.

2 years agofix args entry for nolocking
David Teigland [Fri, 25 Mar 2022 22:25:29 +0000 (17:25 -0500)]
fix args entry for nolocking

typo in previous commit

2 years agoMove nolocking warning to man page
David Teigland [Fri, 25 Mar 2022 20:43:53 +0000 (15:43 -0500)]
Move nolocking warning to man page

It's more logical to warn about --nolocking in the man page
before it's used rather than after it's used and too late.
Also, warnings are usually for things the user may not know.

2 years agovgchange monitor: don't use udev info
David Teigland [Fri, 25 Mar 2022 19:13:56 +0000 (14:13 -0500)]
vgchange monitor: don't use udev info

vgchange --monitor y is run during startup when udev is being
initialized and is not yet ready to be used.

2 years agopvscan: don't use udev for external device info
David Teigland [Wed, 9 Mar 2022 17:54:59 +0000 (11:54 -0600)]
pvscan: don't use udev for external device info

pvscan is used to populate udev info, so it can't expect
to use that udev info.

2 years agowritecache: check memory usage
David Teigland [Tue, 1 Mar 2022 20:31:39 +0000 (14:31 -0600)]
writecache: check memory usage

warn if writecache neds > 50% of system memory, and
confirm if writecache needs > 90% of system memory.

2 years agodevices: only close PVs on LVs when scan_lvs is enabled
David Teigland [Tue, 1 Mar 2022 18:22:46 +0000 (12:22 -0600)]
devices: only close PVs on LVs when scan_lvs is enabled

This code is only needed when lvm scans PVs that are stacked on LVs.

2 years agodevices: use dev-cache aliases handling from label scan functions
David Teigland [Mon, 28 Feb 2022 23:37:12 +0000 (17:37 -0600)]
devices: use dev-cache aliases handling from label scan functions

The label scan functions where doing some device alias validation
which is now better handled by the dev-cache layer, so just use
that.

2 years agodevices: fix dev_name assumptions
David Teigland [Tue, 22 Feb 2022 21:03:11 +0000 (15:03 -0600)]
devices: fix dev_name assumptions

dev_name(dev) returns "[unknown]" if there are no names
on dev->aliases.  It's meant mainly for log messages.

Many places assume a valid path name is returned, and
use it directly.  A caller that wants to use the path
from dev_name() must first check if the dev has any
paths with dm_list_empty(&dev->aliases).

2 years agodevices: initial use of existing option
David Teigland [Thu, 24 Feb 2022 22:10:37 +0000 (16:10 -0600)]
devices: initial use of existing option

Use dev_cache_get_existing() in a few common, high level
locations where it's obvious that only existing dev-cache
entries are wanted.  This can be expanded and used in more
locations (or dev_cache_get can stop creating new entries.)

2 years agodevices: drop incorrect paths from aliases list
David Teigland [Thu, 24 Feb 2022 22:03:21 +0000 (16:03 -0600)]
devices: drop incorrect paths from aliases list

along with some basic checks for cases when a device
has no aliases.

lvm itself creates many situations where a struct device
has no valid paths, when it activates and opens an LV,
does something with it, e.g. zeroing, and then closes
and deactivates it.  (dev-cache is intended for PVs, and
the use of LVs should be moved out of dev-cache in a
future patch.)

2 years agodevices: simplify dev_cache_get_by_devt
David Teigland [Thu, 24 Feb 2022 21:57:29 +0000 (15:57 -0600)]
devices: simplify dev_cache_get_by_devt

remove unused args, and no callers need or want a
repeated dev_cache_scan if there is no dev from the
lookup.

2 years agowritecache: display block size from lvs
David Teigland [Mon, 21 Feb 2022 22:09:57 +0000 (16:09 -0600)]
writecache: display block size from lvs

lvs was missing the ability to display writecache block size.
now possible with lvs -o writecache_block_size

2 years agoman lvmcache: mention writecache memory usage
David Teigland [Mon, 21 Feb 2022 17:35:58 +0000 (11:35 -0600)]
man lvmcache: mention writecache memory usage

2 years agoman: update cachesettings option description
David Teigland [Wed, 16 Feb 2022 21:36:44 +0000 (15:36 -0600)]
man: update cachesettings option description

to be more consistent with man page description

2 years agoman lvmcache: add more writecache cachesettings info
David Teigland [Wed, 16 Feb 2022 21:21:09 +0000 (15:21 -0600)]
man lvmcache: add more writecache cachesettings info

2 years agodev_manager: use list info for preset devs
Zdenek Kabelac [Tue, 15 Feb 2022 23:33:32 +0000 (00:33 +0100)]
dev_manager: use list info for preset devs

In some cases we can also use cached info obtained from DM_DEVICE_LIST
also to avoid extra ioctl check for present devices.

2 years agodev_manager: do not query for open_count
Zdenek Kabelac [Fri, 11 Feb 2022 22:55:08 +0000 (23:55 +0100)]
dev_manager: do not query for open_count

Oepn count is not used along this code path.

2 years agoclang: possible better compilation with musl c
Zdenek Kabelac [Tue, 15 Feb 2022 23:48:49 +0000 (00:48 +0100)]
clang: possible better compilation with musl c

Try to help resolving reported compilation problem with
clang & musl C.
https://github.com/lvmteam/lvm2/issues/61

2 years agoclang: add extra check
Zdenek Kabelac [Tue, 8 Feb 2022 18:17:30 +0000 (19:17 +0100)]
clang: add extra check

Make clang happier.

2 years agodev_manager: failing status is not internal error
Zdenek Kabelac [Tue, 15 Feb 2022 20:16:10 +0000 (21:16 +0100)]
dev_manager: failing status is not internal error

Different target type for LV it's not an internal error.
i.e.  when target type is replaced with 'error' type - it should be
reported as regular warning and not cause interruption of command with
internall error.

2 years agodev_manager: fix dm_task_get_device_list
Zdenek Kabelac [Tue, 15 Feb 2022 23:33:25 +0000 (00:33 +0100)]
dev_manager: fix dm_task_get_device_list

With very old version of DM target driver we have to avoid
trying to use newuuid setting - otherwise we get error
during ioctl preparation phase.

Patch is fixing regression from commit:
988ea0e94c79a496f2619eab878fd9db6168711d

2 years agotests: skip vgchange-pvs-online.sh on rhel5
David Teigland [Tue, 15 Feb 2022 21:56:01 +0000 (15:56 -0600)]
tests: skip vgchange-pvs-online.sh on rhel5

the /dev/mapper/ paths to test devices don't seem to work there

2 years agodevices file: do not clear PVID of unread devices
David Teigland [Thu, 10 Feb 2022 20:00:25 +0000 (14:00 -0600)]
devices file: do not clear PVID of unread devices

In a certain disconnected state, a block device is present on
the system, can be opened, reports a valid size, reports the
correct device id (wwid), and matches a devices file entry.
But, reading the device can still fail.  In this case,
device_ids_validate() was misinterpreting the read error as
the device having no data/label on it (and no PVID).
The validate function would then clear the PVID from the
devices file entry for the device, thinking that it was
fixing the devices file (making it consistent with the on disk
state.)  Fix this by not attempting to check and correct a
devices file entry that cannot be read.  Also make this case
explicit in the hints validation code (which was doing the
right thing but indirectly.)

2 years agotests: udev-pvscan-vgchange fix service wait
David Teigland [Mon, 7 Feb 2022 22:44:57 +0000 (16:44 -0600)]
tests: udev-pvscan-vgchange fix service wait

As a result of removing -r from systemd-run in
commit fbd8b0cf43dc67f51f86f060dce748f446985855
this test needs to change how it handles the
transient services.

2 years agomake: generate
Zdenek Kabelac [Sun, 6 Feb 2022 19:05:54 +0000 (20:05 +0100)]
make: generate

2 years agoasan: fix some reports from libasan
Zdenek Kabelac [Mon, 7 Feb 2022 18:58:04 +0000 (19:58 +0100)]
asan: fix some reports from libasan

When compiled and used with:

CFLAGS="-fsanitize=address -g -O0"
ASAN_OPTIONS=strict_string_checks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1

we have few reported issue - they where not normally spotted, since
we were still accessing our own memory - but ouf of buffer-range.

TODO: there is still something to enhance with handling of #orphan vgids

2 years agopost-release
Marian Csontos [Mon, 7 Feb 2022 17:02:07 +0000 (18:02 +0100)]
post-release

2 years agopre-release v2_03_15
Marian Csontos [Mon, 7 Feb 2022 17:00:54 +0000 (18:00 +0100)]
pre-release

2 years agotests: devicesfile-edit
David Teigland [Thu, 3 Feb 2022 22:58:12 +0000 (16:58 -0600)]
tests: devicesfile-edit

test lvmdevices add/del

2 years agolvmdevices: make deldev work for missing device
David Teigland [Thu, 3 Feb 2022 22:56:03 +0000 (16:56 -0600)]
lvmdevices: make deldev work for missing device

2 years agowritecache: look for settings in lvm.conf
David Teigland [Mon, 31 Jan 2022 22:12:24 +0000 (16:12 -0600)]
writecache: look for settings in lvm.conf

Restore the lvm.conf cache_settings for writecache
added by c6639056e0bb2fc5f072b2c0d6bb629ad17eee6e.
Shorter method reduces and isolates the complexity
of config trees.

2 years agoRevert "writecache: handle options from lvm.conf"
David Teigland [Mon, 31 Jan 2022 21:18:46 +0000 (15:18 -0600)]
Revert "writecache: handle options from lvm.conf"

This reverts commit c6639056e0bb2fc5f072b2c0d6bb629ad17eee6e.

Next commit restores this feature.

2 years agotests: skip test part when missed in kernel
Zdenek Kabelac [Mon, 31 Jan 2022 14:11:47 +0000 (15:11 +0100)]
tests: skip test part when missed in kernel

2 years agoactivation: use lv_is_active
Zdenek Kabelac [Sun, 30 Jan 2022 14:30:48 +0000 (15:30 +0100)]
activation: use lv_is_active

Use existing lv_is_active

2 years agotools: missing sync after deactivation
Zdenek Kabelac [Fri, 28 Jan 2022 16:42:04 +0000 (17:42 +0100)]
tools: missing sync after deactivation

Caching of DM states optimisation revealed some missing
synchronisation points.

2 years agoudev: create symlinks and watch even in suspended state
Martin Wilck [Fri, 28 Jan 2022 13:42:29 +0000 (14:42 +0100)]
udev: create symlinks and watch even in suspended state

If a dm device is suspended, we can't run blkid on it. But earlier
rules (e.g. 11-dm-parts.rules) might have imported previously scanned
properties from the udev db, in particular if the device had been correctly
set up beforehand (DM_UDEV_PRIMARY_SOURCE_FLAG==1). Symlinks for existing
ID_FS_xyz properties must be preserved in this case. Otherwise lower-priority
devices (such as multipath components) might take over the symlink
temporarily.

Likewise, we should't stop watching a temporarily suspended, but previously
correctly configured dm device.

Signed-off-by: Martin Wilck <mwilck@suse.com>
2 years agoremove static autoactivation
David Teigland [Tue, 25 Jan 2022 22:05:32 +0000 (16:05 -0600)]
remove static autoactivation

event based autoactivation is now the only method that lvm
provides for autoactivation.

Setting lvm.conf event_activation=0 can still be used to disable
event based autoactivation commands, but doing so will no longer
enable static autoactivation.

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