summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvmetad: scan devices when duplicate PVs are presentdev-dct-lvmetad-16David Teigland2015-11-171-17/+5
| | | | | | | lvmetad cannot properly manage duplicate PVs, so when they are present, commands revert to scanning devices. When the scanning finds that no duplicate PVs are present, commands go back to use lvmetad.
* Warn about duplicate PVs when using lvmetadDavid Teigland2015-11-136-1/+237
| | | | | | | | A flag is set in lvmetad when duplicate PVs have been found. Commands check this flag and print a warning about duplicate PVs if it's set. When devices are scanned, the flag is set or cleared in lvmetad.
* Strictly ignore duplicate PVsDavid Teigland2015-11-135-547/+33
| | | | | | | | | | | | | | | | In commands and lvmetad, if a pvid already exists on one device, and a second device appears with the same pvid, then ignore the second device. Previously, commands and lvmetad attempted to juggle both devices for the same PV. Commands using lvmetad will no longer see persistent warnings about duplicates because they won't be seen. In 'pvs -a' or 'pvs dev', an ignored duplicate device now looks like a non-PV, and the chosen device in a duplicate pair looks like the only device for the PV.
* lvmetad: preemptively check and rescan in commandsDavid Teigland2015-11-137-11/+265
| | | | | | | | | | | | | | | | | | Move checking the lvmetad state, and the possible rescan, out of lvmetad_send() to the start of the command. Previously, the token mismatch and rescan would occur within lvmetad_send() for some other request. Now, the token mismatch is detected earlier, so the rescan can be done before the main command is in progress. Rescanning deep within the processing of another command will disturb the lvmcache state of that other command. A rescan already exists at the start of the command for the case where foreign VGs are going to be read. This same rescan is now also performed when there is an lvmetad token mismatch (from a changed global_filter).
* lvmetad: handle duplicate VG namesDavid Teigland2015-11-134-13/+230
| | | | | | | | | | | | | | | | | | | | | New hash table functions are added that allow for multiple entries with the same key. Use of the vgname_to_vgid hash table is converted to these new functions since there are multiple entries in vgname_to_vgid that have the same key (vgname). When multiple VGs with the same name exist, commands that reference only a VG name will fail saying the VG could not be found (that error message could be improved.) Any command that works with the select option can access one of the VGs with -S vg_uuid=X. vgrename is a special case that allows the first VG name arg to be replaced by a uuid, which also works. (The existing hash table implementation is not well suited for handling this case, but it works ok with the new extensions. Changing lvmetad to use its own custom hash tables may be preferable at some point.)
* pvmove: Remove unused find_pvmove_lv_from_pvname.Alasdair G Kergon2015-11-132-23/+0
|
* coverity: add few internal errorsZdenek Kabelac2015-11-131-3/+12
| | | | | Mark impossible paths with internal errors. Also replace 'strcmp() with more readable seg_is...()
* coverity: model some functionZdenek Kabelac2015-11-131-0/+94
| | | | | Reduce number of false-positives and model functions in a way Coverity is able to understand it.
* coverity: hintZdenek Kabelac2015-11-131-8/+8
| | | | | | | | | | Here Coverity cannot see the pointer cannot be NULL in this code path - opened coverity case #00531860. We could make a model to avoid seeing related reports, but then we loose coverage for modeled function. So decided to add minor hint for this case.
* tests: without delay_dev skip some checksZdenek Kabelac2015-11-131-2/+2
| | | | When delay_dev is missing these tests are just racy.
* cleanup: better error messageZdenek Kabelac2015-11-131-5/+7
| | | | Use display_lvname.
* cleanup: check LVs in one statementZdenek Kabelac2015-11-131-8/+10
| | | | | Use a single statement to check all LVs we want to deref via get_only_segment_using_this_lv().
* cleanup: missing check for PV2Zdenek Kabelac2015-11-131-1/+1
| | | | Patch missed also check this pointer dereference.
* cleanup: drop unneded check for memZdenek Kabelac2015-11-131-2/+2
| | | | Revert missed to drop this extra check.
* debug: put stack on error pathZdenek Kabelac2015-11-131-1/+2
| | | | | At least check result and trace it. However we may need better error reaction in this case.
* raid: ensure area_count is at least 2Zdenek Kabelac2015-11-131-2/+7
| | | | Enusure we will not divide by 0.
* libdm: put in secure checkZdenek Kabelac2015-11-131-0/+4
| | | | | Coverity complains about NULL deref - while this cannot currently happen, put in secure INTERNAL_ERROR.
* reporter: add missing stack traceZdenek Kabelac2015-11-131-7/+6
| | | | Use goto_out on error paths.
* lvmetad: tail chasing to shut up coverityDavid Teigland2015-11-121-3/+9
|
* dmeventd: fix check for failing open.Zdenek Kabelac2015-11-111-1/+1
| | | | | | | Recent change 2c8d6f5c90d5be62b48ba2881f2a6631091dc5af actually droped restart when the reason of failing open is missing device completely - check for ENOENT now as another reason to start new dmeventd server (when there is no systemd to maintain it).
* str_list: do not support str lists without mempoolsPeter Rajnoha2015-11-113-40/+17
| | | | | Do not support str lists without mempools. Instead, create temporary mempool where necessary (currently only _get_report_options fn).
* configure: check for udev_device_get_is_initialized is availablePeter Rajnoha2015-11-115-1/+54
| | | | | | The udev_device_get_is_initialized is available since libudev version 165. Older versions are still used somewhere (e.g. RHEL6). So better check for this fn and use it only if it's available.
* dev-ext: issue error if external_device_info_source=udev and udev db record ↵Peter Rajnoha2015-11-112-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | incomplete Udev db records are marked as not initialized (incomplete) on timeout. Issue an error message whenever LVM finds such records so users are aware that something's going wrong with udev db. This is important in case we use devices/external_device_info_source="udev" where udev database records are used to do various filtering decisions. For example: udev log of timed out worker: Nov 11 13:02:25 raw.virt systemd-udevd[607]: seq 1997 '/devices/virtual/block/dm-2' is taking a long time Nov 11 13:04:25 raw.virt systemd-udevd[607]: seq 1997 '/devices/virtual/block/dm-2' killed Nov 11 13:04:25 raw.virt systemd-udevd[607]: worker [11221] terminated by signal 9 (Killed) Nov 11 13:04:25 raw.virt systemd-udevd[607]: worker [11221] failed while handling '/devices/virtual/block/dm-2' ... LVM also issues error message visibly if incomplete udev db record is found, devices/external_device_info_source="udev" is set: $ pvs Udev database has incomplete information about device /dev/dm-2. Failed to get external handle for device /dev/dm-2 [udev]. ...
* libdm: reorder error pathZdenek Kabelac2015-11-101-5/+4
| | | | | Coverity noticed recent fix of an error path missed to release 'dmt' - reoder code to ensure 'dmt' is released.
* raid: fix the string compareZdenek Kabelac2015-11-101-8/+8
| | | | | | | | Coverity noticed this condition is always false and the error path could never be visited. So check for all mismatches of supported messages and actually mark log_error as internal error.
* coverity: Add placeholder modelling file.Alasdair G Kergon2015-11-101-0/+14
|
* libdm: replace assign with incrementZdenek Kabelac2015-11-091-3/+2
| | | | | Coverity didn't liked assign with && expression, so use trick. It does not complain against this prefix incremenent operation.
* vgrename: check if new and old names matchDavid Teigland2015-11-091-0/+6
| | | | | | | | When the first arg is a UUID and vgrename translates that UUID to a current VG name, the old and new VG names are not being checked for equality. If they are equal, it produces an internal error rather than a proper error.
* lvmetad: change recent cleanupsDavid Teigland2015-11-091-6/+14
| | | | with better alternatives.
* lvmlockd: reverse some unnecessary checkingDavid Teigland2015-11-091-7/+4
| | | | These are unnecessary or not useful.
* tests: handle missing delay_devZdenek Kabelac2015-11-095-0/+11
| | | | Try to run as much of test which could run without delay_dev.
* lvmlockd: fix the NO_GL_LS conditionDavid Teigland2015-11-091-3/+8
| | | | indicating when no global lockspace exists.
* cleanup: ensuring string is not NULLZdenek Kabelac2015-11-091-2/+2
| | | | Coverity cannot see the string cannot be NULL so make it explicit.
* cache: ensure there is no NULL strZdenek Kabelac2015-11-091-1/+4
| | | | Coverity is not smart enough to detect this case could never happen.
* lvmlockd: enforce 64bit arithmeticZdenek Kabelac2015-11-091-3/+3
| | | | | Coverity suggest to stay on the 'safe' side and widen operators early so 64bit offset is made from 64bit arithmentic.
* lvmlockd: add missing error checksZdenek Kabelac2015-11-091-4/+10
| | | | Detect error from function and report them.
* cleanup: use _ for local functionZdenek Kabelac2015-11-091-12/+12
|
* cleanup: drop unneded headersZdenek Kabelac2015-11-094-8/+0
| | | | Coverity notices they are not really needed.
* dmsetup: one missed dmsZdenek Kabelac2015-11-091-1/+2
|
* libdaemon: fix passing 32bit values for %dZdenek Kabelac2015-11-098-53/+54
| | | | | | Since %d is now prohibited for its great confusion, replace it with FMTd64 and correctly converted int64_t parameter.
* lvmlockd: shut up warningsDavid Teigland2015-11-091-2/+0
|
* libdaemon: prohibit use of %d for 64bit numbresZdenek Kabelac2015-11-091-1/+6
| | | | | Do not let pass %d and print internal error when found one. Require all users to use FMTd64 - it's seriously confusing.
* lvmetad: restore use of FMTd64Zdenek Kabelac2015-11-091-5/+5
| | | | daemon_reply_simple() eats just 64bit numbers - so make it explicit.
* tests: update test to check for race betterZdenek Kabelac2015-11-091-8/+16
| | | | | | | | Use delay_dev to slow down mirror sync so we could more easily check for race and proper reject of parallel mirror leg addition/reduction. Also expose fail in mirror allocation of parallel leg.
* tests: do not skip test when delay is missingZdenek Kabelac2015-11-091-1/+1
| | | | | | | | Rather then skipping whole test - just do not use it. Failing tests that have required delay need to deal with reality and shell either check for HAVE_DM_DELAY and skip portion of test or using should when needed.
* cleanup: update commentZdenek Kabelac2015-11-091-1/+1
|
* dmsetup: cleanup warn for older compilersZdenek Kabelac2015-11-091-3/+2
| | | | | | | Older gcc somehow thinks there is a path of using subcommand uninitilized. So make it more obvious there is no such one.
* lvmetad: maintain seqno as intZdenek Kabelac2015-11-091-12/+12
| | | | | Keep seqno as 32bit value. Also use '_' prefix for local _update_metadata.
* raid: mark intententional copy and pasteZdenek Kabelac2015-11-091-0/+1
| | | | | Coverity: add this extra comment, to let Coverity know this slightly changed copy&paste code is intentional.
* cleanup: use code in placeZdenek Kabelac2015-11-091-7/+5
| | | | | Pass const strings to printf(), and use struct names directly instead of creating unused vars on stack.