summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* args: add --activate synonym for --available argPeter Rajnoha2012-06-281-5/+5
| | | | | | | | We're refererring to 'activation' all over the code and we're talking about 'LVs being activated' all the time so let's use 'activation/activate' everywhere for clarity and consistency (still providing the old 'available' keyword as a synonym for backward compatibility with existing environments).
* discards: don't discard reconfigured extentsAlasdair G Kergon2012-06-273-4/+20
| | | | | | | | Update release_lv_segment_area not to discard any PV extents, as it also gets used when moving extents between LVs. Instead, call a new function release_and_discard_lv_segment_area() in the two places where data should be discarded - lv_reduce() and remove_mirrors_from_segments().
* discards: split discard from release_pv_segmentAlasdair G Kergon2012-06-272-23/+36
| | | | Separate discard_pv_segment out of release_pv_segment
* allocation: allow release_lv_segment_area to failAlasdair G Kergon2012-06-273-26/+37
| | | | Allow release_lv_segment_area to fail as functions it calls can fail.
* configure: run directory configuration cleanupPeter Rajnoha2012-06-271-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were several hard-coded values for run directory around the code. Also, some tools are DM specific only, others are LVM specific and there was no distinction made here before. With this patch applied, we have this cleaned up a bit (subsystem in brackets, defaults in parentheses): [common] configurable PID_DIR (/var/run) lvm [lvm] configurable RUN_DIR (/var/run/lvm) configurable locking dir (/var/lock/lvm) clvmd [lvm] configurable pid file (PID_DIR/clvmd.pid) socket (RUN_DIR/clvmd.sock) lvmetad [lvm] configurable pid file (PID_DIR/lvmetad.pid) socket (RUN_DIR/lvmetad.socket) dm [dm] configurable DM_RUN_DIR (/var/run) cmirrord [dm] configurable pid file (PID_DIR/cmirrord.pid) dmeventd [dm] configurable pid file (PID_DIR/dmeventd.pid) server fifo (DM_RUN_DIR/dmeventd-server) client fifo (DM_RUN_DIR/dmeventd-client) The changes briefly: - added configure --with-default-pid-dir - added configure --with-default-dm-run-dir - added configure --with-lvmetad-pidfile - by default, using one common pid directory for everything (only lvmetad was not following this before)
* dev-io: open device read-only to obtain readahead valuePeter Rajnoha2012-06-251-1/+1
| | | | | | | | | | | | | | | | | | | There's no need to have the device open RW while obtaining the readahead value. The RW open used before caused the CHANGE udev event to be generated if the WATCH udev rule was set for the underlying device (and that is normally the case both for non-dm and dm devices by default). This did not cause any problems before since we were not interested in *underlying* devices. However, with upcoming changes (autoactivation), we're watching for events on underlying devices marked as PVs and such a spurious event could cause the autoactivation code to be triggered. So when trying to deactivate the volume, we could end up with immediate activation just after that because of the CHANGE event originated in the WATCH udev rule since the underlying device was open RW during the deactivation process. Though maybe a better solution would be to completely filter such spurious events out of the autoactivation process somehow, it's still useful if there are as least spurious events generated as possible in the system itself.
* lvmetad: check for fid existanceZdenek Kabelac2012-06-221-0/+3
| | | | Fail to update lvmetad with proper log error message.
* fix: limit preallocate stack sizeZdenek Kabelac2012-06-221-1/+5
| | | | | | | | If the user would set bigger reserved stack size then what is allowed in resources (ulimit -s), then he would get coredump So avoid coredump and ignore creation of such large stack size (lvm should work properly, with just 64KB, so the option could be eliminated).
* fix: use 64bit math for reserved memoryZdenek Kabelac2012-06-221-4/+4
| | | | | | | | If the user specifies number in the range of [4G/1024, 4G>, the used value would wrap around (32bit math). So keep the math 64bit. Note, using such large lvm.conf values is pointless with lvm2.
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-227-20/+11
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* Sync filesystem for thin snapshotsZdenek Kabelac2012-06-151-1/+4
| | | | | Add missing lockfs option when suspend origin, before thin volume snapshot is created
* veritysetup: Remove code as now in cryptsetup.Alasdair G Kergon2012-06-111-9/+0
| | | | | The veritysetup code has moved to the cryptsetup package. http://code.google.com/p/cryptsetup/
* More .gitignore files for an in-source-tree build.Alasdair G Kergon2012-06-081-0/+1
| | | | Tell git to ignore files generated by a build inside the source tree.
* Remove unsupported udev_get_dev_path libudev call used for checking udev dir.Peter Rajnoha2012-05-293-27/+16
| | | | | | | | | | | | With latest changes in the udev, some deprecated functions were removed from libudev amongst which there was the "udev_get_dev_path" function we used to compare a device directory used in udev and directore set in libdevmapper. The "/dev" is hardcoded in udev now (udev version >= 183). Amongst other changes and from packager's point of view, it's also important to note that the libudev development library ("libudev-devel") could now be a part of the systemd development library ("systemd-devel") because of the udev + systemd merge.
* Fix error pathZdenek Kabelac2012-05-231-3/+5
| | | | | Do not increase nr_filt in case of NULL ret value, since the error path doesn't handle NULL pointers.
* Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90)Alasdair Kergon2012-05-161-16/+0
| | | | - The test should be checking the LV as a whole, not just individual segments.
* Warn of deadlock risk when using snapshots of mirror segment type.Alasdair Kergon2012-05-141-3/+3
|
* Fix cling policy not to behave like normal policy if no previous LV seg.Alasdair Kergon2012-05-111-26/+33
| | | | Fix alloc cling to cling to PVs already found with contiguous policy.
* Fix allocation policy loop so it doesn't continue beyond cling using laterAlasdair Kergon2012-05-111-3/+3
| | | | | policies it shouldn't be using when --alloc cling is specified but no tags are defined.
* Append _TO_LVSEG to names of internal A_CONTIGUOUS and A_CLING flags.Alasdair Kergon2012-05-111-12/+14
| | | | Remove some unnecesary prev_lvseg checks.
* Always include debug mesg when cling to allocated is set.Alasdair Kergon2012-05-111-1/+1
|
* Refactor _has_matching_pv_tag to provide a fn that takes PV structs.Alasdair Kergon2012-05-111-7/+12
|
* More comments on metadata area types.Peter Rajnoha2012-05-101-2/+5
|
* Comment on auxiliary metadata areas.Peter Rajnoha2012-05-101-2/+5
|
* Fix division by zero if PV with zero PE count is used during vgcfgrestore.Peter Rajnoha2012-05-091-1/+1
|
* Fix regression in for_each_sub_lvZdenek Kabelac2012-05-091-7/+0
| | | | | | pool_lv is not a sub lv in terms for this function. It has caused problem with renaming thin_volume, where it has tried to rename pool LV as well.
* Fix up-convert when mirror activation is controled by volume_list and tags.Jonathan Earl Brassow2012-05-051-1/+15
| | | | | | | | | | | | When mirrors are up-converted, a transient mirror layer is put in so that only the new devices are sync'ed. That transient layer must carry the tags of the original mirror LV, otherwise it will fail to activate when activation is regulated by lvm.conf:activation/volume_list. The conversion would then fail. The fix is to do exactly the same thing that is being done for linear -> mirror converting (lib/metadata/mirror.c:_init_mirror_log()). We copy the tags temporarily for the new LV and remove them after the activation.
* Disallow snapshots of mirror segment types.Jonathan Earl Brassow2012-05-011-6/+4
| | | | | | | | | | | Snapshots of RAID logical volumes are allowed (including "raid1"). However, snapshots of "mirror" logical volumes has been disallowed due to unsolvable issues inherent to the design. The fact that mirroring (dm-raid1.c) must stop all I/O as the result of a failure and wait for userspace intervention can lead to a circular dependency if userspace is simultaneously waiting for snapshots (on mirrors) to make an I/O update before proceeding. Various snapshot on mirror tests have been removed as a result.
* Disallow changing cluster attribute of VG while RAID LVs are active.Jonathan Earl Brassow2012-04-251-3/+5
| | | | | Mirror and snapshot LVs are already checked for when switching the cluster attribute of a VG. This patch adds RAID.
* Allow a subset of failed devices to be replaced in RAID LVs.Jonathan Earl Brassow2012-04-241-0/+18
| | | | | | If two devices in an array failed, it was previously impossible to replace just one of them. This patch allows for the replacement of some, but perhaps not all, failed devices.
* Add some lock commentsZdenek Kabelac2012-04-241-5/+5
|
* Handle replacement of an active device that goes missing with an error device.Alasdair Kergon2012-04-241-7/+25
| | | | (E.g. lvchange --refresh --partial on striped LV if a PV disappeared.)
* Unlike 'mirror' segtype, 'raid1' should perform flush on suspend.Jonathan Earl Brassow2012-04-201-1/+2
| | | | | | | | | | The 'mirror' segtype and 'raid1' segtype both set the 'MIRRORED' flag. However, due to differences in the way these device-mapper targets behave 'mirror' must be suspended with the 'noflush' option and 'raid1' does not have to be. This patch ensures that when the 'MIRRORED' flag is checked to see if 'noflush' is needed that it does not also set it for 'raid1' by mistake.
* Fix code that performs RAID device replacement while under snapshot.Jonathan Earl Brassow2012-04-121-4/+4
| | | | | | | The code should have been calling [suspend|resume]_lv_origin() rather than [suspend|resume]_lv. This addresses bug 807069.
* Fix inability to split RAID1 image while specifying a particular PV.Jonathan Earl Brassow2012-04-111-19/+40
| | | | | | | | The logic for resuming the original and newly split LVs was not properly done to handle situations where anything but the last device in the array was split. It did not take into account the possible name collisions that might occur when the original LV undergoes the shifting and renaming of its sub-LVs.
* Change message severity to log_very_verbose for missing dev info in udev db.Peter Rajnoha2012-04-111-5/+19
| | | | | | | | | | | | | | | | | | | | | Libudev does not provide transactions when querying udev database - once we get the list of block devices (devices/obtain_device_list_from_udev=1) and we iterate over the list to get more detailed information about device node and symlink names used etc., the device could be removed just in between we get the list and put a query for more info. In this case, libudev returns NULL value as the device does not exist anymore. Recently, we've added a warning message to reveal such situations. However, this could be misleading if the device is not related to the LVM action we're just processing - the non-related block device could be removed in parallel and this is not an error but a possible and normal operation. (N.B. This "missing info" should not happen when devices are related to the LVM action we're just processing since all such processing should be synchronized with udev and the udev db must always be in consistent state after the sync point. But we can't filter this situation out from others, non-related devices, so we have to lower the message verbosity here for a general solution.)
* RAID LVs could not handle a down-convert if a device other than the last oneJonathan Earl Brassow2012-04-111-2/+16
| | | | in the array was specified for removal. This change addresses that (bz806111).
* Check if info struct returned is not NULL.Peter Rajnoha2012-04-102-2/+6
| | | | Just some missing checks revealed by Coverity in recent code.
* Minor fixesZdenek Kabelac2012-03-283-7/+7
| | | | Just small updates and remove <backtrace> after log_error.
* Fix exclusive lvmchange -aey to fail if volume is active on different node.Milan Broz2012-03-271-1/+1
| | | | | | | | | Activation on remote node should be tried only if it is masked by tags locally (like when hosttags enabled, IOW activate_lv_excl_local() doesn't return error.) Introduced change caused that lvchange -aey succeeded even if volume was activated exclusively remotely.
* Keep exclusive activation in pvmove if LV is already active.Milan Broz2012-03-261-1/+1
| | | | | | | Pvmove should never try to downgrade exclusive lock for LVs. This allows pvmove to work again for exclusive activated LVs.
* Remove unused and wrongly set cluster VG flag from clvmd lock query command.Milan Broz2012-03-261-1/+1
|
* First veritysetup version using configure --with-veritysetup.Alasdair Kergon2012-03-241-0/+9
|
* Fix pvmove if LV is activated exclusively but cmirror is not running.Milan Broz2012-03-231-1/+4
| | | | | | | | | In this case we should allow to use local mirror, check for cmirror should apply only for lvconvert/lvcreate. Introduced in 2.02.86 by removing !(lv->status & ACTIVATE_EXCL). (Partially workaround, it is minimalistic patch for now.)
* Update and fix monitoring of thin pool devicesZdenek Kabelac2012-03-233-0/+36
| | | | | | | | | | | | | Code adds better support for monitoring of thin pool devices. update_pool_lv uses DMEVENTD_MONITOR_IGNORE to not manipulate with monitoring. vgchange & lvchange are checking real thin pool device for existance as we are using _tpool real device and visible LV pool device might not be even active (_tpool is activated implicitely for any thin volume). monitor_dev_for_events is another _lv_postorder like code it might be worth to think about reusing it here - for now update the code to properly monitory thin volume deps. For unmonitoring add extra code to check the usage of thin pool - in case it's in use unmonitoring of thin volume is skipped.
* Fix typo in config option checkZdenek Kabelac2012-03-231-1/+1
|
* Fix regression in thin monitoringZdenek Kabelac2012-03-201-42/+42
| | | | | | | Patch https://www.redhat.com/archives/lvm-devel/2012-February/msg00118.html removed initilization of thin volume monitoring, leaving it only for thin pool - but missed the code move part for monitoring of thin pools. Effectively making thin pools not monitorable.
* Support improperly formated device numbersZdenek Kabelac2012-03-201-2/+15
| | | | | | | | | | | | | There are kernel drivers (smblk) which set '-1' as their device major number. This number is listed in /proc/devices then - but the kernel itself is using just 12 bits - thus device is accessible via 4095 - there is posted patch for 3.4 to fix this behavior (0 for auto allocation was mean to be used). However to still allow using such devices with older kernels add some code to use same behavior - so cut 12 bits from the major number from /proc/devices. For now use log_warn() - maybe the severity of the message could be lowered to just verbose level.
* Fix name conflicts that prevent down-converting RAID1 when specifying a deviceJonathan Earl Brassow2012-03-151-1/+13
| | | | | | | | | | | | | When down-converting a RAID1 device, it is the last device that is extracted and removed when the user does not specify a particular device. However, when a device is specified (and it is not the last), the device is removed and the remaining sub-LVs are "shifted down" to fill the hole. This cause problems when resuming the LV because if the shifted devices were resumed (and thus renamed) before the sub-LV being extracted, there would be a name conflict. The solution is to resume the extracted sub-LVs first so that they can be properly renamed preventing a possible conflict. This addresses bug 801967.
* Just move declarationZdenek Kabelac2012-03-141-1/+2
|