summaryrefslogtreecommitdiffstats
path: root/lib/metadata
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* buffering: use unbuffered silent mode for liblvmAlasdair G Kergon2012-08-261-0/+1
| | | | | | 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-254-21/+20
| | | | | | | | | | | | | | | | 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-244-2/+32
| | | | | | 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.
* cleanup: add some missing stack backtracesZdenek Kabelac2012-08-231-9/+12
|
* check: add internal errors for unexpected pathsZdenek Kabelac2012-08-231-0/+5
| | | | | | | | | | | | | | | | | | | | 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-231-1/+1
|
* cleanup: uint64_t castsZdenek Kabelac2012-08-231-1/+1
|
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-236-9/+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: use discards as plural rather than singularAlasdair G Kergon2012-08-072-18/+18
| | | | Global change from --discard to --discards, as that feels more natural.
* 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
|
* 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).
* 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.
* thin: add discard support for thin poolZdenek Kabelac2012-07-182-0/+44
| | | | | | | | 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
* 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.
* 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-282-2/+4
| | | | | | | | | | | | | | | | 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.
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-221-3/+1
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* 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 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.
* 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.
* 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).
* Minor fixesZdenek Kabelac2012-03-281-2/+2
| | | | Just small updates and remove <backtrace> after log_error.
* 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-231-0/+5
| | | | | | | | | | | | | 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 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.
* Removing call of release_vg(NULL)Zdenek Kabelac2012-03-121-1/+0
| | | | | Since we are in error path were vg must be always NULL, skip call of release_vg() like we do in other places.
* Using %u modifier to print unsigned values.Zdenek Kabelac2012-03-121-6/+6
|
* Switch to normal log_verbose messageZdenek Kabelac2012-03-121-2/+2
| | | | Here it's not an error case - so do not push this message to stderr.