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

18119 Commits

Author SHA1 Message Date
Tony Asleson
7a2090655d lvmdbusd: Remove the use of sub shell for lvm shell
This reduces the number of processes and improves security.
2022-06-30 10:55:16 -05:00
Tony Asleson
b3d7aff6a3 lvmdbusd: Fix env variable LVM_DBUSD_TEST_MODE
Make it more logical.
2022-06-30 10:55:16 -05:00
Tony Asleson
47c61907b4 lvmdbusd: Change unit test vdo minimum size 2022-06-30 10:55:16 -05:00
Tony Asleson
51d9b686c0 lvmdbusd: Add debug output for which lvm binary is used 2022-06-30 10:55:16 -05:00
Tony Asleson
b3407b16c1 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.
2022-06-30 10:55:16 -05:00
Tony Asleson
58c6c9e9aa lvmdbusd: Simplify child process env
We don't need to duplicate the entire env from the parent, supply only what
is needed.
2022-06-30 10:55:16 -05:00
Tony Asleson
37733cd4eb 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.
2022-06-30 10:55:16 -05:00
David Teigland
db5277c971 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.
2022-06-24 10:40:54 -05:00
David Teigland
3b0f9cec7e 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.
2022-06-08 15:06:01 -05:00
Zdenek Kabelac
2bea95764e tests: skip running tests for non root user
Testing needs 'root' privileges.
Only 'make run-unit-test' can work without them.
2022-06-07 17:14:09 +02:00
Zdenek Kabelac
4a49851207 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'
2022-06-07 17:14:09 +02:00
Zdenek Kabelac
2ecfd503ed 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
2022-06-07 17:14:08 +02:00
Zdenek Kabelac
1b070f366b 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.
2022-06-07 17:14:08 +02:00
David Teigland
c302903dba filter-mpath: handle other wwid types in blacklist
Fixes commit 494372b4ee
  "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.
2022-06-06 11:39:02 -05:00
David Teigland
bfe072e438 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.
2022-05-27 14:27:03 -05:00
David Teigland
9dfa6f3879 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.
2022-05-27 12:38:43 -05:00
Marian Csontos
a30013ff4f post-release 2022-05-18 18:18:14 +02:00
Marian Csontos
6d1e894a86 pre-release 2022-05-18 18:17:06 +02:00
Marian Csontos
9aa3ea1c98 make: generate 2022-05-18 18:15:30 +02:00
Peter Rajnoha
7ec0726ce3 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.
2022-05-05 11:13:39 +02:00
Zdenek Kabelac
ff6022d400 make: generate 2022-05-03 19:09:52 +02:00
Zdenek Kabelac
5e060b8fa7 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.
2022-05-03 19:09:52 +02:00
David Teigland
dd28460017 improve description of devices option 2022-05-02 09:47:02 -05:00
David Teigland
494372b4ee 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.
2022-04-22 16:07:47 -05:00
David Teigland
5c50590b22 tests: devicesfile-edit.sh fix loop file name
don't remove dash from loop file name
2022-04-21 11:31:06 -05:00
David Teigland
bee575d678 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.
2022-04-13 12:19:04 -05:00
David Teigland
d14245c724 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.
2022-04-08 11:34:04 -05:00
David Teigland
99f9bb28c9 filters: remove unused internal filter 2022-04-06 12:51:34 -05:00
David Teigland
6cb0b44cd2 filter: remove unused EAGAIN case and flag
The case of filters returning EAGAIN and using the
FILTER_AFTER_SCAN flag is no longer used.
2022-04-06 12:51:34 -05:00
David Teigland
fb7698b0ce lvmdevices: --deldev using device id
When used with --deviceidtype, --deldev can specify
a device id to remove.
2022-04-06 12:51:34 -05:00
David Teigland
151ce8b276 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.
2022-04-06 12:20:26 -05:00
David Teigland
f840dbb320 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.
2022-04-01 13:38:21 -05:00
David Teigland
8db3b11e4e 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.
2022-04-01 13:38:21 -05:00
David Teigland
23a9bd549a lvmdevices update: correct multipath entries
Remove multipath components.
Add multipath devs that have multipath components listed.
2022-04-01 13:38:21 -05:00
David Teigland
6e22be20c6 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.
2022-04-01 13:38:21 -05:00
Zdenek Kabelac
0937113146 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.
2022-03-30 14:49:04 +02:00
David Teigland
86a0a652a9 fix args entry for nolocking
typo in previous commit
2022-03-25 17:25:29 -05:00
David Teigland
f1578b4a5d 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.
2022-03-25 15:43:53 -05:00
David Teigland
72f0b637d2 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.
2022-03-25 14:13:56 -05:00
David Teigland
c7a5b5cca0 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.
2022-03-09 11:54:59 -06:00
David Teigland
bef1363c00 writecache: check memory usage
warn if writecache neds > 50% of system memory, and
confirm if writecache needs > 90% of system memory.
2022-03-01 16:29:53 -06:00
David Teigland
cc73d99886 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.
2022-03-01 14:11:05 -06:00
David Teigland
7b1a857d5a 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.
2022-02-28 17:37:12 -06:00
David Teigland
4eb04c8c05 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).
2022-02-24 17:22:04 -06:00
David Teigland
00c3069872 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.)
2022-02-24 17:22:03 -06:00
David Teigland
7e70041e32 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.)
2022-02-24 17:22:03 -06:00
David Teigland
1126be8f8d 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.
2022-02-24 17:21:58 -06:00
David Teigland
ac1f4bbbfd writecache: display block size from lvs
lvs was missing the ability to display writecache block size.
now possible with lvs -o writecache_block_size
2022-02-21 16:11:13 -06:00
David Teigland
6144dac897 man lvmcache: mention writecache memory usage 2022-02-21 11:35:58 -06:00
David Teigland
96c99d647e man: update cachesettings option description
to be more consistent with man page description
2022-02-16 15:37:54 -06:00