1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

12764 Commits

Author SHA1 Message Date
Peter Rajnoha
f0768f636e coverity: fix issues detected in recent code
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.
2016-06-28 02:26:54 +01:00
Alasdair G Kergon
a46f524247 post-release 2016-06-25 20:47:49 +01:00
Alasdair G Kergon
887f071b25 pre-release 2016-06-25 20:35:14 +01:00
Alasdair G Kergon
15b932a70e doc: Resync kernel docs. 2016-06-25 19:59:49 +01:00
Peter Rajnoha
d914151591 man: lvs: move doc about --all so it's ordered alphabetically in the man page 2016-06-24 14:57:09 +02:00
Peter Rajnoha
a910052a2e man: document --configreport, --logonly, --reportformat 2016-06-24 14:51:20 +02:00
Peter Rajnoha
9a414245b9 commands: help: add missing --reportformat references 2016-06-24 14:49:13 +02:00
Peter Rajnoha
14da3cc793 commands: fix typo in arg assignment 2016-06-24 11:10:10 +02:00
Zdenek Kabelac
e88e9ee9ed cleanup: clean warns from older gcc
Don't report uninitialized use by older gcc.
2016-06-24 01:10:04 +02:00
Zdenek Kabelac
5070e7fcf7 tests: update test for modified output
We now print  vg/lv  for lv resized volume
2016-06-24 00:39:15 +02:00
Zdenek Kabelac
fc174f6b74 tests: smaller number of devs created to fill metadata 2016-06-24 00:39:14 +02:00
Zdenek Kabelac
1c212371fa cleanup: type cleanup
Fix return code 1.
Since we always check for !() - this fix has no other effect.
2016-06-24 00:39:14 +02:00
Zdenek Kabelac
7c921f18e2 lvresize: let pass even protected names like _tmeta
Only later validation can decide if the volume is actually restricted
from being resized  (unlike in lvcreate time).
2016-06-24 00:39:14 +02:00
Zdenek Kabelac
1bb7a155d1 lvresize: fixes for recent commit
Merging process and patch rework missed some bits - fix them.
2016-06-24 00:39:14 +02:00
Alasdair G Kergon
e99a31c950 Revert "locking: trace errors from dir creation"
This reverts commit fa69ed0bc8.

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.
2016-06-23 21:31:49 +01:00
Zdenek Kabelac
a67a5d4655 tests: aux prepare_thin_metadata 2016-06-23 14:59:29 +02:00
Zdenek Kabelac
83d483269d cleanup: drop setting lv_name
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.
2016-06-23 14:59:29 +02:00
Zdenek Kabelac
e5b7ebcdda cleanup: remove unused code 2016-06-23 14:59:29 +02:00
Zdenek Kabelac
5a919e4805 cleanup: remove unused sizearg variable
It's not used for anything now.
2016-06-23 14:59:29 +02:00
Zdenek Kabelac
4de15aa58d lvresize: return 0/1
Returning locking LV is no longer used from here, so return 1/0.
2016-06-23 14:59:29 +02:00
Zdenek Kabelac
7092c6ba10 lvresize: support more resized LVs
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.
2016-06-23 14:59:27 +02:00
Zdenek Kabelac
d44e653fe1 lvresize: do not pass struct cmd
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.
2016-06-23 14:57:09 +02:00
Zdenek Kabelac
5013999c8b lvresize: pass only needed params to _fsadm_cmd
Do not pass whole lvresize_params into _fsadm_cmd,
and give it only needed args.
2016-06-23 14:57:09 +02:00
Zdenek Kabelac
d30c2cec88 lvresize: check pvh list is vg->pvs
Instead of checking lp->argc for arg count, compare directly whether
passed pvh is vg->pvs.
2016-06-23 14:57:09 +02:00
Zdenek Kabelac
f45b689406 lvresize: update lvresize_params struct
Reorganise  struct lvresize_params to better fit lvresize needs to be
able to resize more then just a single LV.
2016-06-23 14:57:09 +02:00
Zdenek Kabelac
698082e678 cleanup: use display_lvname 2016-06-23 14:57:08 +02:00
Zdenek Kabelac
6268d0a080 cleanup: add dots to some messages
Add missing dots and one comment.
2016-06-23 14:57:08 +02:00
Zdenek Kabelac
0a525832f9 cleanup: code lines reodered 2016-06-23 14:57:08 +02:00
Zdenek Kabelac
3a4107c982 lvresize: drop extra sigint handling
yes_no_prompt() now already handles signal checking,
so drop redundant test.
2016-06-23 14:57:08 +02:00
Zdenek Kabelac
d578d8d3a1 lvresize: inform about ignored args with --use-polices
When --use-polices is specified, all size args are meaningless,
as the resize is based upon policy. So just keep user informed.
2016-06-23 14:57:08 +02:00
Zdenek Kabelac
58d414f7f5 lvresize: move and extend resizefs ignoring check
Move check for 'ignoring' --resizefs option and extend check
for some more types.
2016-06-23 14:57:08 +02:00
Zdenek Kabelac
fa69ed0bc8 locking: trace errors from dir creation 2016-06-23 14:57:06 +02:00
Zdenek Kabelac
dc8c5c1886 monitoring: preserve monitoring status during update
Ignore monitoring during whole update (suspend/resume) of thin-pool.
2016-06-23 14:56:10 +02:00
Zdenek Kabelac
eb51be4fbe activation: _lv_active returns 0 on error
We have only 2 users of _lv_active() - one was already checking for ==1
while the other use (_lv_is_active()) could have take '-1' as a sign of having
an LV active. So return 0 and log_debug also the reason while detection
has failed (i.e. in case  --driverload n  - it's kind of expectable,
but might have confused user seeing just <backtrace>).
2016-06-23 14:55:35 +02:00
Zdenek Kabelac
af36f5ad36 activation: switch to warning
Since this function does not have a way to return error use correct
reporting level as warning.
2016-06-23 14:53:59 +02:00
Peter Rajnoha
751163a743 libdm: log: remove log_print_bypass_report calls and register new print_log_libdm for libdm during lvm initialization instead
This fixes commit f50d4011cd which
introduced a problem when using older lvm2 code with newer libdm.
In this case, the old LVM didn't recognize new _LOG_BYPASS_REPORT flag
that libdm-report code used. This ended up with no output at all
from libdm where log_print_bypass_report was called because the
_LOG_BYPASS_REPORT was not masked properly in lvm2's print_log fn
which was called as callback function for logging.

