summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* raid: fix (de)activation of RaidLVs with visible SubLVsdev-mcsontos-wip-2.02.184Heinz Mauelshagen2019-03-068-166/+214
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's a small window during creation of a new RaidLV when rmeta SubLVs are made visible to wipe them in order to prevent erroneous discovery of stale RAID metadata. In case a crash prevents the SubLVs from being committed hidden after such wiping, the RaidLV can still be activated with the SubLVs visible. During deactivation though, a deadlock occurs because the visible SubLVs are deactivated before the RaidLV. The patch adds _check_raid_sublvs to the raid validation in merge.c, an activation check to activate.c (paranoid, because the merge.c check will prevent activation in case of visible SubLVs) and shares the existing wiping function _clear_lvs in raid_manip.c moved to lv_manip.c and renamed to activate_and_wipe_lvlist to remove code duplication. Whilst on it, introduce activate_and_wipe_lv to share with (lvconvert|lvchange).c. Resolves: rhbz1633167 (cherry picked from commit dd5716ddf258c4a44819fa90d3356833ccf767b4) Conflicts: WHATS_NEW lib/activate/activate.c lib/metadata/lv_manip.c lib/metadata/raid_manip.c tools/lvchange.c tools/lvconvert.c
* dmsetup: Fix multi-line concise table parsingAlasdair G Kergon2019-03-051-1/+1
| | | | | | | | | Use the correct loop variable within the loop, instead of reusing the initial value. Table lines after the first don't get terminated in the right place. Signed-off-by: Kurt Garloff <kurt@garloff.de> (cherry picked from commit ccfbd505fea2f259f7c89dc23b020b838363a611)
* dm: migration_threshold for old linked toolsZdenek Kabelac2019-03-052-3/+18
| | | | | | | | | | | Just like with precending lvm2 device_mapper patch, ensure that old users of libdm will also get fixed migration threshold for caches. (cherry picked from commit 74ae1c5bc1150005ae6e82c90415c433f4a24cbd) Conflicts: WHATS_NEW_DM
* stats: initilize regions to NULLZdenek Kabelac2019-03-051-1/+1
| | | | | | | Commit 3750b0cff5ab1c41076afdf8275e3fa20aa756d0 used bad: error path in more occasions thus it now needs regions defined as NULL. (cherry picked from commit 83c6f7e7e6e76199d836bf694266c78e3cbc12f1)
* stats: fix error path when region is NULLZdenek Kabelac2019-03-051-5/+5
| | | | | | | | We should not call _stats_cleanup_region_ids() when regions are NULL. Also add backtracing for goto. (cherry picked from commit 3750b0cff5ab1c41076afdf8275e3fa20aa756d0)
* libdm: add memory barrierZdenek Kabelac2019-03-051-0/+2
| | | | | | | | | | | | | | Just for case ensure compiler is not able to optimize memset() away for resources that are released. This idea of using memory barrier is taken from openssl. Other options would be to check for 'explicit_bzero' function. (cherry picked from commit 55a8d6c86b4c6c6c707cfcc3dd887bca0632114f) Conflicts: device_mapper/ioctl/libdm-iface.c
* libdm: print params only for ioctls using themZdenek Kabelac2019-03-052-8/+30
| | | | | | | | | | | | When preparing ioctl buffer and flatting all parameters, add table parameters only to ioctl that do process them. Note: list of ioctl should be kept in sync with kernel code. (cherry picked from commit 43f8da76997a22be123e97b6d0f357d6ec2d0c7c) Conflicts: WHATS_NEW_DM device_mapper/ioctl/libdm-iface.c
* libdm: add DM_DEVICE_ARM_POLLZdenek Kabelac2019-03-053-1/+7
| | | | | | | | | | | Expose DM_DEVICE_ARM_POLL via standard API enum. (cherry picked from commit 1ae5bf2b833a5d55cf97de1619cc820d4e8c394f) Conflicts: WHATS_NEW_DM device_mapper/all.h device_mapper/ioctl/libdm-iface.c
* cleanup: move cast to det_t into MKDEV macroZdenek Kabelac2019-03-0510-17/+17
| | | | | | | | | | (cherry picked from commit aa8b2d6a0feb91bb5ea4364cdc53a00dfa233dca) Conflicts: daemons/clvmd/clvmd-common.h device_mapper/ioctl/libdm-iface.c device_mapper/libdm-common.c device_mapper/libdm-deptree.c
* cov: remove unused assignsZdenek Kabelac2019-03-053-8/+5
| | | | | | | | (cherry picked from commit 70e3d0a613fb53e52f7a7cb31d65bcc2fa7ab738) Conflicts: tools/pvscan.c tools/vgchange.c
* cov: hide intentionaly ptr arithmetic reportZdenek Kabelac2019-03-051-0/+1
| | | | | | Only single region count is ever replaced with on-stack uint64_t. (cherry picked from commit a91ac41b93eff0f3ebd3af3319e8bbcb1fe8d00f)
* cov: mark warning as expected oneZdenek Kabelac2019-03-051-0/+2
| | | | | | | | (cherry picked from commit 9238b972c543a83fbd553cc44a916608809cfc53) Conflicts: base/data-struct/radix-tree-adaptive.c device_mapper/libdm-file.c
* cov: split check for type assignmentZdenek Kabelac2019-03-051-4/+5
| | | | | | | | | Check that type is always defined, if not make it explicit internal error (although logged as debug - so catched only with proper lvm.conf setting). This ensures later type being NULL can't be dereferenced with coredump. (cherry picked from commit 79879bd201d4156312bb03fc0b7228ce34a3bf38)
* cov: shutdown warningZdenek Kabelac2019-03-051-0/+2
| | | | | | | Since previous patch reverted coverity patch as this case is intentional, provide override this coverity warning. (cherry picked from commit 05b57748274492aa76e530e4513e5f8e9a39a735)
* revert "cov: dm stats missed terminating null"Zdenek Kabelac2019-03-051-2/+2
| | | | | | | This reverts commit 20971f7034cbd329f873e08869bfb7acf3f1ac0e as the parsing of 'dmstatus' started to fail on present \0 char. (cherry picked from commit 6179cab877442aac884a0bfcd5c5541396980cdf)
* cov: ensure vars are setZdenek Kabelac2019-03-051-1/+1
| | | | | | | | | | Make sure, tmp_begin and tmp_end are always set, even for blind coverity. (cherry picked from commit 251366146727aac97af5de2eef855860d14910ca) Conflicts: device_mapper/libdm-report.c
* cov: dmstats check for failing mallocMarian Csontos2019-03-051-1/+4
| | | | | | Add missing check for allocation success. Backported from: 9b7121226258f7dfe759cc1f8625cbfb80fec161
* cov: dm stats missed terminating nullZdenek Kabelac2019-03-051-2/+2
| | | | | | | Coverity noticed allocating insufficient memory for the terminating null of the string. (cherry picked from commit 20971f7034cbd329f873e08869bfb7acf3f1ac0e)
* io: increase the default io memory from 4 to 8 MiBDavid Teigland2019-03-042-2/+2
| | | | | | | | | | | | | | This is the default bcache size that is created at the start of the command. It needs to be large enough to hold a single copy of metadata for a given VG, or the VG cannot be read or written (since the entire VG would not fit into available memory.) Increasing the default reduces the chances of anyone needing to increase the default to use their VG. The size can be set in lvm.conf global/io_memory_size; the lower limit is 4 MiB and the upper limit is 128 MiB.
* io: warn when metadata size approaches io memory sizeDavid Teigland2019-03-044-0/+63
| | | | | | When a single copy of metadata gets within 1MB of the current io_memory_size value, begin printing a warning that the io_memory_size should be increased.
* config: add new setting io_memory_sizeDavid Teigland2019-03-046-20/+45
| | | | | | which defines the amount of memory that lvm will allocate for bcache. Increasing this setting is required if it is smaller than a single copy of VG metadata.
* pvscan.service.in: Move StartLimitInterval to Service sectionMarcos Paulo de Souza2019-02-281-1/+1
| | | | | | | | | | | Without this patch, pvscan service file contains StartLimitInterval at the Unit section, which trigger an error: Unknown lvalue 'StartLimitInterval' in section 'Unit' Moving StartLimitInterval to Service section fixes the issue. Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.de>
* tests: add scan_lvs.shDavid Teigland2019-02-201-0/+47
|
* WHATS_NEW: scan_lvsDavid Teigland2019-02-201-0/+2
|
* tests: set scan_lvs=1 in tests that stack PVs on LVsDavid Teigland2019-02-2010-0/+19
|
* config: change scan_lvs default to 0David Teigland2019-02-201-1/+1
| | | | so that lvm does not scan LVs for PVs by default.
* filter: add config setting to skip scanning LVsDavid Teigland2019-02-207-8/+36
| | | | | | | | | | | devices/scan_lvs (default 1) determines whether lvm will scan LVs for layered PVs. The lvm behavior has always been to scan LVs, but it's rare for LVs to have layered PVs, and much more common for there to be many LVs that substantially slow down scanning with no benefit. This is implemented in the usable filter, and has the same effect as listing all LVs in the global_filter.
* apply obtain_device_list_from_udev to all libudev usage2018-06-01-stableDavid Teigland2019-02-051-0/+6
| | | | | | | | | | | udev_dev_is_md_component and udev_dev_is_mpath_component are not used for obtaining the device list, but they still use libudev for device info. When there are problems with udev, these functions can get stuck. So, use the existing obtain_device_list_from_udev config setting to also control whether these "is component" functions are used, which gives us a way to avoid using libudev entirely when it's causing problems.
* lvmlockd: fix make lockstart waitDavid Teigland2019-01-311-1/+1
| | | | when building without lvmlockd
* lvmlockd: make lockstart wait for existing startDavid Teigland2019-01-315-9/+21
| | | | | | | | | | | | | | | | | | If there are two independent scripts doing: vgchange --lockstart vg lvchange -ay vg/lv The first vgchange to do the lockstart will wait for the lockstart to complete before returning. The second vgchange to do the lockstart will see that the start is already in progress (from the first) and will do nothing. This means the second does not wait for any lockstart to complete, and moves on to the lvchange which may find the lockspace still starting and fail. To fix this, make the vgchange lockstart command wait for any lockstart's in progress to complete.
* spec: Use python3 setuptools with python3Marian Csontos2019-01-031-1/+1
|
* lvmanip: uninitialized members in struct pv_list (#10)Ming-Hung Tsai2018-12-192-1/+2
| | | | | | | | | | | | | | | Scenario: Given an existed LV `lvol0`, I want to create another LV on the PVs used by `lvol0`. I use `build_parallel_areas_from_lv()` to obtain the `pv_list` of each segments. However, the returned `pv_list` is not properly initialized, which causes segfault in subsequent operations. (cherry picked from commit 859feb81e5b61ac2109b1d7850844ccf1ce3e5bf) (cherry picked from commit 219ba4f54a462c175f5e9acaa0558afac94d5ff7) Conflicts: WHATS_NEW
* post-releaseMarian Csontos2018-12-074-2/+8
|
* pre-releasev2_02_183Marian Csontos2018-12-074-6/+9
|
* build: make generateMarian Csontos2018-12-071-0/+5
|
* libdm: do not add params for resume and removeZdenek Kabelac2018-12-062-0/+3
| | | | | | | | | | | | | | | | | | | DM_DEVICE_CREATE with table is doing several ioctl operations, however only some of then takes parameters. Since _create_and_load_v4() reused already existing dm task from DM_DEVICE_RELOAD it has also kept passing its table parameters to DM_DEVICE_RESUME ioctl - but this ioctl is supposed to not take any argument and thus there is no wiping of passed data - and since kernel returns buffer and shortens dmi->data_size accordingly, anything past returned data size remained uncleared in zfree() function. This has problem if the user used dm_task_secure_data (i.e. cryptsetup), as in this case binary expact secured data are erased from main memory after use, but they may have been left in place. This patch is also closing the possible hole for error path, which also reuse same dm task structure for DM_DEVICE_REMOVE.
* pvscan lvmetad: use udev info to improve md component detectionDavid Teigland2018-12-035-15/+71
| | | | | | | When no md devs are started, pvscan will only scan the start of an md component, and if it has a superblock at the end may not exclude it. udev may already have info identifying it as an md component, so use that.
* lvmetad: fix disabling in previous commitDavid Teigland2018-11-301-4/+14
| | | | it broke the case where a connection already exists.
* lvmetad: only disable if repair will do somethingDavid Teigland2018-11-303-6/+42
| | | | | | | | | lvconvert --repair would disable lvmetad at the start of the command. This would leave lvmetad disabled even if the command did nothing. Move the step to disable lvmetad until later, just before some actual repair is done. There are now numerous cases where nothing is actually done and lvmetad is not disabled.
* pvscan lvmetad: use full md filter when md 1.0 devices are presentDavid Teigland2018-11-291-0/+19
| | | | | | | | | | | Apply the same logic to pvscan/lvmetad that was added to the non-lvmetad label_scan in commit 3fd75d1b: scan: use full md filter when md 1.0 devices are present Before scanning, check if any of the devs on the system are md 0.90/1.0, and if so make the scan read both the start and the end of the device so that the components of those md versions can be ignored.
* scan: md metadata version 0.90 is at the end of diskPeter Rajnoha2018-11-292-4/+4
| | | | | | | | | commit de28637 scan: use full md filter when md 1.0 devices are present missed the fact that md superblock version 0.90 also puts metadata at the end of the device, so the full md filter needs to be used when either 0.90 or 1.0 is present.
* WHATS_NEW: sync ioDavid Teigland2018-11-201-0/+1
|
* bcache: sync io fixesDavid Teigland2018-11-201-22/+47
| | | | | | | | fix lseek error check fix read/write error checks handle zero return from read and write don't return an error for short io fix partial read/write loop
* io: use sync io if aio failsDavid Teigland2018-11-207-4/+74
| | | | | | | | | | | | | | | | | | io_setup() for aio may fail if a system has reached the aio request limit. In this case, fall back to using sync io. Also, lvm use of aio can be disabled entirely with config setting global/use_aio=0. The system limit for aio requests can be seen from /proc/sys/fs/aio-max-nr The current usage of aio requests can be seen from /proc/sys/fs/aio-nr The system limit for aio requests can be increased by setting fs.aio-max-nr using sysctl. Also add last-byte limit to the sync io code.
* update WHATS_NEWDavid Teigland2018-11-061-0/+1
|
* devices: reuse bcache fd when getting block sizeDavid Teigland2018-11-061-8/+19
| | | | This avoids an unnecessary open() on the device.
* dmsetup: fix stats report command outputBryn M. Reeves2018-11-011-7/+3
| | | | | | | | | | | | | | Since the stats handle is neither bound nor listed before the attempt to call dm_stats_get_nr_regions(), it will always return zero: this prevents reporting of any dmstats regions on any device. Remove the dm_stats_get_nr_regions() check and instead rely on the correct return status from dm_stats_populate() which only returns 0 in the case that there are regions to inspect (and which logs a specific error for all other cases). Reported-by: Bryan Gurney <bgurney@redhat.com>
* libdm-stats: move no regions warning after dm_stats_list()Bryn M. Reeves2018-11-011-5/+5
| | | | | | | It doesn't make sense to test or warn about the region count until the stats handle has been listed: at this point it may or may not contain valid information (but is guaranteed to be correct after the list).
* post-releaseMarian Csontos2018-10-304-2/+8
|
* pre-releasev2_02_182Marian Csontos2018-10-304-6/+6
|