summaryrefslogtreecommitdiffstats
path: root/lib/activate
Commit message (Collapse)AuthorAgeFilesLines
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-1/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* thin: use discards as plural rather than singularAlasdair G Kergon2012-08-071-1/+1
| | | | Global change from --discard to --discards, as that feels more natural.
* activation: log target version presentAlasdair G Kergon2012-08-071-0/+5
| | | | Log (very verbose) the target version present in target_version.
* thin: detect supported features from thinp targetZdenek Kabelac2012-07-181-0/+9
| | | | | Add shell variable to override reported min version for testing: LVM_THIN_VERSION_MIN
* 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'.
* activate: add autoactivation hooksPeter Rajnoha2012-06-282-6/+26
| | | | | | | | | | | | | | | | 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...).
* Sync filesystem for thin snapshotsZdenek Kabelac2012-06-151-1/+4
| | | | | Add missing lockfs option when suspend origin, before thin volume snapshot is created
* 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.
* 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.
* Update and fix monitoring of thin pool devicesZdenek Kabelac2012-03-232-0/+31
| | | | | | | | | | | | | 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.
* Improve thin_check option passingZdenek Kabelac2012-03-141-15/+31
| | | | | | | Update a way we handle option passing - so we now support path and options with space inside. Fix dm name usage for thin pools with '-' in name. Use new lvm.conf option thin_check_options to pass in options as string array.
* Some more missing supposedly 64bit operations.Zdenek Kabelac2012-03-051-1/+1
| | | | Avoid use 32bit math for extent_size.
* Improve warningZdenek Kabelac2012-03-051-4/+17
| | | | | | | | Use thin_dump --repair suggestion in log error message and use just warning on deactivation path without repair info (since node has been deactivated). Also check whether there is not 16 args for thin_check configured.
* Add support for thin checkZdenek Kabelac2012-03-021-3/+95
| | | | | | | | Use libdm callback to execute thin_check before activation thin pool and after deactivation as well. Supporting thin_check_executable which may pass in extra options for the tool.
* Using enum types for enumsZdenek Kabelac2012-02-281-1/+1
| | | | alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
* Use const for lvZdenek Kabelac2012-02-232-24/+21
| | | | | | | lv_is_active doesn't needs modifiable LV struct so keep it const. Remove lv_send_message() left bits from code - they were never released in 2.02.89.
* The lvmetad client-side integration. Only active when use_lvmetad = 1 is set inPetr Rockai2012-02-231-1/+1
| | | | lvm.conf *and* lvmetad is running.
* Fix bug that caused RAID devices to be unable to activate if sub-LV was missing.Jonathan Earl Brassow2012-02-131-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 02f6f4902fd90709f55e2e97e969ee28c2945c81 introduced a bug that caused RAID devices to fail to activate if the device for a single sub-LV failed. The special case of LVM mirror was handled, but not LVM RAID. EXAMPLE: [root@bp-01 ~]# devices vg LV Copy% Devices lv 100.00 lv_rimage_0(0),lv_rimage_1(0) [lv_rimage_0] /dev/sde1(1) [lv_rimage_1] /dev/sdh1(1) [lv_rmeta_0] /dev/sde1(0) [lv_rmeta_1] /dev/sdh1(0) [root@bp-01 ~]# vgchange -an vg 0 logical volume(s) in volume group "vg" now active [root@bp-01 ~]# off.sh sdh Turning off sdh [root@bp-01 ~]# vgchange -ay vg --partial Partial mode. Incomplete logical volumes will be processed. Couldn't find device with uuid fbI0YO-GX7x-firU-Vy5o-vzwx-vAKZ-feRxfF. Cannot activate vg/lv_rimage_1: all segments missing. 0 logical volume(s) in volume group "vg" now active AFTER this patch: [root@bp-01 ~]# vgchange -ay vg --partial Partial mode. Incomplete logical volumes will be processed. Couldn't find device with uuid fbI0YO-GX7x-firU-Vy5o-vzwx-vAKZ-feRxfF. 1 logical volume(s) in volume group "vg" now active [root@bp-01 ~]# devices vg Couldn't find device with uuid fbI0YO-GX7x-firU-Vy5o-vzwx-vAKZ-feRxfF. LV Copy% Devices lv 100.00 lv_rimage_0(0),lv_rimage_1(0) [lv_rimage_0] /dev/sde1(1) [lv_rimage_1] unknown device(1) [lv_rmeta_0] /dev/sde1(0) [lv_rmeta_1] unknown device(0) [root@bp-01 ~]# dmsetup table vg-lv; dmsetup status vg-lv 0 1024000 raid raid1 3 0 region_size 1024 2 253:2 253:3 - - 0 1024000 raid raid1 2 AD 1024000/1024000 No WHATSNEW update necessary because this is an intrarelease fix. brassow
* give standard error message if lstat fails unexpectedlyAlasdair Kergon2012-02-121-5/+7
|
* Check result of lstatZdenek Kabelac2012-02-081-3/+4
| | | | | If lstat returns errno different from ENOENT, do not use the content of struct stat 'buf'.
* Disable partial activation for thin LVs and LVs with all missing segmentsZdenek Kabelac2012-02-011-0/+26
| | | | | | | | | | Count number of error and existing areas and if there is no existing area for the LV avoid its activation. Always disable partial activatio for thin volumes. For mirrors currently put in hack to let it pass with a special name since current mirror code needs to activate such LV during some operations.
* Fix data% reportingZdenek Kabelac2012-01-281-2/+3
| | | | | | For reading % of mapped size of thin volume use as origin for old style snapshot '-real' device needs to be queried. Fix log_error report given for lvs -a in this case.
* Fix missing dmt destructorZdenek Kabelac2012-01-251-1/+5
| | | | Also always initialize maj,min,patchlevel when success is returned.
* Fix compilation with disabled devmapperZdenek Kabelac2012-01-251-3/+47
| | | | | During release preparation things has changed, so making sure we are compilable with --disable-devmapper.
* Rename origin_only to more generic use_layer flagZdenek Kabelac2012-01-252-15/+17
| | | | | Since now we have more layered devices i.e. thin volumes - support selection of layer via flag.
* Make commented out code more obviousAlasdair Kergon2012-01-251-5/+7
|
* Thin use origin_only for thin pools as wellZdenek Kabelac2012-01-251-1/+5
| | | | | | | | Extend the usage of origin_only flag to allow resume of thin pool LV (when it's active) to pass only the messages. origin_only flag will skip detection of already resumed tree for thin_pool, so we do not need to suspend the tree and we just send messages.
* Thin add support for origin_only suspend of thin volumesZdenek Kabelac2012-01-252-8/+25
| | | | | | | | | | Pass in the origin_only flag also for thin volumes - but curently the flag is not used to its best. FIXME: achieve the state where only thin volume snapshot origin is suspended without its childrens - let's explore whether this may happen automatically inside libdm (might be generic for other targets). So the code would not need to annotate the node for this.
* Thin add messages only for activation treeZdenek Kabelac2012-01-252-0/+3
| | | | | | | | | | | | Extend lv_activate_opts with bool flag to know for which purpose dtree is created - and add message only for activation tree (since that's the only place that may send them). Extend validation check for thin snapshot creation and test whether active snapshot origin is suspended before its snapshot is created (useful in recover scenarios) - in this case also detect, whether transaction has been already completed and avoid such suspend check failure in that case.
* lv_info using -real layer only for origin_only LVZdenek Kabelac2012-01-251-1/+1
| | | | | | | If the origin_only flag is passed for non lv_is_origin LVs, the extension is not added. Thin volumes may also use origin_only flag.
* Comment cleanupsZdenek Kabelac2012-01-251-10/+4
| | | | | Move comment where it applies and remove unused attribe when the var is actually used.
* Thin add lv_thin_pool_transaction_idZdenek Kabelac2012-01-254-0/+76
| | | | Easy function to get transaction_id status value.
* Fix the way RAID meta LVs are added to the dependency tree.Jonathan Earl Brassow2012-01-231-2/+2
| | | | | | | | | Similar to the "mirror" segment type's log device, _add_dev_to_dtree should be called and not _add_lv_to_dtree when adding metadata sub-LVs to the deptree. Since _add_lv_to_dtree was being called, 'origin_only' could be set if a snapshot sits on top of the RAID device. This would cause the actual device that needed to be added to be skipped in favor of the non-existant device, "<foo>-real".
* Attempt to improve clustered 'lvchange -aey' behaviour to try local node beforeAlasdair Kergon2012-01-211-15/+10
| | | | remote nodes and address some existing anomalies.
* Differentiate between snapshot status of "Invalid" and "Merge failed".Mike Snitzer2012-01-201-0/+3
|
* Lookup snapshot usage percent of origin when a snapshot is merging.Mike Snitzer2012-01-201-2/+9
|
* improve commentAlasdair Kergon2012-01-201-8/+14
|
* Preserve exclusive activation of cluster mirror when converting.Jonathan Earl Brassow2012-01-202-3/+6
| | | | | | | | | This patch to the suspend code - like the similar change for resume - queries the lock mode of a cluster volume and records whether it is active exclusively. This is necessary for suspend due to the possibility of preloading targets. Failure to check to exclusivity causes the cluster target of an exclusively activated mirror to be used when converting - rather than the single machine target.
* Thin add function to read thin volume percentZdenek Kabelac2012-01-194-0/+53
| | | | | | This value returns percentage of 'mapped' size compared with total LV size. (Without passed seg pointer it return highest mapped size - but it's not used yet.)
* Thin updated support for thin pool percentZdenek Kabelac2012-01-194-8/+12
| | | | | Support to check also for metadata percent (By checking whether seg pointer is set)
* Thin rename seg var pool_metadata_lv to metadata_lvZdenek Kabelac2012-01-191-2/+2
| | | | Better fits the code.
* Thin rename local staticZdenek Kabelac2012-01-191-9/+8
| | | | Use '_' for local const char.
* Missing const.Peter Rajnoha2012-01-121-1/+1
| | | | "warning: assignment discards 'const' qualifier..."
* Add activation/read_only_volume_list to override LV permission in metadata.Alasdair Kergon2012-01-124-46/+87
|
* Thin add lv_thin_pool_percentZdenek Kabelac2011-12-212-0/+25
|
* Thin add dev_manager_thin_pool_percentZdenek Kabelac2011-12-212-0/+27
| | | | dev manager function to read percent info from thin pool.
* Thin add dmeventd supportZdenek Kabelac2011-12-211-4/+16
| | | | | This is basic version with still few unresolved issue mainly in case, when the pool resize is failing.
* Check lv pointer for NULL before derefence.Zdenek Kabelac2011-12-211-1/+1
|
* Thin move layer suffix into local static constZdenek Kabelac2011-12-211-4/+5
|