summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* lvconvert: rework routing of operationsdev-dct-lvconvert-7David Teigland2016-06-293-10/+799
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new logic to identify each unique operation and route it to the correct function to perform it. The functions that perform the conversions remain unchanged. This new code checks every allowed combination of LV type and requested operation, and for each valid combination calls the function that performs that conversion. The first stage of option validation which checks for incompatible combinations of command line options, is done done before process_each is called. This is unchanged. (This new code will allow that first stage validation to be simplified in a future commit.) The second stage of checking options against the specific LV type is done by this new code. For each valid combination of operation + LV type, the new code calls an existing function that implements it. With this in place, the ad hoc checks for valid combinations of LV types and operations can be removed from the existing code in a future commit. (The #if 0 is used to keep the patch clean, and the disabled code will be removed by a following patch.)
* libdm: do not issue 'Failed to create directory' message for failure in ↵Peter Rajnoha2016-06-291-4/+2
| | | | | | | | dm_create_dir There are detailed messages inside _create_dir_recursive that dm_create_dir calls (except EROFS which where the message is not generated, like anywhere else in the code).
* lvconvert: Conversions between striped and raid0.Alasdair G Kergon2016-06-288-57/+593
|
* lvmdbustest: Comment out refresh check for LV createTony Asleson2016-06-281-1/+5
| | | | | | | When we test Vg.LvCreateRaid some of the hidden LVs volume type go from 'I' to 'i' between the time it takes us to create the LV and the time it takes to call into refresh to verify the service is up to date. This is a fairly rare occurance.
* lvmdbusd: Add --nojson command line optionTony Asleson2016-06-281-1/+5
| | | | Add ability to not use the JSON output even if available.
* lvmdbusd: Remove WARNING for 'lvm help'Tony Asleson2016-06-281-1/+1
| | | | | | | We call 'lvm help' to find out if fullreport is supported. Lvm dumps help to stderr. Common code prints a warning if we exit with 0, but have something in stderr so we are skipping the warning message.
* lvmdbusd: Remove unneeded commentTony Asleson2016-06-281-2/+0
|
* lvmdbusd: Clean up wsTony Asleson2016-06-283-3/+2
|
* lvmdbusd: Remove unused imports and function parameterTony Asleson2016-06-281-4/+2
|
* lvmdbusd: Fix hang when lvm compiled with 'enable-notify-dbus'Tony Asleson2016-06-285-75/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The following operations would hang if lvm was compiled with 'enable-notify-dbus' and the client specified -1 for the timeout: * LV snapshot merge * VG move * LV move This was caused because the implementation of these three dbus methods is different. Most of the dbus method calls are executed by gathering information needed to fulfill it, placing that information on a thread safe queue and returning. The results later to be returned to the client with callbacks. With this approach we can process an arbitrary number of commands without any of them blocking other dbus commands. However, the 3 dbus methods listed above did not utilize this functionality because they were implemented with a separate thread that handles the fork & exec of lvm. This is done because these operations can be very slow to complete. However, because of this the lvm command that we were waiting on is trying to call back into the dbus service to notify it that something changed. Because the code was blocking the process that handles the incoming dbus activity the lvm command blocked. We were stuck until the client timed-out the connection, which then causes the service to unblock and continue. If the client did not have a timeout, we would have been hung indefinitely. The fix is to always utilize the worker queue on all dbus methods. We need to ensure that lvm is tested with 'enable-notify-dbus' enabled and disabled.
* lvmdbusd: request.py, initialize _job to NoneTony Asleson2016-06-281-1/+1
| | | | _job is a job object, not a boolean so initialize it to None instead.
* lvmdbusd: Correct pv_seg_start -> pvseg_startTony Asleson2016-06-282-8/+7
| | | | | Code was using the incorrect column names for pvseg_start which only became apparent when utilizing the JSON.
* lvmdbusd: Correct command line args for JSONTony Asleson2016-06-281-5/+5
| | | | Use the updated syntax.
* lvmdbusd: Remove sorting in db layerTony Asleson2016-06-281-7/+1
| | | | | When using the JSON this does not yield a totally sorted list as we don't have a complete set of LVs, so remove this sort.
* lvmdbusd: Add hidden in for json tooTony Asleson2016-06-281-0/+1
|
* lvmdbusd: Initial support for json outputTony Asleson2016-06-282-20/+209
|
* raid: Infrastructure for raid takeover.Alasdair G Kergon2016-06-286-26/+596
|
* lvmetad: two phase vg_removeDavid Teigland2016-06-283-8/+42
| | | | | | | | | | | Apply the same idea as vg_update. Before doing the VG remove on disk, invalidate the VG in lvmetad. After the VG is removed, remove the VG in lvmetad. If the command fails after removing the VG on disk, but before removing the VG metadata from lvmetad, then a subsequent command will see the INVALID flag and not use the stale metadata from lvmetad.
* lvmetad: two phase vg_updateDavid Teigland2016-06-2826-71/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a command sent lvmetad new VG metadata in vg_commit(). In vg_commit(), devices are suspended, so any memory allocation done by the command while sending to lvmetad, or by lvmetad while updating its cache could deadlock if memory reclaim was triggered. Now lvmetad is updated in unlock_vg(), after devices are resumed. The new method for updating VG metadata in lvmetad is in two phases: 1. In vg_write(), before devices are suspended, the command sends lvmetad a short message ("set_vg_info") telling it what the new VG seqno will be. lvmetad sees that the seqno is newer than the seqno of its cached VG, so it sets the INVALID flag for the cached VG. If sending the message to lvmetad fails, the command fails before the metadata is committed and the change is not made. If sending the message succeeds, vg_commit() is called. 2. In unlock_vg(), after devices are resumed, the command sends lvmetad the standard vg_update message with the new metadata. lvmetad sees that the seqno in the new metadata matches the seqno it saved from set_vg_info, and knows it has the latest copy, so it clears the INVALID flag for the cached VG. If a command fails between 1 and 2 (after committing the VG on disk, but before sending lvmetad the new metadata), the cached VG retains the INVALID flag in lvmetad. A subsequent command will read the cached VG from lvmetad, see the INVALID flag, ignore the cached copy, read the VG from disk instead, update the lvmetad copy with the latest copy from disk, (this clears the INVALID flag in lvmetad), and use the correct VG metadata for the command. (This INVALID mechanism already existed for use by lvmlockd.)
* lvmetad: remove unused code for other format typesDavid Teigland2016-06-281-7/+0
| | | | | lvmetad is no longer used at all with the lvm1 format, so the text format is the only one that uses lvmetad.
* WHATS_NEW: add recent changesDavid Teigland2016-06-281-0/+6
|
* lvmlockd: fix coverity reportDavid Teigland2016-06-281-0/+1
|
* libdm: report: fix field width calculation when using dm_report_column_headingsPeter Rajnoha2016-06-281-24/+41
| | | | | | | | | | | | | This fixes commit 0ba5f4b8e977a6f2f45f95777da508b42d84c01a which moved field recalculation (field width and sort position) from dm_report_object to dm_report_output but it didn't handle the case when dm_report_column_headings was used separately to report headings (before dm_report_outpout call) and hence we ended up with intial widths for fields in the headings. If we're using dm_report_column_headings, we need to recalculate fields if we haven't done so yet, the same way as we do in dm_report_output.
* reporter: simplify --configreport handling for -S|--select and fix an issue ↵Peter Rajnoha2016-06-283-35/+29
| | | | | | | | | | | | reported by coverity Simplify code around _do_get_report_selection - remove "expected_idxs[]" argument which is superfluous and add "allow_single" switch instead to allow for recognition of "--configreport <report_name> -S" as well as single "-S" if needed. Null pointer dereferences (FORWARD_NULL) /safe/guest2/covscan/LVM2.2.02.158/tools/reporter.c: 961 in _do_report_get_selection() Null pointer dereferences (FORWARD_NULL) Dereferencing null pointer "single_args".
* coverity: fix issues detected in recent codePeter Rajnoha2016-06-284-5/+5
| | | | | | | | | | | | | | Uninitialized variables (UNINIT) /safe/guest2/covscan/LVM2.2.02.158/tools/toollib.c: 3520 in _process_pvs_in_vgs() Uninitialized variables (UNINIT) Using uninitialized value "do_report_ret_code". Null pointer dereferences (REVERSE_INULL) /safe/guest2/covscan/LVM2.2.02.158/libdm/libdm-report.c: 4745 in dm_report_output() Null pointer dereferences (REVERSE_INULL) Null-checking "rh" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Incorrect expression (MISSING_COMMA) /safe/guest2/covscan/LVM2.2.02.158/lib/log/log.c: 280 in _get_log_level_name() Incorrect expression (MISSING_COMMA) In the initialization of "log_level_names", a suspicious concatenated string ""noticeinfo"" is produced. Null pointer dereferences (FORWARD_NULL) /safe/guest2/covscan/LVM2.2.02.158/tools/reporter.c: 816 in_get_report_options() Null pointer dereferences (FORWARD_NULL) Comparing "mem" to null implies that "mem" might be null.
* post-releaseAlasdair G Kergon2016-06-254-2/+8
|
* pre-releasev2_02_158Alasdair G Kergon2016-06-254-4/+7
|
* doc: Resync kernel docs.Alasdair G Kergon2016-06-258-52/+205
|
* man: lvs: move doc about --all so it's ordered alphabetically in the man pagePeter Rajnoha2016-06-241-10/+10
|
* man: document --configreport, --logonly, --reportformatPeter Rajnoha2016-06-2434-36/+182
|
* commands: help: add missing --reportformat referencesPeter Rajnoha2016-06-241-2/+5
|
* commands: fix typo in arg assignmentPeter Rajnoha2016-06-241-1/+1
|
* cleanup: clean warns from older gccZdenek Kabelac2016-06-241-2/+2
| | | | Don't report uninitialized use by older gcc.
* tests: update test for modified outputZdenek Kabelac2016-06-241-6/+6
| | | | We now print vg/lv for lv resized volume
* tests: smaller number of devs created to fill metadataZdenek Kabelac2016-06-241-1/+1
|
* cleanup: type cleanupZdenek Kabelac2016-06-241-1/+1
| | | | | Fix return code 1. Since we always check for !() - this fix has no other effect.
* lvresize: let pass even protected names like _tmetaZdenek Kabelac2016-06-241-1/+1
| | | | | Only later validation can decide if the volume is actually restricted from being resized (unlike in lvcreate time).
* lvresize: fixes for recent commitZdenek Kabelac2016-06-242-7/+6
| | | | Merging process and patch rework missed some bits - fix them.
* Revert "locking: trace errors from dir creation"Alasdair G Kergon2016-06-232-6/+3
| | | | | | | | | This reverts commit fa69ed0bc845df3d2c7ae68d03cdd4a3dec339d8. This code sometimes expects to be presented with a read-only filesystem (during some boot sequences for example) and copes appropriately with this and it should not lead to expected error messages that might cause unnecessary alarm.
* tests: aux prepare_thin_metadataZdenek Kabelac2016-06-233-36/+25
|
* cleanup: drop setting lv_nameZdenek Kabelac2016-06-232-2/+0
| | | | | | | lv_name arg is only used without known LV for resolving '*lv'. Once we know *lv, never use lv_name ever again. So setting it when passing *lv has not needed.
* cleanup: remove unused codeZdenek Kabelac2016-06-232-84/+0
|
* cleanup: remove unused sizearg variableZdenek Kabelac2016-06-235-5/+0
| | | | It's not used for anything now.
* lvresize: return 0/1Zdenek Kabelac2016-06-231-23/+11
| | | | Returning locking LV is no longer used from here, so return 1/0.
* lvresize: support more resized LVsZdenek Kabelac2016-06-232-102/+120
| | | | | | | | | | | | Add code to support more LVs to be resized through a same code path using a single lvresize_params struct. (Now it's used for thin-pool metadata resize, next user will be snapshot virtual resize). Update code to adjust percent amount resize for use_policies. Properly activate inactive thin-pool in case of any pool resize as the command should not 'deffer' this operation to next activation.
* lvresize: do not pass struct cmdZdenek Kabelac2016-06-235-31/+31
| | | | | | | | Use common API design and pass just LV pointer to lv_manip.c functions. Read cmd struct via lv->vg->cmd when needed. Also do not try to return EINVALID_CMD_LINE error when we have already openned VG - this error code can only be returned before locking VG.
* lvresize: pass only needed params to _fsadm_cmdZdenek Kabelac2016-06-231-12/+14
| | | | | Do not pass whole lvresize_params into _fsadm_cmd, and give it only needed args.
* lvresize: check pvh list is vg->pvsZdenek Kabelac2016-06-231-2/+2
| | | | | Instead of checking lp->argc for arg count, compare directly whether passed pvh is vg->pvs.
* lvresize: update lvresize_params structZdenek Kabelac2016-06-235-156/+126
| | | | | Reorganise struct lvresize_params to better fit lvresize needs to be able to resize more then just a single LV.
* cleanup: use display_lvnameZdenek Kabelac2016-06-233-42/+51
|