With this patch, the lvm2 registers separate print_log_libdm logging
function for libdm instead. The print_log_libdm is exactly the same
as print_log (used throughout lvm2 code) but it checks whether we're
printing common line on output where "common" means not going to stderr,
not a warning and not an error and if we are, it adds the
_LOG_BYPASS_REPORT flag so the log_print goes directly to output, not
to any log report.

So this achieves the same goal as in f50d4011cd,
just doing it in a way that newer libdm is still compatible with older
lvm2 code (libdm-report is the only code using log_print).

Looking at the opposite mixture - older libdm with newer lvm2 code,
that won't be compilable because the new log report functionality
that is in lvm2 also requires new dm_report_group_* libdm functions
so we don't need to care here.
2016-06-23 14:45:52 +02:00
Peter Rajnoha
6eeb66e51d log: move original print_log code to _vprint_log and make print_log a wrapper over _vprint_log
Move code from original print_log fn to a separate _vprint_log function
that accepts va_list and make print_log a wrapper over _vprint_log.
The print_log just initializes the va_list and uses it for _vprint_log
call now. This way, we can reuse _vprint_log if needed.
2016-06-23 14:45:52 +02:00
Peter Rajnoha
79eaaee50a filters: add comments about internal filter position in filter chain 2016-06-23 09:37:51 +02:00
Alasdair G Kergon
6513a7a449 lvconvert: Fix --stripes handling.
Only treat --stripes as meaning --type striped if no other type was
first detected.  If a segtype got selected, don't override it later.
2016-06-22 22:10:42 +01:00
David Teigland
ebd2758dab vgimportclone: add native command
This is cleaner and more efficient than the script.
The args and usage are unchanged.
2016-06-22 13:13:10 -05:00
Alasdair G Kergon
dfc516f9bf lvconvert: Refactor argument handling code.
Begin disentangling the different lvconvert modes of operation
from each other.
2016-06-22 18:40:22 +01:00
Alasdair G Kergon
7e671e5dd0 tools: Use arg_is_set instead of arg_count. 2016-06-21 22:24:52 +01:00
David Teigland
6c269e639a vgcfgrestore: rescan to reenable lvmetad on error path
In commit 6ae22125, vgcfgrestore began disabling lvmetad
while running, and rescanned to enable it again at the end,
but missed the rescanning/enabling in the error case.
2016-06-21 11:40:42 -05:00
David Teigland
f96de67490 vgcfgrestore: check for missing device
The missing device will generally be seen earlier
and cause the command to not reach this point, but
check anyway for completeness.
2016-06-20 16:02:07 -05:00
David Teigland
47a29f6b2e lvmlockd: always try to connect to lvmetad
Reconnect to lvmetad if either the send fails (e.g. lvmetad
was restarted since lvmlockd last connected), or if no
lvmetad connection exists (e.g. lvmetad was started after
lvmlockd so no previous connection existed.)
2016-06-20 14:01:46 -05:00
David Teigland
b12961e7eb lvmetad: process new connections after shutdown signal
Currently, a shutdown signal will cause lvmetad to quit
responding to new connections, but not actually exit until
all connections are gone.  If a program is maintaining a
long running connection (e.g. lvmlockd, or even an lvm
command) when lvmetad gets a shutdown signal, then all
further commands will hang indefinately waiting for a
response that won't be sent.

With this patch, make lvmetad continue handling new
connections even after a shutdown signal.  It will exit
once all connections are gone.
2016-06-20 13:19:02 -05:00
David Teigland
6ae22125c6 vgcfgrestore: use lvmetad disabled state
Previously, vgcfgrestore would attempt to vg_remove the
existing VG from lvmetad and then vg_update to add the
restored VG.  But, if there was a failure in the command
or with vg_update, the lvmetad cache would be left incorrect.
Now, disable lvmetad before the restore begins, and then
rescan to populate lvmetad from disk after restore has
written the new VG to disk.
2016-06-20 11:19:49 -05:00
David Teigland
cae6591b9d vgscan: fix process_each args
zero/null args were mixed up.
2016-06-20 11:18:36 -05:00
Peter Rajnoha
d1d3820219 conf: add more comments for new settings related to output format and log report 2016-06-20 16:21:38 +02:00
Peter Rajnoha
99ea03571a cleanup: log: use hex numbers instead of decimal for _LOG_* 2016-06-20 14:22:31 +02:00