summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* udev: import previous results of blkid when in suspended staterhel-9.2.0Yu Watanabe2023-02-092-2/+16
| | | | | | | | | | | | | | | | | Follow-up for e10f67e91728f1e576803df884049ecbd92874d0. The commit e10f67e91728f1e576803df884049ecbd92874d0 tries to keep device node symlinks even if the device is in the suspended state. However, necessary properties that may previously obtained by the blkid command were not imported at least in the .rules file. So, unless ID_FS_xyz properties are imported by another earlier .rules file, the device node symlinks are still lost when event is processed in the suspended state. Let's explicitly import the necessary properties. RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2158628 GHPR: https://github.com/lvmteam/lvm2/pull/105 (cherry picked from commit 94f77a4d8d9737fca05fb4e451678ec440c68670)
* lvresize: fail early if mounted LV was renamedDavid Teigland2023-02-094-0/+126
| | | | | | | | If a mounted LV is renamed, then fs resizing utilities will fail, so detect this condition and fail the command before any changes are made. (cherry picked from commit 5374a44c57127cdd832a675545c1d2bbf0b3751a)
* lvresize: only resize crypt when fs resize is enabledDavid Teigland2023-02-094-2/+36
| | | | | | | | | | | | | There were a couple of cases where lvresize, without --fs resize, was resizing the crypt layer above the LV. Resizing the crypt layer should only be done when fs resizing is enabled (even if the fs is already small enough due to being independently reduced.) Also, check the size of the crypt device to see if it's already been reduced independently, and skip the cryptsetup resize if it's not needed. (cherry picked from commit 3bb55765286dc8e4f0000957d85a6b8ee2752852)
* tests: lvresize-fs-crypt using helper only for crypt devDavid Teigland2023-02-091-0/+25
| | | | (cherry picked from commit 2580f007f0aaa3bf22c43295caa2c60c6142494f)
* build: Fix make rpm with VERSION_DM without dashMarian Csontos2023-01-271-1/+1
| | | | | | | | | When building RPM from a branch based on a release tag the expected -git suffix is missing breaking the script producing error like following one: error: line 215: Unterminated rich dependency: (2021-53.ge36b180a6.el9: Requires: device-mapper-devel >= 1.02.181 (2021-53.ge36b180a6.el9 (cherry picked from commit e60d7ce8e748cb6d51552879c162d01aafa17160)
* lvmdbusd: Add command_log_selection to command lineTony Asleson2023-01-261-16/+17
| | | | | Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2145114 (cherry picked from commit e63b0c7262f50ab43fcde1c50b6d880acab68407)
* lvmdbusd: Move get_error_msg to utilsTony Asleson2023-01-262-20/+20
| | | | | | Moving this so we can re-use outside of lvm_shell_proxy. (cherry picked from commit 8f60c494515ddccb20e4afb804edb6b9599e65c0)
* vgimportclone: fix importing PV without metadataDavid Teigland2023-01-261-2/+4
| | | | | | | | If one of the PVs in the VG does not hold metadata, then the command would fail, thinking that PV was from a different VG. Also add missing free on that error path. (cherry picked from commit c4b898a53eec39bc28b5451e7fde87945303a644)
* lvresize: fix cryptsetup resize in helperDavid Teigland2023-01-061-1/+1
| | | | | | | | | | typo used "cryptresize" as command name this affects cases where the file system is resized independently, and then the lvresize command is used which only needs to resize the crypt device and the LV. (cherry picked from commit 81acde7ffdf9fbe522ada16f89e429d9f729dc0c)
* lvextend: fix overprovisioning check for thin lvsDavid Teigland2022-12-221-2/+3
| | | | | | | | | | 18722dfdf4d3 lvresize: restructure code mistakenly changed the overprovisioning check from applying to all lv_is_thin_type lvs to only lv_is_thin_pool lvs, so it no longer applied when extending thin lvs. The result was missing warning messages when extending thin lvs. (cherry picked from commit 4baef0f93f608403b6f2db445e7bf1e80f8f3ee6)
* device_id: fix segfault verifying serial for non-pvDavid Teigland2022-12-062-2/+83
| | | | | | | | | The recent change that verifies sys_serial system.devices entries using the PVID did not exclude non-PV devices from being checked. The verification code would attempt to use du->pvid which was null for the non-PVs causing a segfault. (cherry picked from commit 6613a61d3b5ce4d12a6fef79195eac34f30ef4da)
* pre-releasev2_03_17Marian Csontos2022-11-104-6/+9
|
* make: generateMarian Csontos2022-11-101-1/+3
|
* vdo: improve validation messageZdenek Kabelac2022-11-081-3/+3
| | | | Rephrase.
* lvcreate: fix error path return valuesZdenek Kabelac2022-11-081-3/+3
| | | | | Return failing error code for return path, as 'return 0' in this case was returning success.
* tests: update test to handle different statusZdenek Kabelac2022-11-081-3/+4
| | | | | | | Since now we change deduplication with V4 table line change, the modification tends to be faster and we can capture for a few ms also 'status' about opening or closing deduplication index. Use 'grep -E' to handle both words.
* vdo: enhance detection of virtual sizeZdenek Kabelac2022-11-081-13/+31
| | | | | | | | | | Improve detection of VDO virtual size - so it's not reading VDO metadata when VDO device is already active and instead we reuse existing table line for knowing existing metadata size. NOTE: if there is ever going to be added support for reduction of VDO virtual size - this method will need to be reworked to allow size difference only within 'extent_size' alignment.
* vdo: replace errors with debugZdenek Kabelac2022-11-081-16/+16
| | | | | | As we actully use reading of VDO metadata only as extra 'information' source, and not error command - switch to 'log_debug()' severity with messages out of parser code.
* devices: factor common list functionsDavid Teigland2022-11-0710-101/+102
| | | | which were duplicated in various places
* device_id: handle duplicate serial numbersDavid Teigland2022-11-077-2/+1185
| | | | | | | | | Handle multiple devices using the same serial number as their device id. After matching devices to devices file entries, if there is a discrepency between the ondisk PVID and the devices file PVID, then rematch devices to devices file entries using PVID, looking at all disks on the system with the same serial number.
* device_id: look for serial number in other locationsDavid Teigland2022-11-073-2/+105
| | | | | | | | Only /sys/dev/block/major:minor/device/serial was read to find a disk serial number, but a serial number seems to be reported more often in other locations, so check these also: /sys/dev/block/major:minor/device/vpd_pg80 /sys/class/block/vda/serial (for virtio disks only)
* device_mapper: vdo V4 avoid messagingZdenek Kabelac2022-11-021-3/+7
| | | | | | With V4 format build table line with compression and deduplication and skip sending any messages to set up these parameters.
* dev_manager: accept misalined vdo pools.Zdenek Kabelac2022-11-022-11/+7
| | | | | Since lvm2 may create VDO pool virtual size aligned only on extent size while VDO itself is just 4K aligned - we need to support such misalign.
* device_mapper: add parser for vdo metadataZdenek Kabelac2022-11-024-1/+298
| | | | | | | | | Add very simplistic parser of vdo metadata to be able to obtain logical_blocks stored within vdo metadata - as lvm2 may submit smaller value due to internal aligment rules. To avoid creation of mismatching table line - use this number instead the one provided by lvm2.
* configure: update use_devicesfile in example.confZdenek Kabelac2022-11-022-0/+3
| | | | | Example.conf missed to properly replace default value for use_devicesfile setting and left there @VAR@.
* vgchange systemid: use tag or selectDavid Teigland2022-10-311-1/+2
| | | | | The command can do this but the command defs were missing the annotation to allow it.
* device_id: remove debug traceDavid Teigland2022-10-241-1/+1
| | | | for common case where a device id type is not used.
* cmd: save device_id_sysfs_dirDavid Teigland2022-10-243-3/+3
| | | | | read and save device_id_sysfs_dir to avoid spamming debug output from find_config_tree_str.
* lvmdbusd: Handle PV signature copyTony Asleson2022-10-201-3/+7
| | | | | If something manually copies a PV signature to a block device we will miss it. Handle this case too.
* lvmdbustest: Add test for copy signatureTony Asleson2022-10-201-11/+60
| | | | | Add test to ensure we detect when a PV signature is copied to a block device.
* lvmdbusd: Always leverage udevTony Asleson2022-10-203-14/+15
| | | | | | | | | | | | | Previously we utilized udev until we got a dbus notification from lvm command line tools. This however misses the case where something outside of lvm clears the signatures on a block device and we fail to refresh the state of the daemon. Change the behavior so we always monitor udev events, but ignore those udev events that pertain to lvm members. Note: --udev command line option no longer does anything and simply outputs a message that it's no longer used. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1967171
* lvmdbustest: Add test for wipefsTony Asleson2022-10-201-0/+34
| | | | | Ensure that if an external program or user calles wipefs on a PV that we correctly update the state of the daemon.
* lvmnotify.c: Check to see if dbus daemon is runningTony Asleson2022-10-191-0/+68
| | | | | | | | | | | | The lvm dbus daemon will auto activate on dbus API calls. To prevent the dbus daemon starting when lvm command line tools are being used we will check to see if the daemon is running first. If the daemon is not running, we will not notify the daemon. For this check to work it requires the changes done previously with commit: 3fdf4493481ff8baae2ac5416dce6d05b69e6b28 Reviewed-by: David Teigland <teigland@redhat.com>
* lvreduce: change error message about --fs optionsDavid Teigland2022-10-121-1/+1
|
* lvmlockd: Fix sanlock lvmlock lv size calculationcorubba2022-10-121-1/+3
| | | | | | | | | | | | | | | | | | | | | The number of extents for the sanlock lvmlock lv is calculated using integer division, which rounds towards zero. With a physical extent size of 129M, instead of the requested 256M the lv is only 129M (1 extent). With any physical extent size greater than 256M the lv creation fails because the number of extents is zero. This is fixed by replacing the integer division with a division macro that rounds up and thus guarantees that the size of the lv will always be equal or greater than the requested size. Using the examples above, a pes of 129M will result in a 258M lv (2 extents), pes of 300M in a 300M lv (1 extent). The re-calculation of the lv size in bytes and megabytes is only so the debug output shows the correct values. The size in mb there is still not byte-perfect-accurate, but good enough for a human-readable estimate; and the exact size in bytes and extents is right next to it. Signed-off-by: corubba <corubba@gmx.de>
* toollib: do not process just created historical LVPeter Rajnoha2022-10-124-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When executing process_each_lv_in_vg, we process live LVs first and after that, we process any historical LVs. In case we have just removed an LV, which also means we have just made it "historical" and so it appears as fresh item in vg->historical_lvs list, we have to skip it when we get to processing historical LVs inside the same process_each_lv_in_vg call. The simplest approach here, without introducing another LV list, is to simply mark such historical LVs as "fresh" directly in struct historical_logical_volume when we have just removed the original LV and created the historical LV for it. Then, we just need to check the flag when processing historical LVs and skip it if it is "fresh". When we read historical LVs out of metadata, they are marked as "not fresh" and so they can be processed as usual. This was mainly an issue in conjuction with -S|--select use: # lvmconfig --type diff metadata { record_lvs_history=1 } (In this example, a thin pool with lvol1 thin LV and lvol2 and lvol3 snapshots.) # lvs -H vg -o name,pool_lv,full_ancestors,full_descendants LV Pool FAncestors FDescendants lvol1 pool lvol2,lvol3 lvol2 pool lvol1 lvol3 lvol3 pool lvol2,lvol1 pool # lvremove -S 'name=lvol2' Logical volume "lvol2" successfully removed. Historical logical volume "lvol2" successfully removed. ...here, the historical LV lvol2 should not have been removed because we have just removed its original non-historical lvol2 and the fresh historical lvol2 must not be included in the same processing spree.
* lvreduce: require active LV when no fs option is usedDavid Teigland2022-10-112-3/+8
| | | | | Without an --fs option set, make lvreduce of an inactive LV fail and report that the LV must be active.
* tests: add comments to fsadm-renamedDavid Teigland2022-10-111-0/+15
| | | | | to explain the what and why of the steps that are not obvious
* lvmlockd: fix warningDavid Teigland2022-10-111-1/+1
|
* tests: skip lvresize tests without mkfs.xfsDavid Teigland2022-10-102-0/+4
|
* lvmdevices: use deviceidtype option strictlyDavid Teigland2022-10-106-11/+20
| | | | | Only use the device id type specified by --deviceidtype, and fail if that type is not available for the device.
* tests: device ids using vpd dataDavid Teigland2022-10-101-0/+201
|
* device id: add new types using values from vpd_pg83David Teigland2022-10-105-2/+112
| | | | | | | | | | | | | | | | | | | | | | | | | The new device_id types are: wwid_naa, wwid_eui, wwid_t10. The new types use the specific wwid type in their name. lvm currently gets the values for these types by reading the device's vpd_pg83 sysfs file (this could change in the future if better methods become available for reading the values.) If a device is added to the devices file using one of these types, prior versions of lvm will not recognize the types and will be unable to use the devices. When adding a new device, lvm continues to first use sys_wwid from the sysfs wwid file. If the device has no sysfs wwid file, lvm now attempts to use one of the new types from vpd_pg83. If a devices file entry with type sys_wwid does not match a given device's sysfs wwid file, the sys_wwid value will also be compared to that device's other wwids from its vpd_pg83 file. If the kernel changes the wwid type reported from the sysfs wwid file, e.g. from a device's t10 id to its naa id, then lvm should still be able to match it correctly using the vpd_pg83 data which will include both ids.
* device id: change space handling in t10 wwidDavid Teigland2022-10-101-3/+58
| | | | | | | t10 wwids are now edited in the same way that multipath does, which is replacing a series of spaces with one _. Previously lvm replaced every space with one _. Devices file entries with the old form will be converted to the new shorter form.
* device id wwid adjustmentsDavid Teigland2022-10-105-192/+244
| | | | | | | | | | | | | | | Move the functions handling dev wwids. Add dev flags indicating that wwids have been read from sysfs wwid file or sysfs vpd_pg83 file. This can be used to avoid rereading these. Improve filter-mpath search for a device's wwid in /etc/multipath/wwids, to avoid unnecessary rereading of wwids from sysfs files. Type 8 wwids from vpd_pg83 with naa or eui names should be saved as those types.
* lvmlockd: purge the lock resources left in previous lockspaceLidong Zhong2022-10-073-1/+97
| | | | | | | | | | If lvmlockd in cluster is killed accidently or any other reason, the lock resources will become orphaned in the VG lockspace. When the cluster manager tries to restart this daemon, the LVs will probably become inactive because of resource schedule policy and thus the lock resouce will be omited during the adoption process. This patch will try to purge the lock resources left in previous lockspace, so the following actions can work again.
* lvresize: move the lockd_lv earlierDavid Teigland2022-10-031-7/+7
| | | | | the lock should cover any potential activation, not just the resizing changes
* lvmdbusd: Correct env. variableTony Asleson2022-09-302-2/+2
| | | | | Make this match the unit test expectation and the form we use for other env. variables.
* blkid: fix BLKID_SUBLKS_FSINFO usageDavid Teigland2022-09-291-7/+8
| | | | | Use this flag for all fs info lookups, including BLOCK_SIZE, if it is defined in blkid.h.
* lvresize: give special advice to reiserfs usersDavid Teigland2022-09-281-1/+11
|