1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-09 01:18:39 +03:00
Commit Graph

17944 Commits

Author SHA1 Message Date
David Teigland
08a5619a1d 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.)
2022-06-09 11:32:40 -05:00
David Teigland
df2b1555af lvmdevices: make deldev work for missing device 2022-06-09 11:30:07 -05:00
David Teigland
4e72068216 lvmdevices: fix checks when adding entries
Removes some incorrect and unnecessary checks for other entries
when adding a new devices.  The removed checks and corrections were
mostly redundant with what is already done by device id matching.
Other checking is reworked so the warnings are a bit different.
2022-06-09 11:29:57 -05:00
David Teigland
7b79acc616 devices: exclude md components when duplicate pvs are seen
Improve handling of md components that get through the
filter, like the previous improvement for multipath.
If md components get through the filter and trigger
duplicate PV code, then eliminate any devs entirely
that are not an md device.
2022-05-25 12:07:52 -05:00
David Teigland
5403a6f059 devices: exclude multipath components based on matching wwid
If multipath component devices get through the filter and
cause lvm to see duplicate PVs, then check the wwid of the
devs and drop the component devices as if they had been
filtered.  If a dm mpath device was found among the duplicates
then use that as the PV, otherwise do not use any of the
components as the PV.

"duplicate PVs" associated with multipath configs will no
longer stop commands from working.
2022-05-25 12:07:35 -05:00
David Teigland
9375aebad1 Revert "pvcreate: overwrite partition header with -f"
This reverts commit a5c37afdca.

This commit did not properly recognize GPT cases.
2022-01-18 12:16:52 -06:00
David Teigland
bb477d63e3 lvmdevices check: error exit if update is needed
. error exit means that lvmdevices --update would make a change.

. remove check of PART field from --check because it isn't used.

. unlink searched_devnames file to ensure check|update will search
2022-01-14 15:53:13 -06:00
David Teigland
a5c37afdca pvcreate: overwrite partition header with -f
$ pvcreate /dev/sdc
  Cannot use /dev/sdc: device is partitioned
$ pvcreate -f /dev/sdc
  Physical volume "/dev/sdc" successfully created.
2022-01-14 14:35:35 -06:00
Marian Csontos
4b26fb3543 make: generate 2022-01-04 17:15:56 +01:00
David Teigland
61833dd5b6 man lvmautoactivation: replace systemctl with journalctl 2021-12-20 14:22:18 -06:00
David Teigland
af4bfa1f1f lvcreate: include recent options
The permitted option list in lvcreate has not kept
up with command-lines.in.
2021-12-20 14:22:18 -06:00
David Teigland
7631c5b826 man: add section about static autoactivation 2021-12-20 14:22:18 -06:00
David Teigland
357a807e81 device_id: handle wwid with spaces or control characters
non-standard wwid can be reported from sysfs with spaces/etc.
replace with "_"
2021-12-20 14:22:18 -06:00
David Teigland
604fd528fb print warning about unrecognized journal option value 2021-12-20 14:22:18 -06:00
David Teigland
04770589b4 devices file: don't write in test mode 2021-12-20 14:22:18 -06:00
David Teigland
10a4478e9b tests devicesfile-devname.sh drop mdadm chunk 2021-12-20 14:22:17 -06:00
Marian Csontos
c02a086fe7 spec: Add lvmautoactivation man page 2021-12-20 14:22:17 -06:00
David Teigland
25dbe3dd82 man: lvmautoactivation
new topical man page describing autoactivation
2021-12-20 14:22:17 -06:00
David Teigland
7ac0b3c119 fix spelling of pruning 2021-12-20 14:22:17 -06:00
David Teigland
594c1fec16 display: ignore --reportformat
Using the option would do nothing useful but would
print extraneous braces.
2021-12-20 14:22:17 -06:00
David Teigland
9c9bf13186 tests pv-ext-flags: work with devices file 2021-12-20 14:22:17 -06:00
David Teigland
39adf3e513 device_id: searched_devnames improvements
Remove the searched_devnames file in a couple more places:
. When hints need refreshing it's possible that a missing
  devices file entry could be found by searching devices
  again.
. When a devices file entry devname is first found to be
  incorrect, a new search for missing entries may be
  useful.
2021-12-20 14:22:17 -06:00
David Teigland
5533cd7bf4 device_id: fix search on filtered device
When devnames are used as device ids and devnames change,
then new devices need to be located for the PVs.  If the old
devname is now used by a filtered device, this was preventing
the code from searching for the new device, so the PV was
reported as missing.
2021-12-20 14:22:17 -06:00
David Teigland
459d931a9b device_id: match different dm device names
If a devices file entry for a dm device is using the devname
for the device id, then recognize different dm names as matching.
2021-12-20 14:22:17 -06:00
David Teigland
fad2b3dc8c filter-sysfs: support old kernels without sys/dev/block
rhel5 for example doesn't have /sys/dev/block
2021-12-20 14:22:17 -06:00
David Teigland
f732f3d53f lvmdevices: increase open file limit 2021-12-20 14:22:17 -06:00
David Teigland
f73be4480a filter-sysfs: skip when device id is set
When a device id is set for a device, using an idtype other
than devname, it means that sysfs has been used with the device
to match the device id.  So, checking for a sysfs entry for the
device in filter-sysfs is redundant.  For any other cases not
covered by this (e.g. devname ids), have filter-sysfs simply
stat /sys/dev/block/major:minor to test if the device exists
in sysfs.

