summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* toollib: fixes and cleanup of recent changesdev-dct-toollib-changesDavid Teigland2014-11-141-67/+107
| | | | | | | | | | | | | | | | | | | | | - Fix problems with recent changes related to skipping in: . _process_vgnameid_list . _process_pvs_in_vgs - Undo unnecessary changes to the code structure and readability. - Preserve valid but minor changes: . testing FAILED bit values in ignore_vg . using "skip" value from ignore_vg instead of "ret" value . applying the sigint check to the start of all loops . setting stack backtrace when ECMD_PROCESSED is not returned, i.e. apply the following pattern: ret = process_foo(); if (ret != ECMD_PROCESSED) stack; if (ret > ret_max) ret_max = ret;
* toollib: ignore_vg() with skip is not lockedZdenek Kabelac2014-11-141-19/+24
| | | | | | | | | Extend/fix d8923457b82456ebee3e333b3fcc26087483cd01 commit. 'skip'-ed VG is not holding any lock - so don't unlock such VG. At the same time simplify the code around and relase VG at a single place and unlock only not skiped and not ignored VGs.
* tests: explicit raid syncZdenek Kabelac2014-11-141-0/+3
|
* debug: switch to verboseZdenek Kabelac2014-11-141-2/+2
| | | | When there is no real error from the function - avoid using log_error().
* debug: better message for pool zeroing stateZdenek Kabelac2014-11-141-1/+1
|
* cleanup: add '.' to log messagesZdenek Kabelac2014-11-142-74/+74
|
* vg_read: correct warningZdenek Kabelac2014-11-141-8/+7
| | | | | | | | Use log_warn when we are effectively not creating an error - we 'allowed' inconsistent read for a reason - so it's just warning level we process inconsistent VG - it's upto caller later to decide error level of command return value and in case of error it needs to use log_error then.
* toolib: fix ignore_vgZdenek Kabelac2014-11-144-114/+112
| | | | | | | | | | | | | Rework ignore_vg() API so it properly handles multiple kind of vg_read_error() states. Skip processing only otherwise valid VG. Always return ECMD_FAILED when break is detected. Check sigint_caught() in front of dm iterator loop. Add stack for _process failing ret codes.
* vg_read: use new error flagZdenek Kabelac2014-11-143-1/+3
| | | | | | Failed recovery provides different (NULL) VG then FAILED_INCONSISTENT. Mark it with different failure bit - since FAILED_INCONSISTENT is supposed to contain something 'usable' (thought inconsistent).
* lvmcache: remove unnecessary line break syntaxDavid Teigland2014-11-131-1/+0
|
* lvmcache.7: remove unwanted line continuation syntaxDavid Teigland2014-11-131-1/+1
|
* lvconvert.8: fix bold and italic syntax mistakeStéphane Aulery2014-11-131-1/+1
| | | | Signed-off-by: Stéphane Aulery <saulery@free.fr>
* cleanup: remove unused headersZdenek Kabelac2014-11-134-5/+0
|
* cleanup: validate pointersZdenek Kabelac2014-11-134-6/+16
| | | | Mostly on almost impossible to happen paths - but stay safe.
* lvm2api: use fully initilized structZdenek Kabelac2014-11-131-3/+4
| | | | Don't pass partially initialized struct.
* reporter: drop mem on error pathZdenek Kabelac2014-11-131-0/+1
| | | | Coverity noticed.
* cache: wrong feature in seg is internal errorZdenek Kabelac2014-11-131-1/+1
|
* cleanup: free mempool memory used for LV status in PVSEGS reportingPeter Rajnoha2014-11-131-1/+4
| | | | Addendum to previous commit 4de7699855e06bf341d5f91b9c3fc4ba4de18cd6.
* cleanup: unify LV info and LV segment status reporting in combination with ↵Peter Rajnoha2014-11-131-112/+179
| | | | | | | | LVS, SEGS and PVSEGS reporting Move common code into shared internal fn so the logic for getting the LV info as well LV segment status is not scattered around - call common _do_info_and_status to gather required parts in reporting handlers.
* cleanup: cleanup internal interface to acquire segment statusPeter Rajnoha2014-11-133-48/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | - Add separate lv_status fn (if we're interested only in seg status, but not lv info at the same time as it is with existing lv_info_with_seg_status fn). So we 3 fns: - lv_info (existing one, runs only info ioctl, fills in struct lvinfo only) - lv_status (new one, runs status ioctl, fills in struct lv_seg_status only) - lv_info_with_seg_status (existing one, runs status ioctl, fills in struct lvinfo as well as lv_seg_status) - Add more comments in the code explaining the difference between lv_info, lv_status and lv_info_with_seg_status and their return values. - Move decision whether lv_info_with_seg_status needs to call only status ioctl (in case the segment for which we require status is from the LV for which we require info) or separate status and info ioctl (in case the segment for which we require status is from different LV that the one for which we require info) into lv_info_with_seg_status fn so caller doesn't need to bother about this at all. - Cleanup internal interface for this seg status so it's more readable.
* pvck: Use non-zero exit status after failure.Alasdair G Kergon2014-11-132-4/+9
|
* cleanu: drop duplicate constZdenek Kabelac2014-11-131-1/+1
|
* pool: fix removal of pool metadata spareZdenek Kabelac2014-11-132-37/+58
| | | | | | | | | Since we support device stack of pools over pool (thin-pool with cache data volume) the existing code is no longer able to detect orphan _pmspare. So instead do a _pmspare check after volume removal, and remove spare afterwards.
* cache: improve pending_deleteZdenek Kabelac2014-11-131-56/+65
| | | | | | | | | | | | | We need to stop guessing deleted names - so rather collect deleted UUID into a string list - and then remove them properly in _clean_tree. Restore origin _clean_tree behaviour them for currently unconverted removal of snapshots. Pending delete feature now properly tracks whole subtree of cache (so i.e. data or metadata as raid volumes). It properly replaces all related volumes with 'errors' in suspend preload, then resume them as error and remove collected UUIDs from root - since they are not longer part of any volume deps.
* coverity: commit ba2302346 - report log_sys_error properlyPeter Rajnoha2014-11-121-1/+1
| | | | | log_sys_error uses errno, hence we need to report the first failure before reporting another failure that uses errno as well.
* coverity: fix possible dereference of NULL pointerPeter Rajnoha2014-11-121-0/+5
| | | | | | This would be in case the pool segment was not found. LVM2.2.02.112/lib/metadata/pool_manip.c:238:36: warning: Access to field 'segtype' results in a dereference of a null pointer (loaded from variable 'pool_seg')
* coverity: fix possible integer overflowPeter Rajnoha2014-11-122-3/+3
| | | | | | LVM2.2.02.112/lib/metadata/cache_manip.c:73: overflow_before_widen: Potentially overflowing expression "*pool_metadata_extents *vg->extent_size" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned). LVM2.2.02.112/lib/activate/dev_manager.c:217: overflow_before_widen: Potentially overflowing expression "seg_status->seg->len * extent_size" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned). LVM2.2.02.112/lib/activate/dev_manager.c:217: overflow_before_widen: Potentially overflowing expression "seg_status->seg->le * extent_size" with type "unsigned int" (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type "uint64_t" (64 bits, unsigned).
* coverity: fix compiler warningPeter Rajnoha2014-11-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | LVM2.2.02.112/lib/activate/dev_manager.c:196:5: warning: 'dmtask' may be used uninitialized in this function [-Wmaybe-uninitialized] In _info_run fn: switch (type) { case INFO: ... case STATUS: ... case MKNODES: ... } The "type" is enum and currently only those three types are supported, but if we added a new type in the future, this would end up with a bug (if we forgot to add the new "case" in that "switch"). So let's make sure proper internal error is printed: default: log_error(INTERNAL_ERROR "_info_run: unhandled info type"); return 0;
* cache: fix clean_treeZdenek Kabelac2014-11-122-5/+7
| | | | | | | Fix 8121074fda126cc6c0df05fba066cc9365e00255 - the patch incorrectly removed also other top-level nodes. It needs to deactivate purely subnodes of _corig.
* man: fix (\+) syntax warning of GroffStéphane Aulery2014-11-122-4/+5
| | | | Signed-off-by: Stéphane Aulery <saulery@free.fr>
* coverity: remove redundant conditionPeter Rajnoha2014-11-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | LVM2.2.02.112/daemons/clvmd/clvmd.c:1131: warning[arrayIndexOutOfBoundsCond]: Array 'row[8]' accessed at index 8, which is out of bounds. Otherwise condition 'j==8' is redundant. This code: int i,j = 0; ... for (i = 0; i < len; ++i) { ... if ((j == 8) || (i + 1 == len)) { for (;j < 8; ++j) { ... } ... j = 0; } } Indeed - j is 0 at the beginning, then iterating till j < 8, then always zeroed at the end of the outer loop - so "j" never reaching value of 8 - the j == 8 condition is redundant.
* coverity: fix resource leaksPeter Rajnoha2014-11-123-3/+8
| | | | | | LVM2.2.02.112/tools/toollib.c:1991: leaked_storage: Variable "iter" going out of scope leaks the storage it points to. LVM2.2.02.112/lib/filters/filter-usable.c:89: leaked_storage: Variable "f" going out of scope leaks the storage it points to. LVM2.2.02.112/lib/activate/dev_manager.c:1874: leaked_handle: Handle variable "fd" going out of scope leaks the handle.
* post-releaseAlasdair G Kergon2014-11-114-2/+8
|
* pre-releasev2_02_112Alasdair G Kergon2014-11-1116-46/+48
|
* dev_manager: only support status for cache segment at the momentPeter Rajnoha2014-11-111-4/+8
| | | | | | | | | | | | | | | | | | When getting status for LV segment types, we need to be sure that proper segment is selected for the status ioctl. When reporting fields that require status ioctl, the "_choose_lv_segment_for_status_report" fn in tools/reporter.c must be completed properly to choose the proper segment for all the LV types (at the moment, it just takes the first LV segment by default). This works fine with cache LVs surely. The other segment types need more auditing. We use this status ioctl only for cache status fields at the moment only, so restrict it to the cache only. Once the _choose_lv_segment_for_status_report is completed properly, release the restriction in _get_segment_status_from_target_params.
* cache: pending_delete fixesZdenek Kabelac2014-11-114-15/+46
|
* cache: never create new table entry for deleted cacheZdenek Kabelac2014-11-111-0/+4
|
* cache: no status for pending deleted cacheZdenek Kabelac2014-11-111-0/+3
|
* WHATS_NEW: '_' -> ','Peter Rajnoha2014-11-111-1/+1
|
* report: add cache device status fieldsPeter Rajnoha2014-11-114-0/+50
| | | | | | | | | | | New reporting fields related to cache device status: - cache_total_blocks - cache_used_blocks - cache_dirty_blocks - cache_read_hits - cache_read_misses - cache_write_hits - cache_write_misses
* dev_manager: enhance dev_manager_info to acquire LV segment status if ↵Peter Rajnoha2014-11-115-33/+160
| | | | requested, add lv_info_with_seg_status fn
* report: add new LVSSTATUS and SEGSSTATUS report typePeter Rajnoha2014-11-113-17/+121
| | | | | | | | | | | | Similar to LVSINFO type which gathers LV + its DM_DEVICE_INFO, the new LVSSTATUS/SEGSSTATUS report type will gather LV/segment + its DM_DEVICE_STATUS. Since we can report status only for certain segment, in case of LVSSTATUS we need to choose which segment related to the LV should be processed that represents the "LV status". In case of SEGSSTATUS type it's clear - the status is reported for the segment just processed.
* refactor: rename struct lv_with_info used in reporting code to ↵Peter Rajnoha2014-11-114-51/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lv_with_info_and_seg_status The former struct lv_with_info is renamed to lv_with_info_and_seg_status as it can hold more than just "info", there's lv's segment status now in addition: struct lv_with_info_and_seg_status { struct logical_volume *lv; struct lvinfo *info; struct lv_seg_status *seg_status; } Where struct lv_seg_status is: struct lv_seg_status { struct dm_pool *mem; struct lv_segment lv_seg; lv_seg_status_type_t type; void *status; /* struct dm_status_* */ } Where lv_seg points to lv's segment that is being reported or processed in general. New struct lv_seg_status keeps the information about segment status - the status retrieved via DM_DEVICE_STATUS ioctl. This information will be used for reporting dm device target status for the LV segment specified. So this patch introduces third level of LV information that is kept for reuse while reporting fields within one reporting line, causing only one DM_DEVICE_STATUS ioctl call per LV segment line reported (otherwise we'd need to call the DM_DEVICE_STATUS for each segment status field in one LV segment/reporting line which is not efficient). This is following exactly the same principle as already introduced by commit ecb2be5d1642aa0142d216f9e52f64fd3e8c3fc8. So currently we have three levels of information that can be used to report an LV/LV segment: - LV metadata itself (struct logical_volume *lv) - LV's DM_DEVICE_INFO ioctl result (struct lvinfo *info) - LV's segment DM_DEVICE_STATUS ioctl result (this status must be bound to a segment, not the whole LV as the whole LV may be composed of several segments of course) (this is the new struct lv_seg_status *seg_status)
* libdm: still better APIZdenek Kabelac2014-11-115-30/+47
| | | | | | | | | | | | | | | | | Do not use 'any' policy name as a value in config tree - so we stick with 'policy_settings' and extra 'policy_name' for libdm params. Update lvm2 API as well. Example of supported metadata: policy = "mq" policy_settings { migration_threshold = 2048 sequential_threshold = 512 random_threshold = 4 read_promote_adjustment = 10 }
* dev_manager: workaround to allow top-level _tmeta, _tdataZdenek Kabelac2014-11-111-0/+4
|
* mirror: layer remove doesn't work properly with mirrorsZdenek Kabelac2014-11-101-8/+9
|
* tests: reach cache paramsZdenek Kabelac2014-11-101-4/+7
|
* tests: cache snapshotZdenek Kabelac2014-11-101-0/+8
|
* debug: log tree type is createdZdenek Kabelac2014-11-101-1/+7
| | | | Print tree type and use internal_error for unknown type.
* cleanup: gcc warningsZdenek Kabelac2014-11-104-4/+5
|