summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* metadata: Nuke the exported "pv_read" function.dev-mornfall-pvreadPetr Rockai2013-06-192-39/+0
|
* metadata: Fix handling of orphan PV linking & re-linking.Petr Rockai2013-06-191-3/+28
|
* metadata: Avoid pv_read in find_pv_by_name.Petr Rockai2013-06-191-14/+20
|
* pvremove: Avoid using pv_read in favour of scanning.Petr Rockai2013-06-191-34/+35
|
* test: Fix fallout from pv_read changes.Petr Rockai2013-06-192-15/+22
|
* pvresize: Do not use pv_read (get the PV from orphan VG).Petr Rockai2013-06-192-31/+16
|
* test: Add a test for the failing pv_read optimisation.Petr Rockai2013-06-191-0/+26
|
* toollib: Drop the bogus pv_read optimisation.Petr Rockai2013-06-191-49/+42
| | | | | | | | | | | | | | The toollib code for processing PVs given on commandline tried to be smart and use pv_read, avoiding real metadata scanning. The premise of the optimisation was that if there is an active MDA on the PV, it can be reliably used to establish VG membership. This assumption is however wrong, since it's entirely possible that this particular MDA is simply out of date, and the PV is not actually in any VG. While this is a subtle and rare bug, it's still a bug. One way to trigger it would be to hotplug an old disk which at some point was a PV in an existing VG, having a seemingly valid MDA but with an old sequence number. All commands that use normal scanning realize that this PV does not belong into the VG anymore, but anything based on pv_read alone will believe it does.
* metadata: Do not try to check vg_name of a NULL PV.Petr Rockai2013-06-191-1/+1
|
* cleanup: use parsed yes_no_argZdenek Kabelac2013-06-181-1/+1
| | | | | Do not parse yes_no_arg inside tools code and use already available result as uint.
* cleanup: return lv_is_ as 1 or 0Zdenek Kabelac2013-06-181-2/+2
| | | | Do not return 64bit values - return just plain int 0 or 1
* cleanup: easier to read loop codeZdenek Kabelac2013-06-182-38/+29
| | | | | buffer_write now accepts const pointer Simplify loops and drop goto when not needed.
* lvmetad: fix compare functionZdenek Kabelac2013-06-182-1/+2
| | | | | | | | | Check for enough space in preallocated buffer. Fixes problem, when lvm code started to suddenly allocate too big memory chunks. TODO: lvmetad protocol should announce needed size ahead, so if metadata have 1MB we are not reallocating memory...
* lvmetad: use dm_ malloc wrappersZdenek Kabelac2013-06-182-2/+2
| | | | Use matching dm_ functions for internally used buffers.
* vgcfgrestore: fix crash on restore of wrong vgnameZdenek Kabelac2013-06-183-0/+5
| | | | | | | | | | When vgname has not existed in metadata, it has crashed on double free in format_instance destroy() - since VG was created, used FID and was released - which also released FID, so further use was accessing bad memory. Fix it for this code path before release_vg() so FID will exists when _vg_read_file_name() returns NULL.
* RAID: Remove optimization using static vars in lv_raid_dev_healthJonathan Brassow2013-06-171-12/+0
| | | | | | Revert commit 37ffe6a. If static variables are to be used then we will put them elsewhere and limit the optimization to reporting code, rather that have it be used in the general case.
* RAID: s/int/uint32_t for dev_count in dm_status_raid structJonathan Brassow2013-06-172-2/+2
| | | | | Device count is never negative. Change 'dev_count' to be uint32_t instead of int.
* TEST: Fix 'dd' overrunning device size and causing test failureJonathan Brassow2013-06-171-1/+6
| | | | | | | | Assumed size of 4M was too large and the test was failing because 'dd' was failing to perform its write. Calculate the size we need to write with 'dd' instead, so we don't overrun the device.
* dev-type: add/fix references for dev_types in non-linux casePeter Rajnoha2013-06-172-2/+2
|
* snapshot: fix max size limit check for COW deviceZdenek Kabelac2013-06-173-21/+23
| | | | | | Use proper max size as a multiple of extent size. And use 64bit arithmentic for validation of minsize. (in release fix).
* cleanup: use struct assignZdenek Kabelac2013-06-171-11/+4
| | | | | Simplier code with struct assign. Drop unneeded zeroing of zallocated memory.
* clean: remove unneeded assignZdenek Kabelac2013-06-171-3/+2
| | | | | Since init_unknown_segtype returns zalloced memory, NULL assign is not needed.
* tests: more test run in cluster modeZdenek Kabelac2013-06-1639-296/+231
| | | | | | | | | aux updates: prepare_vg now created clustered VG for cluster tests. since dm-raid doesn't work in cluster, skip the cluster test when someone checks for dm-raid target until fixed.
* cleanup: access pool segs with checkZdenek Kabelac2013-06-163-17/+32
| | | | | | Add some minor checks after first_seg(lv). Use direct check for thin pool segment. Drop some unneeded {}
* cleanup: use simplier structure initializationZdenek Kabelac2013-06-163-16/+22
| | | | And also use static struct for _out_spec.
* cleanup: use unrelated temporary variablesZdenek Kabelac2013-06-161-7/+6
| | | | | use of tmp_rq2 is unrelated to tmp_rq - so use separate variable.
* cleanup: move string in the use-placeZdenek Kabelac2013-06-161-4/+3
|
* cleanup: drop unused headersZdenek Kabelac2013-06-169-13/+0
| | | | Drop heades which do not provide any used symbols.
* cleanup: add extra internal errorZdenek Kabelac2013-06-161-0/+5
| | | | Ensure the target line will work only with segment with pool.
* config: skip close of stdinZdenek Kabelac2013-06-161-1/+1
| | | | If the used stream has been stdout, do not close it.
* mirror: add missing error messageZdenek Kabelac2013-06-161-1/+3
| | | | | When a user has not proceeded with conversion, print the error message why the command has failed.
* lvmetad: add some message for error pathZdenek Kabelac2013-06-161-0/+1
| | | | Do not leave replay uninitialized for internal error.
* text: miscellaneous comments & message tweaksAlasdair G Kergon2013-06-159-16/+20
|
* report: revert lvs origin_size sort order changeAlasdair G Kergon2013-06-151-1/+2
| | | | | | | | Reinstate the previous sort order for origin_size, so that LVs with an empty origin_size continue to appear at the start of the list not the end. Ref. 9d445f371c7658969d6580748233dc33c3ba0453
* conf: refine lvm.conf documentation for autoactivation feature even morePeter Rajnoha2013-06-141-3/+10
|
* typo: lvm.conf: auto_activation_list -> auto_activation_volume_listPeter Rajnoha2013-06-141-1/+1
|
* man: refine lvm.conf and man page documentation for autoactivation featurePeter Rajnoha2013-06-145-9/+33
|
* tests: harness updatesZdenek Kabelac2013-06-131-8/+15
|
* cleanup: tabZdenek Kabelac2013-06-131-1/+1
|
* thin: vgsplit support for thinsZdenek Kabelac2013-06-133-0/+95
| | | | | | | Support vgsplit for VGs with thin pools and thin volumes. In case the thin data and thin metadata volumes are moved to a new VG, move there also all related thin volumes and check that external origins are also present in this new VG.
* dev-type: refine dev_get_primary_dev return codes and add more commentsPeter Rajnoha2013-06-123-12/+26
|
* distclean: add missing itemsPeter Rajnoha2013-06-121-1/+3
| | | | | | | These were missing in distclean target under scripts dir: blk_availability_init_red_hat blk_availability_systemd_red_hat.service blkdeactivate.sh
* cleanup: remove old and unused code to detect partition typesPeter Rajnoha2013-06-121-181/+0
| | | | | | This part of the code has not been used for ages, if ever. If needed anytime in future, we should use some library instead - libblkid?
* filter-mpath: detect partitions of mpath componentsPeter Rajnoha2013-06-122-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use mpath filtering (enabled by devices/multipath_component_detection=1 lvm.conf setting) to avoid a situation in which we could end up with duplicate PVs found. We need to filter out the mpath components and use only the top-level multipath mapping instead for PV scans. However, if the there are partitions on multipath components, we need to filter out these partitions. This patch fixes it so those partitions found on multipath components are filtered as well. For example, let's consider following configuration: The sda and sdb are mpath components, sda1 and sdb1 the partitions on these components, mpath-test the mpath mapping and mpath-test1 the partition mapping - created automatically by kpartx right after mpath-test creation. The PV resides on top. (LVM PV) | mpath-test1 | mpath-test | sda1 ---------- sdb1 \ | |/ sda sdb E.g. for sda1 and sdb1, the code will detect this and it skips the partition that belongs to the multipath component: <snippet from the log> #filters/filter-mpath.c:156 /dev/sda1: Device is a partition, using primary device /dev/sda for mpath component detection 130 #ioctl/libdm-iface.c:1724 dm status (253:2) OF[16384](*1) 131 #filters/filter-mpath.c:196 /dev/sda1: Skipping mpath component device </snippet from the log> Othewise, we'd see the same PV label on sda1/sdb1 and mpath-test1 at the same time ending up with "Duplicate PV found...".
* dev-type: dev_get_primary_dev fn: use dev_types and provide better return codesPeter Rajnoha2013-06-122-17/+48
| | | | | | | | | | | | | | | | | | | | The dev_get_primary_dev fn now returns: 0 if the dev is already a primary dev 1 if the dev is a partition, primary dev is returned in "result" (output arg) -1 on error This way, we can better differentiate between the error state and the state in which the dev supplied is not a partition in the caller (this was same return value before). Also, if we already have information about the device type, we can check its major number against the list of known device types (cmd->dev_types) directly, so we don't need to go through the sysfs - we only check the major:minor pair which is a bit more straightforward and faster. If the dev_types does not have any info about this device type, the code just fallbacks to the original sysfs interface to get the partition info.
* refactor: make device type recognition code common for general usePeter Rajnoha2013-06-1229-533/+559
| | | | | | | | | | | | | | | | | | | | | | | | | Changes: - move device type registration out of "type filter" (filter.c) to a separate and new dev-type.[ch] for common use throughout the code - the structure for keeping the major numbers detected for available device types and available partitioning available is stored in "dev_types" structure now - move common partitioning detection code to dev-type.[ch] as well together with other device-related functions bound to dev_types (see dev-type.h for the interface) The dev-type interface contains all common functions used to detect subsystems/device types, signature/superblock recognition code, type-specific device properties and other common device properties (bound to dev_types), including partitioning support. - add dev_types instance to cmd context as cmd->dev_types for common use - use cmd->dev_types throughout as a central point for providing information about device types
* refactor: move lib/device/device.c -> lib/device/dev-type.cPeter Rajnoha2013-06-122-1/+1
|
* refactor: move lib/filters/device-types.h -> lib/device/device-types.hPeter Rajnoha2013-06-122-1/+1
|
* cleanup: use libdm's dm_sysfs_dir() for sysfs directory throughoutPeter Rajnoha2013-06-1212-85/+58
| | | | | And remove superfluous cmd->sysfs_dir and set_sysfs_dir_path/sysfs_dir_path fn from lvm-globals.[ch].
* lvresize: improve poolmetadatasizeZdenek Kabelac2013-06-111-2/+11
| | | | | | | Fix the usecase when only PV list is specified. With --poolmetadatasize PV list is used for metadata extents. Without --poolmetadatasize PV list is used for 100% extension of LV. Handle the case, when nothing could be resized (i.e. in dmeventd)