summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* RAID: Disallow addition of RAID images while array is not in-syncJonathan Brassow2012-09-101-0/+4
| | | | | | | | We cannot add images to a RAID array while it is not in-sync. The kernel will simply reject the table, saying: 'rebuild' specified while array is not in-sync Now we check to ensure the LV is in-sync before attempting image additions.
* RAID: '--test' should not cause a valid create command to failJonathan Brassow2012-09-052-0/+9
| | | | | | | | | It is necessary when creating a RAID LV to clear the new metadata areas. Failure to do so could result in a prepopulated bitmap that would cause the new array to skip syncing portions of the array. It is a requirement that the metadata LVs be activated and cleared in the process of creating. However in test mode, this requirement should be lifted - no new LVs should be created or written to.
* cleanup: Use segtype->ops->name() instead of segtype->name where applicableJonathan Brassow2012-09-052-6/+8
| | | | | | | | When printing a message for the user and the lv_segment pointer is available, use segtype->ops->name() instead of segtype->name. This gives a better user-readable name for the segment. This is especially true for the 'striped' segment type, which prints "linear" if there is an area_count of one.
* setvbuf: reopen only valid fdPeter Rajnoha2012-08-272-23/+33
| | | | | | We should check whether the fd is opened before trying to reopen it. For example, the stdin is closed in test/lib/harness.c causing the test suite to fail.
* setvbuf: close and reopen stream before changeAlasdair G Kergon2012-08-261-6/+59
| | | | | | | | Fix setvbuf code by closing and reopening stream before changing buffer. But we need to review what this code is doing embedded inside a library function rather than the simpler original form being run independently at the top of main() by tools that need it.
* buffering: use unbuffered silent mode for liblvmAlasdair G Kergon2012-08-263-4/+18
| | | | | | Disable private buffering when using liblvm. When private stdin/stdout buffering is not used always use silent mode.
* config: add silent modeAlasdair G Kergon2012-08-2512-24/+44
| | | | | | | | | | | | | | | | Accept -q as the short form of --quiet. Suppress non-essential standard output if -q is given twice. Treat log/silent in lvm.conf as equivalent to -qq. Review all log_print messages and change some to log_print_unless_silent. When silent, the following commands still produce output: dumpconfig, lvdisplay, lvmdiskscan, lvs, pvck, pvdisplay, pvs, version, vgcfgrestore -l, vgdisplay, vgs. [Needs checking.] Non-essential messages are shifted from log level 4 to log level 5 for syslog and lvm2_log_fn purposes.
* RAID: Add support for RAID10Jonathan Brassow2012-08-245-2/+47
| | | | | | This patch adds support for RAID10. It is not the default at this stage. The user needs to specify '--type raid10' if they would like RAID10 instead of stacked mirror over stripe.
* clenaup: compatible definition for older gccZdenek Kabelac2012-08-231-2/+2
| | | | | | | Fixes previous commit, it seems older gcc compilers do not recognize same typedef. (Easiest would be probably to directly include proper header here).
* cleanup: add some missing stack backtracesZdenek Kabelac2012-08-231-9/+12
|
* cleanup: initilize percent to INVALIDZdenek Kabelac2012-08-231-2/+2
| | | | | Always initialize percent to INVALID value, in case target would have forget to setup this value somehow.
* activation: report error messageZdenek Kabelac2012-08-231-0/+3
| | | | | If the monitoring activation failed and we have not yet reported error - give the user error message for failure reason.
* cleanup: format1 test whether PV was foundZdenek Kabelac2012-08-231-1/+4
| | | | Avoid dereferecing NULL pointer.
* cleanup: add __attribute__ ((nonnull(1)))Zdenek Kabelac2012-08-231-0/+1
|
* check: add internal errors for unexpected pathsZdenek Kabelac2012-08-234-6/+27
| | | | | | | | | | | | | | | | | | | | Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
* cleanup: use proper activation_change_tZdenek Kabelac2012-08-232-2/+4
|
* cleanup: use static char[] arrayZdenek Kabelac2012-08-231-1/+1
|
* 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...).