summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* tests: integrity-caching: ensure raid redundancyHEADmastermainDavid Teigland2023-05-171-1/+4
| | | | | | | The recent fix 05c2b10c5d0a9 ensures that raid LV images are not using the same devices. This was happening in the lvextend commands used by this test, so fix the test to use more devices to ensue redundancy.
* raidintegrity: allow snapshotsDavid Teigland2023-05-113-8/+5
|
* Fix "multisegment RAID1, allocator uses one disk for both legs"heinzm2023-05-101-0/+41
| | | | | | | | In case of e.g. 3 PVs, creating or extending a RaidLV causes SubLV collocation thus putting segments of diffent rimage (and potentially larger rmeta) SubLVs onto the same PV. For redundant RaidLVs this'll compromise redundancy. Fix by detecting such bogus allocation on lvcreate/lvextend and reject the request.
* cov: remove unneeded header file inclusionZdenek Kabelac2023-05-101-1/+0
|
* cov: validate dev_get_primary_dev resultZdenek Kabelac2023-05-101-1/+2
| | | | Make sure primary_dev is defined when using it.
* vdo: document feature optionZdenek Kabelac2023-05-061-2/+2
|
* cov: remove unused but set variablesZdenek Kabelac2023-05-064-8/+6
|
* cleanup: correcting some log_printZdenek Kabelac2023-05-0614-91/+92
| | | | | Correcting to log_print_unless_silent(), so -qq can do some work.
* cov: some initializersZdenek Kabelac2023-05-062-6/+6
|
* cov: hide problem with 64bit time_tZdenek Kabelac2023-05-061-1/+1
|
* cov: validata top_lvZdenek Kabelac2023-05-061-0/+5
| | | | Add explicit pointer check is never NULL.
* cov: simplier codeZdenek Kabelac2023-05-061-14/+21
| | | | | Avoid coverity to contruct some abstract scenarions of 'cft' modification and simplify the code at the same time.
* Fix "lvconvert -m 0 will always take rimage_0 even if it is out-of-sync"heinzm2023-05-051-2/+11
| | | | | | Bail out in case first rimage is out-of-sync. Refresh first, i.e. "lvchange --resync $RaidLV", then retry downgrade to linear after resynchronization.
* lvreduce: make _lvseg_get_stripes handle integrity layerDavid Teigland2023-05-031-9/+26
| | | | | | | lvreduce uses _lvseg_get_stripes() which was unable to get raid stripe info with an integrity layer present. This caused lvreduce on a raid+integrity LV to fail prematurely when checking stripe parameters. An unhelpful error message about stripe size would be printed.
* lvmcache: fix valgrind error when dropping md duplicateDavid Teigland2023-04-251-0/+7
| | | | | | | When lvmcache info is dropped because it's an md component, then the lvmcache vginfo can also be dropped, but the list iterator was still using the list head in vginfo, so break from the loop earlier to avoid it.
* wipe_lv: use zeroing ioctl only for large sizesZdenek Kabelac2023-04-251-1/+1
| | | | | | | | | | | | There is no easy way to detect, whether device supports zeroing, and kernel also zeroes device when it's not directly supported, but with extra message: operation not supported error, dev X, sector Y op 0x9:(WRITE_ZEROES)... So to avoid generating such message with every 'lvcreate', use for zeroing of upto 8K just standard write of zeroed page. (maybe we can go with even larger sizes).
* fix dev_name use in add_areas_lineDavid Teigland2023-04-241-16/+29
| | | | | This function was relying on dev_name() returning NULL to indicate no device, but dev_name never returns NULL.
* cache: fix snapshot of cache with cachevolDavid Teigland2023-04-101-0/+2
| | | | | Creating a snapshot of a cache LV with a cachevol would fail because cache_check was not being skipped.
* remove extra change from support 16KB page sizeDavid Teigland2023-04-071-3/+0
|
* support 16KB page sizeDavid Teigland2023-04-072-0/+6
|
* vdo: use fixed size vdopool wrapperZdenek Kabelac2023-04-061-1/+1
| | | | | | | | | | | | | | Instead of using size of 'empty header' in vdopool use fixed size 4K for a 'wrappeing' vdo-pool device. This fixes the issue when user tried to activate vdo-pool after a conversion from vdo managed device with 'vgchange -ay' - where this command activated all LVs with 'vdo-pool' wrapping device as well, but this converted pool uses 0-length header. This 4k size should usually prevent other tools like 'blkid' recognize such device as anything - so it shouldn't cause any problems with duplicate indentification of devices.
* cleanup: rename functionZdenek Kabelac2023-04-061-2/+2
| | | | | Rename _thin_lv_has_device_id and use common function naming with _lv_has_thin_device_id().
* cleanup: simplifyZdenek Kabelac2023-04-061-4/+3
|
* integrity: hide creation of internal LVsZdenek Kabelac2023-04-061-2/+3
| | | | | Creation of 'hidden' local LVs should be visible only in verbose mode (-v) when creating a raid LV with integrity.
* raidintegrity: allow writecache and cacheDavid Teigland2023-04-051-0/+9
| | | | Allow writecache|cache over raid+integrity LV.
* vg_read: keep MISSING_PV when device with no mda reappearsDavid Teigland2023-03-081-6/+0
| | | | | | | | | Remove old code that became incorrect at some point. It's probably a fragment of an old condition that was left behind because it wasn't understood. We don't want to drop the MISSING_PV flag just because the PV has no mda in use. The device that was missing may have stale data, so the user needs to decide if the device should be removed or restored.
* lvresize: fix check for mounted and renamed LV to handle spacesDavid Teigland2023-02-231-9/+32
| | | | | | | | | | Replace spaces with \040 in directory paths from getmntent (mtab). The recent commit 5374a44c5712 compares mount point directory paths from /etc/mtab and /proc/mounts, in order to detect when a mounted LV has been renamed. The directory path comparison does not work correctly when the path contains spaces because getmntent uses ascii space chars and proc replaces spaces with \040.
* cov: avoid using strcpyZdenek Kabelac2023-02-173-10/+10
| | | | | | | Coverity is complaining about unchecked strcpy here, which is irelevant as we preallocate buffer to fit in copied string, however we could actually reuse these size and use just memcpy(). So lets make some simple conversions.
* pvscan: filter does not need to be checked for symlink namesDavid Teigland2023-02-153-51/+1
| | | | | | | With the recent use of DEVLINKS, there is no longer any real point in checking the filter for symlink names. Removing this check should not change behavior with or without symlinks in the filter.
* filesystem: use PATH_MAX for linux pathsZdenek Kabelac2023-02-121-6/+6
|
* metadata-exported.h: correcting definitionZdenek Kabelac2023-02-101-1/+1
| | | | | Fixing minor mismatch between definition and declaration of update_thin_pool_params().
* lvm: fix typosZdenek Kabelac2023-02-102-7/+7
| | | | | | Patch aec5e573afe610070eb2c6bed675d2a7c0efc7e8 was fixing some of typos only in generated file, but they need to be fixed in the source files.
* device_id: ignore quotes in device idDavid Teigland2023-02-062-2/+10
| | | | | | A t10 wwid string was found containing a " character which breaks vg metadata parsing. Ignore any quotation marks in device id strings.
* vg_read: remove unused code for md componentsDavid Teigland2023-02-021-43/+1
| | | | | This code was no longer used after ommit 87ee401eea3c3c3958ec5cda6e5c246b80503b8c
* archive: update messageZdenek Kabelac2023-02-011-1/+1
| | | | Better suggesting message as suggested by RHBZ 2123151.
* pvscan: recognize "pci" as a common symlink component in filtersDavid Teigland2023-01-311-0/+2
| | | | | In case the filter strings don't include "/dev/disk", and only include "pci".
* vgchange autoactivation: skip regex filter containing symlinksDavid Teigland2023-01-314-0/+66
| | | | | | | | | | | | "vgchange -aay --autoactivation event" is called by our udev rule. When the udev rule runs, symlinks for devices may not all be created yet. If the regex filter contains symlinks, it won't work correctly. This command uses devices that already passed through pvscan. Since pvscan applies the regex filter correctly, this command inherits the filtering from pvscan and can skip the regex filter itself. See the previous commit "pvscan: use alternate device names from DEVLINKS to check filter"
* pvscan: use alternate device names from DEVLINKS to check filterDavid Teigland2023-01-312-1/+2
| | | | | | | | | | | | pvscan --cache <dev> is called by our udev rule at a time when all the symlinks for <dev> may not be created yet (by other udev rules.) The regex filter in lvm.conf may refer to <dev> using a symlink name that hasn't yet been created, which would cause <dev> to not match the filter regex. The DEVLINKS env var, set by udev, contains all the symlink names for <dev> that have been or will be created. So, we add all these symlink names to dev->aliases, as if we had found them in /dev. This allows <dev> to be recognized by a regex filter containing a symlink for <dev>.
* lvresize: fail early if crypt device is missingDavid Teigland2023-01-303-1/+20
| | | | | If extending an LV with crypto_LUKS on it, and the crypt device is missing, then fail the command before extending the LV.
* lvresize: fail early if mounted LV was renamedDavid Teigland2023-01-263-0/+115
| | | | | | 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.
* Revert "lvresize: enable crypt resizing with --force"David Teigland2023-01-251-7/+3
| | | | | | | | | It looks like force was not being used to enable crypt resize, but rather to force an inconsistency between LV and crypt sizes, so this is either not needed or force in this case should have some other meaning. This reverts commit ed808a9b548ca59221d512bfb7ae581e8367fe50.
* lvresize: enable crypt resizing with --forceDavid Teigland2023-01-201-3/+7
| | | | | | | | Update previous commit "lvresize: only resize crypt when fs resize is enabled" to enable crypt resizing when --force is set and --resizefs is not set. This is because it's been allowed in the past and people have used it, but it's not a good idea.
* lvresize: only resize crypt when fs resize is enabledDavid Teigland2023-01-193-1/+31
| | | | | | | | | | | 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.
* vdo: resize requires active vdopool volumeZdenek Kabelac2023-01-161-0/+10
| | | | | ATM kernel VDO target does not handle resize of inactive VDO LVs so prevent users corrupting such LVs and require active such LVs.
* vdo: fix and enhance vdo constain checkingZdenek Kabelac2023-01-163-23/+82
| | | | | | | | Enhance checking vdo constains so it also handles changes of active VDO LVs where only added difference is considered now. For this also the reported informational message about used memory was improved to only list consuming RAM blocks.
* vdo: read live vdo size configurationZdenek Kabelac2023-01-165-0/+107
| | | | | | | | Introduce struct vdo_pool_size_config usable to calculate necessary memory size for active VDO volume. Function lv_vdo_pool_size_config() is able to read out this configuration out of runtime DM table line.
* vdo: check memory only in non critical sectionZdenek Kabelac2023-01-161-1/+3
| | | | | When we are actually resizing VDO device - we need to check size only in non-critical section - otherwise we are checking
* lvresize: use standard extent conversion functionZdenek Kabelac2023-01-161-1/+2
| | | | | We need to validate whether the requested resizing size can be expressed with given extent_size.
* fix typolilinjie2023-01-111-3/+3
| | | | | Signed-off-by: lilinjie <lilinjie@uniontech.com> (cherry picked from commit 81b1f5bc3bac0e2e9099b67162da7d1a4995c5f4)
* lvmlockd: Fix syntax error in previous commitMarian Csontos2023-01-111-1/+1
|