summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* man: add update_filemap to dmstats.8.indev-bmr-dmstats-filemap-updateBryn M. Reeves2017-01-251-0/+26
|
* dmstats: allow --filemap groups to be updatedBryn M. Reeves2017-01-251-9/+122
| | | | | | | | | | | | | | | Add a new update_filemap command to dmstats that allows a filemap group to be updated: # dmstats update_filemap --groupid 0 vm.img /var/lib/libvirt/images/vm.img: Updated group ID 0 with 137 region(s). This will update the set of regions mapped to the file to reflect the current file system allocation. Currently this needs to be run manually - a future update will add support for monitoring file maps via a daemon, allowing them to be automatically updated when the underlying file is modified.
* libdm: add dm_stats_update_regions_from_fd()Bryn M. Reeves2017-01-253-37/+391
| | | | | | | | | | | | | | | | | | | | | | | Add a call to update the regions corresponding to a file mapped group of regions. The regions to be updated must be grouped, to allow us to correctly identify extents that have been deallocated since the map was created. Tables are built of the file extents, and the extents currently mapped to dmstats regions: if a region no longer has a matching file extent, it is deleted, and new regions are created for any file extents without a matching region. The FIEMAP call returns extents that are currently in-memory (or journaled) and awaiting allocation in the file system. These have the FIEMAP_EXTENT_UNKNOWN | FIEMAP_EXTENT_DELALLOC flag bits set in the fe_flags field - these extents are skipped until they have a known disk location. Since it is possile for the 0th extent of the file to have been deallocated this must also handle the possible deletion and re-creation of the group leader: if no other region allocation is taking place the group identifier will not change.
* libdm: test for DM_STATS_GROUP_NOT_PRESENT in _stats_group_id_presentBryn M. Reeves2017-01-251-0/+3
| | | | | | If the group_id passed to _stats_group_id_present is equal to the special value DM_STATS_GROUP_NOT_PRESENT there is no need to perform any further tests: return false immediately.
* libdm: fix stats comment formatting in libdevmapper.hBryn M. Reeves2017-01-241-3/+3
|
* toolcontext: action for LVM_RUN_BY_DMEVENTD env varZdenek Kabelac2017-01-232-0/+8
| | | | | When LVM_RUN_BY_DMEVENTD is set to 1, ensure there will be no interaction with dmeventd.
* dmeventd_thind: set LVM_RUN_BY_DMEVENTDZdenek Kabelac2017-01-231-5/+9
| | | | | Set LVM_RUN_BY_DMEVENTD envvar to expose the command is runing from dmeventd environment.
* clean: move code to lib partZdenek Kabelac2017-01-233-4/+13
| | | | | Move actual processing part of the lvm2_disable_dmeventd_monitoring() into a /lib part so we can reuse the code later for other cases.
* tests: umount when above 95Zdenek Kabelac2017-01-211-0/+6
| | | | | Add code to check if resulting data or metadata remained over 95% and in such case invoke umount.
* tests: properly quote heredocZdenek Kabelac2017-01-211-7/+9
| | | | | | Prepend \$ for vars which should remain in script. Also drop --lazy umount. Move inittest call up, so mntdir and mntusedir have proper full path.
* tests: implement umount in scriptZdenek Kabelac2017-01-211-0/+16
| | | | | | Since dmeventd no longer umounts thin devices, such logic needs to be implemented by external script. Add some very simple one for the start.
* tests: enusure units in TiBZdenek Kabelac2017-01-211-4/+4
|
* dmeventd_thin: internal command without lvm prefixZdenek Kabelac2017-01-211-1/+2
| | | | Internal command processing needs to go without 'lvm ' prefix.
* dmeventd_thin: enable support for external commandZdenek Kabelac2017-01-212-2/+2
| | | | | With this commit we start to support configurable action from thin-pool monitoring via 'dmeventd/thin_command'
* dmeventd_thin: new logic for calling commandsZdenek Kabelac2017-01-201-20/+24
| | | | | | | | | | | | | | | | | | | | | | | For more advanced support we need to ensure better logic for calling external much more advanced script for maintanance of thin-pool. So this new code ensures: When thin-pool data or metadata is bigger then 50%, then with each 5% increment, action is called. This is independent from autoextend_threshold. This action always happens when thin-pool is over threshold, (so no action when it's exactly i.e. 60%). The only exception is 100% full thin-pool - which invokes 'last' action. Since thin-pool occupancy may change also downward, code needs to also handle possibly reduction of occupancy of thin-pool. So when usage drop from 90% to 50%, thin-pool will start to call again action when it will pass 55% threshold. This give external commands lot of option i.e. to call 'fstrim' before actual resize is needed.
* dmeventd_thin: drop umounting on error pathZdenek Kabelac2017-01-201-257/+2
| | | | | | | Default internal logic will stop trying to do any 'rescue' action when executed command fails. This will be now fully in hands of external script if such behaviour is needed.
* dmeventd_thin: rework failure handlingZdenek Kabelac2017-01-201-8/+20
| | | | | | | | | Instead of stopping monitoring after couple failing retries, keep monitoring forever, just make larger delays between command retries (ATM upto ~42 minutes). So syslog is not spammed too often, yet commands have a chance to be retried and succeed eventually...
* dmeventd_thin: SIGCHLD handlerZdenek Kabelac2017-01-201-0/+40
| | | | | | To improve reaction time on when child is finished, lets handle SIGCHLD in particular thread. Let's hope kernel will route SIGCHLD to matching thread.
* dmeventd_thin: init commandZdenek Kabelac2017-01-201-0/+16
| | | | | | When dmeventd configured command does not start with 'lvm ' prefix, it's going to be an 'external' command. In this case we split command by spaces to argv strings.
* dmeventd_thin: add wait_pidZdenek Kabelac2017-01-201-0/+55
| | | | Add support handling command exit.
* dmeventd_thin: add run_commandZdenek Kabelac2017-01-201-4/+49
| | | | | Implement forking of executable command. When command is forked, dmeventd may continue monitor device.
* dmeventd_thin: better warning logicZdenek Kabelac2017-01-201-7/+12
| | | | | | When fullness is passing WARN_THRESHOLD, print warning, when it drops bellow and crossed again, we should print warning again, but always only once.
* dmeventd_thin: switch to struct percentZdenek Kabelac2017-01-201-18/+15
| | | | | Later we can use stored percent values to pass them to executed commands.
* dmeventd_thin: handling of internal commandZdenek Kabelac2017-01-201-0/+16
|
* lvmcmd2lib: support new commandZdenek Kabelac2017-01-202-1/+5
| | | | | Internal command which reads lvm.conf settins and passes it via envvar to dmeventd monitoring thread.
* config: new option dmeventd/thin_commandZdenek Kabelac2017-01-204-0/+16
| | | | | This setting will allowing configuring which command gets executed when thin-pool fullness goes from 50%..100%
* cleanup: update config docZdenek Kabelac2017-01-201-1/+2
|
* libdm: add human R|readable unitsZdenek Kabelac2017-01-205-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When showing sizes with 'H|human' units we do use standard rounding. This however is confusing users from time to time, when the printed number uses some biger units i.e. GiB and there is just tiny fraction of space missing. So here is some real-life example with new 'r' unit. $lvs LV VG Attr LSize Pool Origin lvol0 vg -wi-a----- 1.99g lvol1 vg -wi-a----- <2.00g lvol2 vg -wi-a----- <2.01g Meaning is - lvol1 has 'slightly' less then 2.00g - from sign '<' user can be aware the LV doesn't have full 2.00GiB in size so he will be less surpriced allocation of 2G volume will not succeed. $ vgs VG #PV #LV #SN Attr VSize VFree vg 2 2 0 wz--n- <6,00g <2,01g For uses needing 'old' undecorated human unit simply will continue to use 'H|h' units. The new R|r may further change when we would recongnize some other way how to improve readability.
* devices: Recognise Veritas Dynamic MultipathingAlasdair G Kergon2017-01-103-0/+12
| | | | | | VxDMP doesn't interact very well with udev so always set devices/obtain_device_list_from_udev = 0 in lvm.conf on these systems.
* tests: ignore racy test failureZdenek Kabelac2017-01-061-2/+5
| | | | | When test fails here, make it just warning instead of failing whole test.
* tests: make test more race immuneZdenek Kabelac2017-01-061-24/+25
| | | | | | Add more delay and increase raid size. Speedup volume during wait for sync. Drop --yes from lvcreate.
* raid: postpone archiving until metadata are changedZdenek Kabelac2017-01-061-3/+6
| | | | | Avoid archiving of lvm2 metadata when there is call of 'lvconvert --repair' on healthy raid LV.
* vgchange: also -l is uint32Zdenek Kabelac2017-01-062-2/+7
|
* mirror: relax internal error for a whileZdenek Kabelac2017-01-061-7/+35
| | | | | | | | | | | | | | With recent commit d6a74025df1afb3d76bec435bc6a40d649217b42 using INTERNAL_ERROR while cheking layer LV - it's been noticed mirror logic currently doesn't do a correct thing during upconversion and does a full-try instead of checking only allocator capabilities. This leads to invalid usage of layer. To keep existing code running before providing a fix, relax INTERNAL_ERROR just an error and keep the 'code' running. Once mirror code is fixed, these all check should be switched to internal errors.
* blkdeactivate: also unmount mount point on top of MD device if using ↵Peter Rajnoha2017-01-062-1/+3
| | | | | | | | | | | blkdeactivate -u The blkdeactivate script processes MD devices too so we should unmount any mount point on top of an MD device if blkdeactivate -u|--umount is called. Diagnosed and reported by: Rick Warner <rick@microway.com> See also https://bugzilla.redhat.com/show_bug.cgi?id=1410585.
* tests: slow down devs for raid moreZdenek Kabelac2017-01-052-36/+57
| | | | | | | Since we still experience occasiaonal test failure - slow things down even more to avoid race. Add support for 'quick' table changes between normal & delayed tables.
* tests: drop FIXMEZdenek Kabelac2017-01-051-5/+2
| | | | | | Since we fixed core trouble with sequence of suspend/resume/suspend without udev wait we can drop 'should' and expect volume is still mounted.
* report: report merged state for inactive LVZdenek Kabelac2017-01-051-1/+4
| | | | | | | This was missing piece in 77997c7673bfca56f51ae4eb55a50bc76e40fe79. When merging origin is inactive (while driver is loaded) we could already report merge in progress values as there is no way to activate 'old state' now.
* debug: show proper error message for layer mismatchZdenek Kabelac2017-01-051-2/+5
| | | | | | | | | Show proper internal error for failing command when there are some inconsitencies in sizes of LV and its layer instead of rather meaningless error code 5. (Could be hit i.e. if user tried to 'resize' cached LV and then uncache such LV.)
* cache: resize is still unsupportedZdenek Kabelac2017-01-052-0/+6
| | | | | | | During rework of resize code this validation check has been lost (in my resize branch). Upstream is still not supporting resize of any cache type LV so needs to be prevented.
* cleanup: more use of lvseg_nameZdenek Kabelac2017-01-037-16/+7
| | | | Use existing function lvseg_name().
* cleanup: use macrosZdenek Kabelac2017-01-031-2/+2
|
* cleanup: definesZdenek Kabelac2017-01-031-5/+11
|
* cleanup: reuse existing codeZdenek Kabelac2017-01-031-20/+14
|
* cache: add missing udev waitZdenek Kabelac2017-01-032-1/+14
| | | | | | | | | | | | | | | | | | | When we need to clear dirty cache content of cached LV, there is table reload which usually is shortly followed by next metadata change. However udev can't (as of now) process udev event while device is 'suspended'. So whenever sequence of 'suspend/resume/suspend' is needed, we need to wait first for finishing of 'resume' processing before starting next 'suspend'. Otherwise there is 'race' danger of triggering unwantend umount by systemd as such event will trigger SYSTEMD_READY=0 state for a moment for such changed device. Such race is pretty ugly to trace so we may need to review more sequencies for missing 'sync'. (Other option is to enhnace 'udev' rules processing to avoid such dramatic actions to be happening for suspended devices).
* vgchange: max_pv limited to uint32Zdenek Kabelac2017-01-033-1/+9
| | | | | | | | | | | | | | | Solves: https://bugzilla.redhat.com/1280496 The only reasonable behaviour here is to error on any number out of accepted range (i.e. now numbers wrapping around with some hidden logic). As this is plain bug there is no support for backward compatibility since noone should set numbers >UINT32_MAX and expect 0 or error depending on how big number was used.... TODO: more fields might need to be converted.
* lvmcmdline: support uint32Zdenek Kabelac2017-01-032-0/+9
| | | | | | | | Add simple function to wrap usage for only uint32 numbers. Unlike 'int_arg' which accepts full range of 64bit number this function will error on numbers out of this range: <0, UINT32_MAX>
* man: fix name of 'write_time' field in dmstats.8.inBryn M. Reeves2016-12-251-1/+1
|
* tests: update testZdenek Kabelac2016-12-231-3/+12
| | | | | lvm2 now correctly reports thin_id after action of merged thin, but before physical metadata update as we know the merge has happened.
* validation: temporarily let pass linear with chunk_sizeZdenek Kabelac2016-12-231-0/+2
| | | | | Old pool format seems to be setting chunk_size. For now let validation pass with this.