summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: use return_NULLZdenek Kabelac2012-08-231-1/+1
| | | | Function returns pointer, so use NULL.
* cleanup: uint64_t castsZdenek Kabelac2012-08-235-5/+5
|
* cleanup: keep MKNOD type cast cleanZdenek Kabelac2012-08-231-1/+1
| | | | Setup major already a dev_t type before it gets shifted.
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-2334-91/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* mirror: reconfigure_mirror_images not usedPeter Rajnoha2012-08-152-0/+6
|
* thin: lvcreate --discardsZdenek Kabelac2012-08-092-0/+2
|
* thin: fix condition for kernels without discardsZdenek Kabelac2012-08-091-2/+2
| | | | | Report warning if the kernel is not support given discards settings. (In this case the behavior is equal to IGNORE.)
* thin: default discards for old mda is IGNOREZdenek Kabelac2012-08-091-1/+1
| | | | | If the discard was not set in metadata, use IGNORE, as this is the equivalent behavior for this case.
* thin: fix recent commitsAlasdair G Kergon2012-08-071-11/+10
|
* thin: use discards as plural rather than singularAlasdair G Kergon2012-08-077-51/+51
| | | | Global change from --discard to --discards, as that feels more natural.
* thin: tidy thin discard codeAlasdair G Kergon2012-08-071-22/+13
| | | | | | | | | Always store discard setting in LV metadata. (Note that lvcreate_params doesn't yet use --discard to set the initial value.) Remove undocumented env var LVM_THIN_VERSION_MIN that has no use on a live system. Change verbose 'feature not found' messages to debug. Use discard_str for string value of discard.
* report: provide discard field value in fullAlasdair G Kergon2012-08-072-17/+6
| | | | | | | | | I think it's better not to abbreviate human-readable fields like 'discard' to a single character. Users can truncate it to the first character themselves if they wish. It's confusing to use the variable name discard for different things in different places - use discard_str when it's a string not the enum.
* activation: log target version presentAlasdair G Kergon2012-08-071-0/+5
| | | | Log (very verbose) the target version present in target_version.
* thin: tighten discard string conversionsAlasdair G Kergon2012-08-071-6/+3
| | | | | | | | | Respond with "unknown" rather than a NULL pointer if there's an internal error and the discard value is invalid. Don't accept 'no_passdown' or 'no-passdown' variants in the LVM metadata: this is written by the program so should only ever contain "nopassdown" and should be validated strictly against that.
* thin: order discard enum alphabeticallyAlasdair G Kergon2012-08-071-2/+2
|
* comments: misc updatesAlasdair G Kergon2012-08-071-0/+1
| | | | Miscellaneous clarifications to comments.
* lvmetad: Implement --test (fixes #832033).Petr Rockai2012-07-301-4/+4
|
* reports: invalid snaps do not capitalise lv_attrAlasdair G Kergon2012-07-271-1/+0
| | | | | No longer capitalise first LV attribute char for invalid snapshots. This state is available from the 5th char now (I or S).
* filters: move device_info_t definition to headerAlasdair G Kergon2012-07-262-7/+7
|
* filters: Add Micron PCIe SSDs (mtip32xx) [part2]Alasdair G Kergon2012-07-261-0/+55
| | | | Recognise Micron PCIe SSDs in filter and move array out to device-types.h.
* filters: Add Micron PCIe SSDs (mtip32xx)Alasdair G Kergon2012-07-261-40/+2
| | | | Recognise Micron PCIe SSDs in filter and move array out to device-types.h.
* locking: clarify read-only locking error message v2Peter Rajnoha2012-07-251-1/+1
|
* locking: clarify read-only locking error messagePeter Rajnoha2012-07-251-1/+2
|
* RAID: Fix segfault when attempting to replace RAID 4/5/6 deviceJonathan Brassow2012-07-241-1/+10
| | | | | | | | | | | | | | Commit 8767435ef847831455fadc1f7e8f4d2d94aef0d5 allowed RAID 4/5/6 LV to be extended properly, but introduced a regression in device replacement - a critical component of fault tolerance. When only 1 or 2 drives are being replaced, the 'area_count' needed can be equal to the parity_count. The 'area_multiple' for RAID 4/5/6 was computed as 'area_count - parity_devs', which could result in 'area_multiple' being 0. This would ultimately lead to a division by zero error. Therefore, in calc_area_multiple, it is important to take into account the number of areas that are being requested - just as we already do in _alloc_init.
* config: fix one-node dumpconfig, add dm_config_write_one_nodePeter Rajnoha2012-07-201-1/+1
| | | | | | | | | | | | | | | | | | A regression introduced in 2.02.89 (11e520256b3005ed813ce83f8770aaab74edef3f) caused the lvm dumpconfig <node> to print out the node as well as its subsequent siblings. The information about "only_one" mode got lost. Before this patch (just an example node): # lvm dumpconfig global/use_lvmetad use_lvmetad=1 thin_check_executable="/usr/sbin/thin_check" thin_check_options="-q" (...all nodes to the end of the section) With this patch applied: # lvm dumpconfig global/use_lvmetad use_lvmetad=1
* thin: add reporting of discard for thin poolZdenek Kabelac2012-07-183-0/+33
| | | | | | | | | | New field "discard" is added for lvs reporting of lv segment. Reported as one character: (i)gnore (n)opassdown (p)assdown lvs -o+discard
* thin: add discard support for thin poolZdenek Kabelac2012-07-183-0/+88
| | | | | | | | Add arg support for discard. Add discard ignore, nopassdown, passdown (=default) support. Flags could be set per pool. lvcreate [--discard {ignore|no_passdown|passdown}] vg/thinlv
* thin: detect supported features from thinp targetZdenek Kabelac2012-07-182-1/+45
| | | | | Add shell variable to override reported min version for testing: LVM_THIN_VERSION_MIN
* RAID: Fix extending size of RAID 4/5/6 logical volumes.Jonathan Brassow2012-06-261-1/+13
| | | | | | Reducing a RAID 4/5/6 LV or extending it with a different number of stripes is still not implemented. This patch covers the "simple" case where the LV is extended with the same number of stripes as the orginal.
* cleanup: static volume filter fn, lvm.conf commentPeter Rajnoha2012-06-292-8/+5
| | | | | | | Change 'lv_passes_volumes_filter' fn back to static as it's not actually needed in the other code (a remnant from devel version). Fix lvm.conf comment referencing '--autoactivate' which was finally decided to be '--activate ay'.
* alloc: fix raid --alloc anywhere double allocsAlasdair G Kergon2012-06-281-1/+5
| | | | | | | | If _alloc_parallel_area for raid devices chooses an area already used up, it doesn't notice that it has no space left in it and leaves later code trying to place a zero-length area into the LV. https://bugzilla.redhat.com/832596
* lvcreate: add --activate ay (autoactivate)Peter Rajnoha2012-06-281-0/+9
| | | | | | | | | | One can use "lvcreate --aay" to have the newly created volume activated or not activated based on the activation/auto_activation_volume_list this way. Note: -Z/--zero is not compatible with -aay, zeroing is not used in this case! When using lvcreate -aay, a default warning message is also issued that zeroing is not done.
* activate: add autoactivation hooksPeter Rajnoha2012-06-286-24/+72
| | | | | | | | | | | | | | | | Define an 'activation_handler' that gets called automatically on PV appearance/disappearance while processing the lvmetad_pv_found and lvmetad_pv_gone functions that are supposed to update the lvmetad state based on PV availability state. For now, the actual support is for PV appearance only, leaving room for PV disappearance support as well (which is a more complex problem to solve as this needs to count with possible device stack). Add a new activation change mode - CHANGE_AAY exposed as '--activate ay/-aay' argument ('activate automatically'). Factor out the vgchange activation functionality for use in other tools (like pvscan...).
* 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
|