The extensive processing done by filter-sysfs init is removed.
It was taking an immense amount of time with many devices, e.g.
. 1024 PVs in 520 VGs
. 520 concurrent vgchange -ay <vgname> commands
. vgchange scans only PVs in the named VG (based on pvs_online
  files from a pending patch)

A large number of the vgchange commands were taking over 1 min,
and nearly half of that time was used by filter-sysfs init.
With this patch, the vgchange commands take about half the time.
2021-12-20 14:22:17 -06:00
David Teigland
00ebabfe6e hints: remove the cmd hints list
which is no longer used after commit
"toollib: remove all devices list from process_each_pv"
2021-12-20 14:22:17 -06:00
David Teigland
074fce5c73 vgimportdevices: skip lvmlockd locking
Help bootstrapping existing shared vgs into the devices file.
Reading the vg in vgimportdevices would require locking to be
started, but vgchange lockstart won't see the vg if it's not
in the devices file.  The lvmlockd locks are not protecting
vg modifications so skipping them here won't be a problem.
2021-12-20 14:22:17 -06:00
David Teigland
a5a2d5fa1e pvscan: fix messages from coverity changes 2021-12-20 14:22:17 -06:00
David Teigland
2091305b79 Revert "pvscan: only add device args to dev cache"
This reverts commit 33e47182f7.
2021-12-20 14:22:17 -06:00
David Teigland
63c4458aaf Revert "new udev autoactivation"
This reverts commit 67722b3123.
2021-12-20 14:22:02 -06:00
Marian Csontos
ef4521831d pre-release 2021-10-20 11:12:39 +02:00
Marian Csontos
36be4d68f6 WHATS_NEW: update 2021-10-20 11:10:37 +02:00
David Teigland
33e47182f7 pvscan: only add device args to dev cache
Optimize the common pvscan --cache command by only adding
the necessary devs to dev-cache.
2021-10-19 17:13:57 -05:00
Zdenek Kabelac
60dc44b707 dev-cache: enhance dir scan also for non-udev build 2021-10-18 21:50:56 +02:00
Zdenek Kabelac
88e0d68909 dev-cache: better detection of filesystem
It appear on some systems the first found dev might not be actually for
the filesytem - so use a better way through _cache.st_dev.
2021-10-18 21:16:53 +02:00
Zdenek Kabelac
c60bac4661 configure: update 2021-10-18 19:17:27 +02:00
Zdenek Kabelac
1b104ddb55 configure.ac: remove unused part
As we are not using 'enable-compat' for anything, remove this section.
Also remove duplicated check for blkid.
Move setting of some AC_ARG_ENABLE defaults into the macro so it's always
defined.
2021-10-18 19:17:27 +02:00
Zdenek Kabelac
a172a02a9a cleanup: use const char buffer 2021-10-18 19:17:27 +02:00
Zdenek Kabelac
9cf4eac250 dev-cache: skip different filesystems on dir scan
When scanning configured  /dev dir, avoid entring
directories with different filesystem.

This minimizes risk we will block on i.e. entring
directory with mount point.
2021-10-18 19:17:26 +02:00
Zdenek Kabelac
bae1083472 cov: check device_ids_write return code
At least 'stack' failure code path as the
function device_id_update_vg_uuid() is void.
2021-10-15 23:40:56 +02:00
Zdenek Kabelac
c2be6c38d5 cov: ensure id is always initialize
Always resed sd_id128_t id and report warning in case
sd_id128_get_machine_app_specific() does not exit with 0.
2021-10-15 23:40:56 +02:00
Zdenek Kabelac
882141eb8c cov: check pointer before dereferencing
Check pv2 is non-null before trying to deref its tags.
2021-10-15 23:40:56 +02:00
Zdenek Kabelac
65ba4964df cov: do not drop already known error state
Do not try to 'discover' another error state, when ENOMEM
is already detected.
2021-10-15 23:40:56 +02:00
Zdenek Kabelac
e7b5f490c5 cov: ignore close result 2021-10-15 23:40:29 +02:00
Zdenek Kabelac
6668d6409a cov: validate subcommand existance
Before dereference of subcommand pointer, check it's not NULL
as  coverity believes there exists theoretical path for this...
2021-10-15 23:39:25 +02:00
Zdenek Kabelac
2779830a06 cov: avoid using NULL info
Check lvmcache info exists before calling lvmcache_del_save_bad_mda().
2021-10-15 23:36:22 +02:00
Zdenek Kabelac
8aefd97252 configure: fix use of withval
Newly added option --with-default-use-devices-file needs to use withval.
2021-10-15 23:35:05 +02:00
Zdenek Kabelac
bf87b8354d configure: update 2021-10-15 10:11:34 +02:00