summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* report: add cache device status fieldsdev-prajnoha-lv-segment-status-reportingPeter Rajnoha2014-11-073-0/+48
| | | | | | | | | | | 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-075-33/+143
| | | | requested, add lv_info_with_seg_status fn
* report: add new LVSSTATUS and SEGSSTATUS report typePeter Rajnoha2014-11-073-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-074-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)
* cleanup: avoid dm_list size calc in common pathZdenek Kabelac2014-11-051-14/+15
| | | | | Calculate dm_list_size only when there is not just a single ont segment in list - so it's only counted on error path.
* activate: check all snap segs are inactiveZdenek Kabelac2014-11-052-1/+15
| | | | | | | | | When deactivating origin, we may have possibly left table in broken state, where origin is not active, but snapshot volume is still present. Let's ensure deactivation of origin detects also all associated snapshots are inactive - otherwise do not skip deactivation. (so i.e. 'vgchange -an' would detect errors)
* lv: lv_active_change add needs_exclusive flagZdenek Kabelac2014-11-055-9/+9
| | | | | | | | | | | | | | Let's use this function for more activations in the code. 'needs_exlusive' will enforce exlusive type for any given LV. We may want to activate LV in exlusive mode, even when we know the LV (as is) supports non-exlusive activation as well. lvcreate -ay -> exclusive & local lvcreate -aay -> exclusive & local lvcreate -aly -> exclusive & local lvcreate -aey -> exclusive (might be on any node).
* snapshot: no snapshot of any cache type LVsZdenek Kabelac2014-11-052-0/+7
| | | | Unsupported as of now.
* cleanup: keep 'fall through' switch case for LVSINFO for compiler to ↵Peter Rajnoha2014-11-051-0/+2
| | | | understand this properly
* report: cleanup: simplify LVSINFO detectionPeter Rajnoha2014-11-051-8/+3
| | | | | | | | | | | | | | | | | | LVSINFO is just a subtype of LVS report type with extra "info" ioctl called for each LV reported (per output line) so include its processing within "case LVS" switch, not as completely different kind of reporting which may be misleading when reading the code. There's already the "lv_info_needed" flag set in the _report fn, so call the approriate reporting function based on this flag within the "case LVS" switch line. Actually the same is already done for LV is reported per segments within the "case SEGS" switch line. So this patch makes the code more consistent so it's processed the same way for all cases. Also, this is a preparation for another and new subtype that will be introduced later - the "LVSSTATUS" and "SEGSSTATUS" report type.
* dmeventd: Add basic thread debugging messages.Alasdair G Kergon2014-11-042-2/+90
| | | | Only with -DDEBUG.
* dmeventd: Include shutdown threads in responses.Alasdair G Kergon2014-11-042-0/+13
| | | | | | | | | | | | | | | When responding to DM_EVENT_CMD_GET_REGISTERED_DEVICE no longer ignore threads that have already been unregistered but which are still present. This means the caller can unregister a device and poll dmeventd to ensure the monitoring thread has gone away before removing the device. If a device was registered and unregistered in quick succession and then removed, WAITEVENT could run in parallel with the REMOVE. Threads are moved to the _thread_registry_unused list when they are unregistered.
* dmeventd: Remove redundant checks.Alasdair G Kergon2014-11-041-10/+4
| | | | | | | The status of threads in _thread_registry is always DM_THREAD_RUNNING (zero). DM_EVENT_REGISTRATION_PENDING is never stored in thread->events.
* tests: duplicate update of configZdenek Kabelac2014-11-041-3/+1
|
* thin: new pool is activated without overlayZdenek Kabelac2014-11-042-3/+16
| | | | | | | | | | | | | | | | | | Activate of new/unused/empty thin pool volume skips the 'overlay' part and directly provides 'visible' thin-pool LV to the user. Such thin pool still gets 'private' -tpool UUID suffix for easier udev detection of protected lvm2 devices, and also gets udev flags to avoid any scan. Such pool device is 'public' LV with regular /dev/vgname/poolname link, but it's still 'udev' hidden device for any other use. To display proper active state we need to do few explicit tests for this condition. Before it's used for any lvm2 thin volume, deactivation is now needed to avoid any 'race' with external usage.
* thin: check for new pool before creating thin volumeZdenek Kabelac2014-11-042-2/+36
| | | | | | | | | | | | | | | Call check_new_thin_pool() to detect in-use thin-pool. Save extra reactivation of thin-pool when thin pool is not active. (it's now a bit more expensive to invoke thin_check for new pools.) For new pools: We now active locally exclusively thin-pool as 'public' LV. Validate transaction_id is till 0. Deactive. Prepare create message for thin-pool and exclusively active pool. Active new thin LV. And deactivate thin pool if it used to be inactive.
* thin: validate unused thin poolZdenek Kabelac2014-11-042-0/+55
| | | | Function tests, that given new thin pool is still unused.
* thin: no validation skip of new thin poolsZdenek Kabelac2014-11-041-0/+3
| | | | | | | | Allowing 'external' use of thin-pools requires to validate even so far 'unused' new thin pools. Later we may have 'smarter' way to resolve which thin-pools are owned by lvm2 and which are external.
* thin: add lv_is_new_thin_poolZdenek Kabelac2014-11-041-0/+1
| | | | | Recognize 'new' (and never used) lvm2 thin pool - it has 'transaction_id' == 0 (lv_is_used_thin_pool() has slightly different meaning).
* libdm: allow to activate any pool with tid == 0Zdenek Kabelac2014-11-042-1/+4
| | | | | | | | | | | | | When transaction_id is set 0 for thin-pool, libdm avoids validation of thin-pool, unless there are real messages to be send to thin-pool. This relaxes strict policy which always required to know in front transaction_id for the kernel target. It now allows to activate thin-pool with any transaction_id (when transaction_id is passed in) It is now upto application to validate transaction_id from life thin-pool volume with transaction_id within it's own metadata.
* lvconvert: convert missing sizes to extentsZdenek Kabelac2014-11-041-3/+3
| | | | | | | After initial 'size' usage converted to extents, continue to use only extents. (in-release fix).
* tests: thinZdenek Kabelac2014-11-031-1/+3
|
* tests: usage of -m0 -MnZdenek Kabelac2014-11-032-1/+18
| | | | | Test -m0 passed with types. Check --readahead and thins.
* cleanup: use lv_is_poolZdenek Kabelac2014-11-031-2/+2
| | | | Use lv_is_pool() to detect both pool versions.
* cleanup: use logical_volume* directlyZdenek Kabelac2014-11-031-9/+9
|
* cleanup: consistent nameZdenek Kabelac2014-11-031-1/+1
|
* cleanup: shorter codeZdenek Kabelac2014-11-031-2/+1
|
* cleanup: rename functionZdenek Kabelac2014-11-031-12/+12
| | | | Make more clear dm_info type.
* cleanup: standard params orderingZdenek Kabelac2014-11-031-6/+6
| | | | Pass lvconvert_params as last arg.
* cleanup: init of lcpZdenek Kabelac2014-11-031-3/+2
| | | | Use struct initializer instead of memset().
* cleanup: correcting tracingZdenek Kabelac2014-11-032-5/+6
| | | | Use log_error for real error.
* cleanup: use arg_is_setZdenek Kabelac2014-11-031-3/+2
|
* cache: report stats for cache volumes usageZdenek Kabelac2014-11-033-4/+49
| | | | | | | | | | | | Show some stats with 'lvs' Display same info for active cache volume and cache-pool. data% - #used cache blocks/#total cache blocks meta% - #used metadata blocks/#total metadata blocks copy% - #dirty/#used cache blocks TODO: maybe there is a better mapping - should be seen as first-try-and-see.
* cache: wipe cache-pool before reuseZdenek Kabelac2014-11-031-0/+4
| | | | | Before we reuse cache-pool - we need to ensure metadata volume has wiped header.
* cache: support activation of empty cache-poolZdenek Kabelac2014-11-031-8/+16
| | | | | | | | When the cache pool is unused, lvm2 code will internally allow to activate such cache-pool. Cache-pool is activate as metadata LV, so lvm2 could easily wipe such volume before cache-pool is reused.
* cache: lv_cache_statusZdenek Kabelac2014-11-036-154/+60
| | | | | | | | | | Replace lv_cache_block_info() and lv_cache_policy_info() with lv_cache_status() which directly returns dm_status_cache structure together with some calculated values. After use mem pool stored inside lv_status_cache structure needs to be destroyed.
* cleanup: add arg to _setup_taskZdenek Kabelac2014-11-031-50/+17
| | | | | | | | Add init of no_open_count into _setup_task(). Report problem as warning (cannot happen anyway). Also drop some duplicated debug messages - we have already printed the info about operation so make log a bit shorter.
* cleanup: rename virtual_extentsZdenek Kabelac2014-11-035-32/+28
| | | | | Use standard 'virtual_extents' naming. Move virtual_size into 'lcp' struct out of lvcreate_params.
* cleanup: use extents to pass size to /libZdenek Kabelac2014-11-036-54/+70
| | | | Lib takes sizes in extens - do the same for pool_metadata.
* cache: add wipe_cache_poolZdenek Kabelac2014-11-032-0/+42
| | | | | Add function for wiping cache pool volume. Only unused cache-pool could be wiped.
* cache: allow deactivation of empty poolZdenek Kabelac2014-11-033-8/+18
| | | | | | | | Tool will use internal activation of unused cache pool to clear metadata area before next use of cache-pool. So allow to deactivation unused pool in case some error case happend and we were not able to deactivation pool right after metadata wipe.
* cache: convert thin-poolZdenek Kabelac2014-11-032-9/+9
| | | | | | | Support caching of thin-pool. lvresize needs to be resolved - so far, user has to manually drop cache-pool before resizing.
* thin: allow to convert chunksize of empty poolZdenek Kabelac2014-11-031-1/+2
| | | | When pool is not used, allow to change its chunksize.
* thin: reporting of thin volumes simplifiedZdenek Kabelac2014-11-032-33/+13
| | | | | | | Simplify reporting of percentage. Allows easier support for more types. Move testing of device availability into activate.c
* pool: validate sizesZdenek Kabelac2014-11-031-5/+14
| | | | 0 size are not supported as well as negative.
* filters: change return codeZdenek Kabelac2014-11-031-1/+1
| | | | | | No data for writing should be seen as 'dump' success. (reduces one <bactrace> in the log) - it has no other effect.
* lvcreate: tollerate defaultsZdenek Kabelac2014-11-031-11/+12
| | | | | lvcreate -m0 and -Mn goes with anything. Read ahead works either with pools or thin/cache, but not with both.
* libdm: init char arrayZdenek Kabelac2014-11-032-1/+2
| | | | | When non-root uses dm_check_version() it's been printing some unit values from stack. So always init those vars.
* tests: update raid syncZdenek Kabelac2014-10-311-2/+1
|
* tests: wait for raid syncZdenek Kabelac2014-10-311-0/+2
|