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

17 Commits

Author SHA1 Message Date
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
de7892f0af Revert "pvcreate: overwrite partition header with -f"
This reverts commit d5a950ca67.

This commit did not properly recognize GPT cases.
2022-01-18 12:15:03 -06:00
David Teigland
d5a950ca67 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 13:57:20 -06:00
David Teigland
9048565093 devices: rework libudev usage
related to config settings:
  obtain_device_info_from_udev (controls if lvm gets
    a list of devices from readdir /dev or from libudev)
  external_device_info_source (controls if lvm asks
    libudev for device information)

. Make the obtain_device_list_from_udev setting
  affect only the choice of readdir /dev vs libudev.
  The setting no longer controls if udev is used for
  device type checks.

. Change obtain_device_list_from_udev default to 0.
  This helps avoid boot timeouts due to slow libudev
  queries, avoids reported failures from
  udev_enumerate_scan_devices, and avoids delays from
  "device not initialized in udev database" errors.
  Even without errors, for a system booting with 1024 PVs,
  lvm2-pvscan times improve from about 100 sec to 15 sec,
  and the pvscan command from about 64 sec to about 4 sec.

. For external_device_info_source="none", remove all
  libudev device info queries, and use only lvm
  native device info.

. For external_device_info_source="udev", first check
  lvm native device info, then check libudev info.

. Remove sleep/retry loop when attempting libudev
  queries for device info.  udev info will simply
  be skipped if it's not immediately available.

. Only set up a libdev connection if it will be used by
  obtain_device_list_from_udev/external_device_info_source.

. For native multipath component detection, use
  /etc/multipath/wwids.  If a device has a wwid
  matching an entry in the wwids file, then it's
  considered a multipath component.  This is
  necessary to natively detect multipath
  components when the mpath device is not set up.
2021-07-13 11:11:23 -05:00
David Teigland
c74ccd5201 filters: nodata option
When filter_nodata_only is set, a filter that uses
data is skipped.
2020-10-21 16:24:16 -05:00
David Teigland
450f272b31 devices: support printing the filter that rejects a device
Use of this new message function needs to be added
to various commands to improve the output.
2020-10-01 12:00:09 -05:00
David Teigland
6620dc9475 add device hints to reduce scanning
Save the list of PVs in /run/lvm/hints.  These hints
are used to reduce scanning in a number of commands
to only the PVs on the system, or only the PVs in a
requested VG (rather than all devices on the system.)
2019-01-15 10:23:47 -06:00
David Teigland
8eab37593e Add cmd arg to more functions
so that it can be used in the filter code
2018-06-15 11:03:55 -05:00
Joe Thornber
d5da55ed85 device_mapper: remove dbg_malloc.
I wrote dbg_malloc before we had valgrind.  These days there's just
no need.
2018-06-08 13:40:53 +01:00
Joe Thornber
7f97c7ea9a build: Don't generate symlinks in include/ dir
As we start refactoring the code to break dependencies (see doc/refactoring.txt),
I want us to use full paths in the includes (eg, #include "base/data-struct/list.h").
This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in
metadata/ from base/
2018-05-14 10:30:20 +01:00
David Teigland
57bb46c5e7 filter: use bcache for filter reads
Filters are still applied before any device reading or
the label scan, but any filter checks that want to read
the device are skipped and the device is flagged.

After bcache is populated, but before lvm looks for
devices (i.e. before label scan), the filters are
reapplied to the devices that were flagged above.
The filters will then find the data they need in
bcache.
2018-05-10 16:03:19 -05:00
Zdenek Kabelac
fcbef05aae doc: change fsf address
Hmm rpmlint suggest fsf is using a different address these days,
so lets keep it up-to-date
2016-01-21 12:11:37 +01:00
Peter Rajnoha
00b610e542 filters: do not print [none:nil] as external device info's [source:handler] if "none" source is used
Print [source:handler] in filters' debug messages only if external
device info source other than "none" is used.

$ lvmconfig --type full devices/external_device_info_source
external_device_info_source="none

Before this patch (from the -vvvv log):

filters/filter-usable.c:47         /dev/mapper/test: Skipping: Too small to hold a PV [none:(nil)]
filters/filter-md.c:33         /dev/sdb: Skipping md component device [none:(nil)]
filters/filter-partitioned.c:25         /dev/vda: Skipping: Partition table signature found [none:(nil)]

With this patch applied:

filters/filter-usable.c:44         /dev/mapper/test: Skipping: Too small to hold a PV
filters/filter-md.c:35         /dev/sdb: Skipping md component device
filters/filter-partitioned.c:27         /dev/vda: Skipping: Partition table signature found
2015-09-03 14:19:48 +02:00
Zdenek Kabelac
af395e61d5 cleanup: drop unused header file 2015-02-19 14:44:04 +01:00
Peter Rajnoha
787f6ce04a filter-partitioned: use new 'udev' device status source to get partition status
Partitioned devices are marked in udev db as:
  ID_PART_TABLE="<partition table type name>"
and at the same time they are *not* marked with:
  ID_PART_ENTRY_DISK="<parent disk major:minor>"

Where partition table type name is dos/gpt/... But checking the presence
of this variable is enough for LVM here - it just needs to know whether
there's a partition table or not, not interested in the actual type.
The same applies for parent disk major:minor.
2015-01-30 13:17:12 +01:00
Peter Rajnoha
2fc126b00d filter-usable: move check for pv_min_size from filter-partitioned to filter-usable and use new 'udev' external device info source for this check
The filter-partitioned code should contain only checks in "partition" domain.

The check for pv_min_size should actually be a part of filter-usable.
If the device size is less than pv_min_size, such device is not usable
as a PV so this check clearly belongs here logically.

With udev external info source, we can get device size via libudev's
sysfs reading interface and we can avoid opening the device this way
effectively.
2015-01-30 13:01:12 +01:00
Alasdair G Kergon
80bcdb93ff filters: check for mpath before opening devs
Split out the partitioned device filter that needs to open the device
and move the multipath filter in front of it.

When a device is multipathed, sending I/O to the underlying paths may
cause problems, the most obvious being I/O errors visible to lvm if a
path is down.

Revert the incorrect <backtrace> messages added when a device doesn't
pass a filter.

Log each filter initialisation to show sequence.

Avoid duplicate 'Using $device' debug messages.
2013-08-13 23:26:58 +01:00