summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* test: Some old systems do not have /etc/machine-iddev-mcsontos-fix-testsMarian Csontos2019-06-041-1/+3
| | | | IMHO it does not add much value running these tests on all the old systems.
* test: Increase latency in pvmove-resume-multisegMarian Csontos2019-06-031-2/+2
| | | | | | | | | | | The test was failing consistently on some VMs (F25), and inconsistently on Rawhide. With increased latency these failures are no longer reproducible. Reproducer: make check_lvmpolld T=pvmove-resume-multiseg.sh
* test: Restore testing of D-Bus APIMarian Csontos2019-05-311-4/+5
|
* tests: add debug to pvscan-cache deactivationDavid Teigland2019-05-231-1/+2
|
* tests: pvscan-cache more attempts to fixDavid Teigland2019-05-231-3/+1
|
* separate code for setting devices from metadata parsingDavid Teigland2019-05-236-54/+87
| | | | | Pull the code that sets devs for PVs out of the metadata parsing code and call it separately.
* WHATS_NEW: pvck --dumpDavid Teigland2019-05-231-0/+1
|
* pvck: new dump option to extract metadataDavid Teigland2019-05-239-3/+386
| | | | | | | The new command 'pvck --dump metadata PV' will extract the current version of VG metadata from a PV for testing and debugging. --dump metadata_area extracts the entire text metadata area.
* tests: change mkfs usage in lvconvert raid testsDavid Teigland2019-05-2311-11/+22
| | | | | The "echo y | mkfs" was failing at times from echo y. Remove echo y and replace with wipefs -a prior to mkfs.
* tests: fix error detection in lvconvert-raid-takeover.shDavid Teigland2019-05-231-1/+1
|
* tests: pvscan-cache try to fix teardown problemsDavid Teigland2019-05-221-0/+3
| | | | | | | teardown after the test was failing, probably because of uncoordinated udev actions running on the test system. Try to avoid this by doing some work before teardown.
* tests: fsadm-crypt.sh update mkfs parameterDavid Teigland2019-05-211-5/+5
| | | | mkfs.xfs was rejecting previously working value
* tests: pvscan-autoactivate.sh switch system_id_sourceDavid Teigland2019-05-211-1/+1
| | | | | to machineid instead of uname which would break if the test system had no proper uname set.
* tests: hints check if strace existsDavid Teigland2019-05-211-0/+3
| | | | | avoid test failure if test system does not have strace
* scan: expand and update label scan commentsDavid Teigland2019-05-211-28/+61
|
* hints: exclude md componentsDavid Teigland2019-05-214-3/+16
| | | | | | In some cases md components could be included in the hints, so add a check to hint creation to make sure they are excluded.
* move the setting of use_full_md_check flagDavid Teigland2019-05-214-9/+18
| | | | | from each command to one location in command init. No functional change.
* devs: rename dev_is_md dev_is_md_componentDavid Teigland2019-05-215-11/+24
| | | | | | The naming was confusing and misleading since it it's testing if a device is an md component, not an md device.
* tests: check accepting out-of-range creation_timeZdenek Kabelac2019-05-101-0/+40
|
* metadata: allow reading metadata with invalid creation_timeZdenek Kabelac2019-05-102-6/+30
| | | | | | | | | | | | | | | | lvm2 till version 2.02.169 (commit 78d004efa8a1809cea68283e6204edfa9d7c1091) was printing invalid creation_time argument into metadata on 32bit arch. However with commit ba9820b14223b731125c83dbc9709aa44fdcdbf1 we started to properly validate all input numbers and thus we refused to accept invalid metadata with 'garbage' string - but this results in the situation where metadata produced on older lvm2 on 32 bit architecture will become unreadable after upgrade. To fix this case - extend libdm parser in a way, that whenever we find error integer value, we also check if the parsed value is not for creation_time node and in this case we let the metadata pass through with made-up date 2018-05-24 (release date of 2.02.169).
* tests: split argsZdenek Kabelac2019-05-061-1/+1
| | | | Here we want args to be splited into individual strings.
* tests: drop call of wipefsZdenek Kabelac2019-05-041-4/+0
| | | | | | wipefs might not be present on test system. Devices are also already zeroed by cleanup_md_dev (which 'fakes' missing wipefs eventually)
* pvscan: fix segfault in recent commitDavid Teigland2019-05-031-1/+5
| | | | | | | | | commit aa75b31db5478 "pvscan: handle case of scanning PV without metadata last" failed to recognize that an arg may be null in the case of 'pvscan --cache' (without -aay) which does not keep track of complete VGs because it does not need to activate them.
* pvs: remove unnecessary label scanDavid Teigland2019-05-031-14/+1
| | | | | | | The scanning rework missed removing this instance of label scan. It's no longer needed because of the way that label scan is always run once from the start of the command. This unnecessary scan would be triggered by running 'pvs @tag'.
* tests: expand lvm-on-mdDavid Teigland2019-05-031-15/+136
| | | | test both md raid0 and raid1
* pvscan: don't record PV online after error reading metadataDavid Teigland2019-05-031-2/+18
|
* add md component check in vg_read based on sizeDavid Teigland2019-05-031-0/+12
| | | | | | | If an md component is not excluded by other means and vg_read is used to read metadata from it, then this new check compares the device size with the PV size, and runs a full md check on the device if the sizes don't match.
* tests: use luks1 for testZdenek Kabelac2019-05-031-1/+8
| | | | | | Since we do not need anywhere luks2 - pick older format which does not require password for resize to keep the rest of test unmodified.
* tests: update resize valueZdenek Kabelac2019-05-031-1/+1
| | | | | Since we now properly extend also _pmspare - there was not enough free space to add 8extents to both volumes.
* cleanup: use unsigned typeZdenek Kabelac2019-05-031-1/+1
|
* build: fix compilation without lvmlockdZdenek Kabelac2019-05-031-1/+2
|
* locking: validate locking modeZdenek Kabelac2019-05-031-0/+3
| | | | Ensure 'ret' is always defined and validate 'mode'.
* clean: avoid cleaning iterator on error pathZdenek Kabelac2019-05-031-2/+2
| | | | Return error dirrectly instead of using 'out' code path.
* scan: remove comments about lvmetadDavid Teigland2019-05-021-14/+4
|
* lvmlockd: fix snprintf warningsDavid Teigland2019-05-023-12/+24
|
* use memcpy for constant ondisk stringsDavid Teigland2019-05-023-9/+9
| | | | | | Use memcpy/memcmp for on disk strings which are not null terminated: FMTT_MAGIC, LVM2_LABEL and LABEL_ID. Quiets compile warnings.
* remove unused string writecacheDavid Teigland2019-05-011-2/+0
|
* lvmcache: remove unused flagDavid Teigland2019-04-301-9/+0
| | | | | The new label scan design is never called recursively, so we don't need a flag to check for that.
* vgcreate: remove the lvmcache locking workaroundDavid Teigland2019-04-301-15/+0
| | | | | | Recent cleanups and simplifications to lvmcache and locking mean that the odd locking to workaround other issues is now unnecessary.
* pvcreate: call label scan prior to pvcreate_each_deviceDavid Teigland2019-04-304-11/+10
| | | | | | and don't call it from inside pvcreate_each_device. This avoids having to repeat it for users of pvcreate_each_device (pvcreate/pvremove/vgcreate/vgextend.)
* pvscan: remove fixme comment that is fixedDavid Teigland2019-04-291-12/+0
| | | | | | Remove the fixme comment describing the case that was fixed by aa75b31db54782fb24b6b7e3c681a61b3579117c "pvscan: handle case of scanning PV without metadata last"
* hints: skip hint flock if nolocking option is setDavid Teigland2019-04-295-19/+28
|
* remove retry for missed PVs in process_each_pvDavid Teigland2019-04-291-105/+0
| | | | | This is no longer needed with the change to orphan and global locks.
* locking: unify global lock for flock and lockdDavid Teigland2019-04-2932-250/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There have been two file locks used to protect lvm "global state": "ORPHANS" and "GLOBAL". Commands that used the ORPHAN flock in exclusive mode: pvcreate, pvremove, vgcreate, vgextend, vgremove, vgcfgrestore Commands that used the ORPHAN flock in shared mode: vgimportclone, pvs, pvscan, pvresize, pvmove, pvdisplay, pvchange, fullreport Commands that used the GLOBAL flock in exclusive mode: pvchange, pvscan, vgimportclone, vgscan Commands that used the GLOBAL flock in shared mode: pvscan --cache, pvs The ORPHAN lock covers the important cases of serializing the use of orphan PVs. It also partially covers the reporting of orphan PVs (although not correctly as explained below.) The GLOBAL lock doesn't seem to have a clear purpose (it may have eroded over time.) Neither lock correctly protects the VG namespace, or orphan PV properties. To simplify and correct these issues, the two separate flocks are combined into the one GLOBAL flock, and this flock is used from the locking sites that are in place for the lvmlockd global lock. The logic behind the lvmlockd (distributed) global lock is that any command that changes "global state" needs to take the global lock in ex mode. Global state in lvm is: the list of VG names, the set of orphan PVs, and any properties of orphan PVs. Reading this global state can use the global lock in sh mode to ensure it doesn't change while being reported. The locking of global state now looks like: lockd_global() previously named lockd_gl(), acquires the distributed global lock through lvmlockd. This is unchanged. It serializes distributed lvm commands that are changing global state. This is a no-op when lvmlockd is not in use. lockf_global() acquires an flock on a local file. It serializes local lvm commands that are changing global state. lock_global() first calls lockf_global() to acquire the local flock for global state, and if this succeeds, it calls lockd_global() to acquire the distributed lock for global state. Replace instances of lockd_gl() with lock_global(), so that the existing sites for lvmlockd global state locking are now also used for local file locking of global state. Remove the previous file locking calls lock_vol(GLOBAL) and lock_vol(ORPHAN). The following commands which change global state are now serialized with the exclusive global flock: pvchange (of orphan), pvresize (of orphan), pvcreate, pvremove, vgcreate, vgextend, vgremove, vgreduce, vgrename, vgcfgrestore, vgimportclone, vgmerge, vgsplit Commands that use a shared flock to read global state (and will be serialized against the prior list) are those that use process_each functions that are based on processing a list of all VG names, or all PVs. The list of all VGs or all PVs is global state and the shared lock prevents those lists from changing while the command is processing them. The ORPHAN lock previously attempted to produce an accurate listing of orphan PVs, but it was only acquired at the end of the command during the fake vg_read of the fake orphan vg. This is not when orphan PVs were determined; they were determined by elimination beforehand by processing all real VGs, and subtracting the PVs in the real VGs from the list of all PVs that had been identified during the initial scan. This is fixed by holding the single global lock in shared mode while processing all VGs to determine the list of orphan PVs.
* wipe_lv: initially open LV in writable modeDavid Teigland2019-04-263-1/+14
| | | | | | wipe_lv knows it's going to write the device, so it can open rw from the start. It was opening readonly, and then dev_write needed to reopen it readwrite.
* cleanup: missed string specifierZdenek Kabelac2019-04-171-1/+1
|
* libdaemon: use pselect to avoid condition checking raceZdenek Kabelac2019-04-164-12/+31
| | | | | | | | | | To avoid tiny race on checking arrival of signal and entering select (that can latter remain stuck as signal was already delivered) switch to use pselect(). If it would needed, we can eventually add extra code for older systems without pselect(), but there are probably no such ancient systems in use.
* configure: check for pselectZdenek Kabelac2019-04-163-2/+8
|
* pvscan: handle case of scanning PV without metadata lastDavid Teigland2019-04-152-20/+145
| | | | | | | | | | | Handle the case where pvscan --cache -aay (with no dev args) gets to the final PV, completing the VG, but that final PV does not have VG metadata. In this case, we need to use VG metadata from a previously scanned PV in the same VG, which we saved for this possibility. Using this saved metadata, we can find which VG this PVID belongs to, and then check if that VG is now complete, and if so add the VG name to the list of complete VGs to be autoactivated.
* tests: disable unworking pvscan caseDavid Teigland2019-04-122-9/+25
| | | | and add corresponding fixme in the code