summaryrefslogtreecommitdiff
path: root/lib/mirror
Commit message (Collapse)AuthorAgeFilesLines
* lv_info: missing check for info.existsZdenek Kabelac2021-03-141-2/+2
| | | | | When &info is passed in, user needs to check for exists. When there is NULL, return value includes check for exists.
* targets: use target_present_versionZdenek Kabelac2021-02-081-1/+2
| | | | Skip duplicated dm version ioctl() on every startup.
* pvmove: remove some cmirror related codeDavid Teigland2019-10-111-30/+0
| | | | which is no longer used
* lvmlockd: do not allow mirror LV to be activated sharedDavid Teigland2019-04-041-9/+0
| | | | | | | | This reverts 518a8e8cfbb672c2bf5e3455f1fe7cd8d94eb5b0 "lvmlockd: activate mirror LVs in shared mode with cmirrord" because while activating a mirror LV with cmirrord worked, changes to the active cmirror did not work.
* cov: drop uneeded header filesZdenek Kabelac2018-10-151-1/+0
|
* Merge branch '2018-06-04-data-structs'Joe Thornber2018-06-081-3/+4
|\
| * device_mapper: remove dbg_malloc.Joe Thornber2018-06-081-3/+4
| | | | | | | | | | I wrote dbg_malloc before we had valgrind. These days there's just no need.
* | build: drop exported symbolsZdenek Kabelac2018-06-081-1/+0
|/ | | | | This libs are no longer possible to create, drop maintanence of exported symbols.
* Remove clvmd and associated codeDavid Teigland2018-06-051-14/+1
| | | | More code reduction and simplification can follow.
* build: Don't generate symlinks in include/ dirJoe Thornber2018-05-141-12/+12
| | | | | | | As we start refactoring the code to break dependencies (see doc/refactoring.txt), I want us to use full paths in the includes (eg, #include "base/data-struct/list.h"). This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in metadata/ from base/
* build: remove --with-{snapshots,mirrors,raid,thin,cache} options from ↵Joe Thornber2018-04-301-26/+0
| | | | | | ./configure It now behaves as if the were all set as 'internal'
* mirror: improve table updateZdenek Kabelac2018-04-301-5/+6
| | | | | | | | | | | | Shift refresh of mirror table right into monitor_dev_for_events(). Use !vg_write_lock_held() to recognize use of lvchange/vgchange. (this shall change if this would no longer work, but requires futher some API changes). With this patch dm mirror table is only refreshed when necassary. Also update WARNING message about mirror usage without monitoring and display LV name.
* mirror: block_on_error only with monitoringZdenek Kabelac2018-04-201-2/+8
| | | | | | | | | | | When user configured lvm2 to NOT user monitoring, activated mirror actually hang upon error and it's quite unusable moment. So instead Warn those 'brave' non-monitoring users about possible problem and activation mirror without blocking error handling. This also makes it a bit simpler for test suite to handle trouble cases when test is running without dmeventd.
* mirror: fix region_size for clustered VGZdenek Kabelac2018-04-201-6/+6
| | | | | | | | | | | | | | When adjusting region size for clustered VG it always needs to fit 2 full bitset into 1MB due to old limits of CPG. This is relatively big amount of bits, but we have still limitation for region size to fit into 32bits (0x8000000). So for too big mirrors this operation needs to fail - so whenever function returns now 0, it means we can't find matching region_size. Since return 0 is now 'error' we need to also pass proper region_size when creating pvmove mirror.
* gcc: remove warns about free of constZdenek Kabelac2018-02-131-1/+1
|
* segtype: replace mempool allocationZdenek Kabelac2018-02-131-0/+1
| | | | | | | | | | | | | So this is a bit more complex and possibly worth futher checking. ATM clvmd drops cmd->mem mempool AFTER refresh of cmd. So anything allocating from cmd->mem during toolcontext init will likely die at some point in time. As a quick fix - just use regular malloc/free for 'dso' alloction. It's worth to note - cmd->libmem seems to be often misused causing hidden memleaking for clvmd.
* segtype: better get_monitor_dso_path apiZdenek Kabelac2018-02-121-2/+1
| | | | | | Instead of allocating always 4K for dso path, use only real needed size. Also simplify API call and move common functionality into function itself.
* cleanup: decode dso path just onceZdenek Kabelac2018-02-121-8/+6
| | | | | | | | Build dso plugin name during segtype initialisation and just use the string during command life-time. Also slightlt update message verbosity and make it very_verbose when operation is going to be made and 'verbose' when it's done.
* activation: separate reporting of error and monitoring statusZdenek Kabelac2018-02-121-2/+2
| | | | | | | | | Avoid using same return code for reporting 2 different things and stricly report error code by return value and add new parameter for reporting monitoring status. This makes easier to recognize which error we got from dm_event and continue only with ENOENT.
* pvmove: enhance delayed_resume logicZdenek Kabelac2017-11-261-1/+1
| | | | | | | | | | | | ATM we want to support delayed resume purely in pvmove case. So have libdm logic internal to recognize difference beween pvmove and other targets that do use delayed resume. This fixes problem introduced with commit aa68b898ff9c51dcb for mirror-on-mirror or snapshot-on-mirror problem. TODO: likely added new API call and let libdm user select delayed nodes explicitely.
* lvmlockd: activate mirror LVs in shared mode with cmirrordDavid Teigland2017-09-201-0/+9
| | | | | Previously lvmlockd disallowed mirror LVs to be activated in shared mode.
* mirror/raid: display adjusted region size with unitsHeinz Mauelshagen2017-04-201-1/+2
| | | | Display adjusted region size in units (e.g. "4.00 MiB") rather than sectors.
* activate: Use macros for target and module names.Alasdair G Kergon2016-03-221-6/+6
|
* doc: change fsf addressZdenek Kabelac2016-01-212-2/+2
| | | | | Hmm rpmlint suggest fsf is using a different address these days, so lets keep it up-to-date
* segtype: check for activationZdenek Kabelac2016-01-141-1/+6
| | | | | Before setting static variable with check passed state, detect if we are allowed to talk to driver.
* cleanup: use dm_get_status_mirrorZdenek Kabelac2015-12-011-115/+52
| | | | Use libdm function to parse mirror status report.
* lib: pass mem pool to check_transient_statusZdenek Kabelac2015-12-011-1/+1
| | | | | check_transient_status() may need to allocate some memory, so pass in already existing mem pool.
* segtypes: Use SEG_TYPE_NAME_ string constants.Alasdair G Kergon2015-09-221-1/+1
|
* macros: Wrap PRI with FMT.Alasdair G Kergon2015-07-061-1/+1
| | | | | Create a set of wrappers with embedded % such as #define FMTu64 "%" PRIu64
* cmirror: Adjust region size to work around CPG msg limit to avoid hang.Jonathan Brassow2015-02-251-1/+2
| | | | | | | | | | | | | | | | | | | | | cmirror uses the CPG library to pass messages around the cluster and maintain its bitmaps. When a cluster mirror starts-up, it must send the current state to any joining members - a checkpoint. When mirrors are large (or the region size is small), the bitmap size can exceed the message limit of the CPG library. When this happens, the CPG library returns CPG_ERR_TRY_AGAIN. (This is also a bug in CPG, since the message will never be successfully sent.) There is an outstanding bug (bug 682771) that is meant to lift this message length restriction in CPG, but for now we work around the issue by increasing the mirror region size. This limits the size of the bitmap and avoids any issues we would otherwise have around checkpointing. Since this issue only affects cluster mirrors, the region size adjustments are only made on cluster mirrors. This patch handles cluster mirror issues involving pvmove, lvconvert (from linear to mirror), and lvcreate. It also ensures that when users convert a VG from single-machine to clustered, any mirrors with too many regions (i.e. a bitmap that would be too large to properly checkpoint) are trapped.
* segtype: drop cmdcontex pointerZdenek Kabelac2014-10-301-2/+0
| | | | | Users of context provide their cmd pointer, so don't keep it inside segtype.
* cleanup: drop default implementationZdenek Kabelac2014-10-241-6/+0
| | | | | | | | Now we reference segment name via lvseg_name() and we can drop default implementation and leave its function pointer to be NULL. Default give us 'return seg->segtype->name'.
* mirror: extend adjusted_mirror_region_size APIZdenek Kabelac2014-09-241-1/+1
| | | | | | | | | | We use adjusted_mirror_region_size() in two different contexts. Either on command line - here we do want to inform user about reduction of size. Or in pvmove activation context - here we should only use 'verbose' info.
* mirrors: Fix checks for mirror/raid/pvmove LVs.Alasdair G Kergon2014-09-161-1/+1
| | | | | | | | | | | | | | | | | Try to enforce consistent macro usage along these lines: lv_is_mirror - mirror that uses the original dm-raid1 implementation (segment type "mirror") lv_is_mirror_type - also includes internal mirror image and log LVs lv_is_raid - raid volume that uses the new dm-raid implementation (segment type "raid") lv_is_raid_type - also includes internal raid image / log / metadata LVs lv_is_mirrored - LV is mirrored using either kernel implementation (excludes non-mirror modes like raid5 etc.) lv_is_pvmove - internal pvmove volume
* report: select: refactor: move percent handling code to libdm for reusePeter Rajnoha2014-06-171-2/+2
|
* cleanup: move the "daemon is running" checks to lvm-wrappersPeter Rajnoha2014-06-061-1/+1
| | | | | | | And use ifdefs there, not exposing it in the tool code itself. Later in the future, we should probably make the PIDFILE and daemon checking code available also in case the daemon itself is not built.
* cleanup: modules_needed only for devmapperZdenek Kabelac2014-04-301-4/+4
| | | | | | Drop compilation of modules_needed and add_target_lin function when compiled without devmapper support. Cleanup surrounding ifdefs.
* cleanup: reduce inclusion of unnecessary headersZdenek Kabelac2014-04-181-1/+0
| | | | | Remove those file which are not needed by .c files or already include because the headers already needs them.
* lvm: change build_dm_uuid APIZdenek Kabelac2014-03-121-2/+2
| | | | | Pass directly 'lv' into this build routine, so we can eventually add more private UUID suffixes.
* mirror: move declaration to defineZdenek Kabelac2014-02-251-2/+2
| | | | | For compilation without cmirrord hide unused vars. (in-release update)
* mirror: detect attrs just onceZdenek Kabelac2014-02-241-26/+21
| | | | | | | | Reorder detection of cmirrord. Now if cmirrord is not running, target will not try to load kernel log module, for communication with cmirrord. Whole check for attrs now also happens just once.
* config: add profile arg to find_config_tree_strPeter Rajnoha2013-07-021-1/+1
|
* config: refer to config nodes using assigned IDsPeter Rajnoha2013-03-061-2/+1
| | | | | | | | | | | | | | | For example, the old call and reference: find_config_tree_str(cmd, "devices/dir", DEFAULT_DEV_DIR) ...now becomes: find_config_tree_str(cmd, devices_dir_CFG) So we're referring to the named configuration ID instead of passing the configuration path and the default value is taken from central config definition in config_settings.h automatically.
* clean-up: Rename lvm.conf setting 'mirror_region_size' to 'raid_region_size'Jonathan Brassow2013-02-201-4/+1
| | | | | | | | | We have been using 'mirror_region_size' in lvm.conf as the default region size for RAID logical volumes as well as mirror logical volumes. Since, "raid" is more inclusive and representative than "mirror", I have changed the name of this setting. We must still check for the old setting and warn the user if we are overriding it with the new setting if both happen to be present.
* logging: classify log_debug messagesAlasdair G Kergon2013-01-071-4/+4
| | | | Place most log_debug() messages into a class.
* 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.
* Use same signed numbersZdenek Kabelac2012-02-231-9/+10
| | | | | | | Keep unsigned aritmetic. TODO: we should probably switch dm_split_words() to return unsigned numbers. (minor API libdm change mostly compatible)
* Drop backtrace after log_errorZdenek Kabelac2012-02-231-5/+5
| | | | | Just a minor change to not give backtrace when log_error has been just reported.
* Add check for failureZdenek Kabelac2012-02-131-2/+3
|
* Add boundary test for number of mirror devs and logsZdenek Kabelac2012-02-081-3/+3
| | | | | | | As atoi may return negative value - test for both limits. Test log_args for limits before calling alloca(). Code from dmeventd mirror plugin should probably share same code as we have in mirrored.c.