]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agovgextend: pass single vgname as process_each_vg arg
David Teigland [Mon, 30 Nov 2015 23:00:26 +0000 (17:00 -0600)]
vgextend: pass single vgname as process_each_vg arg

Pass the single vgname as a new process_each_vg arg
instead of setting a cmd flag to tell process_each_vg
to take only the first vgname arg from argv.

Other commands with different argv formats will be
able to use it this way.

8 years agolvmcache: change duplicate VG name warnings to verbose
David Teigland [Mon, 30 Nov 2015 21:28:22 +0000 (15:28 -0600)]
lvmcache: change duplicate VG name warnings to verbose

When two different VGs with the same name exist,
they are both stored in lvmcache using the vginfo->next
list.  Previously, the code would print warnings (sometimes)
when adding VGs to this list.  Now the duplicate VG names
are handled by higher level code, so this list no longer
needs to print warnings about duplicate VG names being found.

8 years agovg_read: look up vgid from name
David Teigland [Mon, 30 Nov 2015 21:12:01 +0000 (15:12 -0600)]
vg_read: look up vgid from name

After recent changes to process_each, vg_read() is usually
given both the vgname and vgid for the intended VG.

However, in some cases vg_read() is given a vgid with
no vgname, or is given a vgname with no vgid.

When given a vgid with no vgname, vg_read() uses lvmcache
to look up the vgname using the vgid.  If the vgname is
not found, vg_read() fails.

When given a vgname with no vgid, vg_read() should also
use lvmcache to look up the vgid using the vgname.
If the vgid is not found, vg_read() fails.

If the lvmcache lookup finds multiple vgids for the
vgname, then the lookup fails, causing vg_read() to fail
because the intended VG is uncertain.

Usually, both vgname and vgid for the intended VG are passed
to vg_read(), which means the lvmcache translations
between vgname and vgid are not done.

8 years agotoollib: remove unused function
David Teigland [Mon, 30 Nov 2015 20:17:33 +0000 (14:17 -0600)]
toollib: remove unused function

8 years agoprocess_each: resolve duplicate VG names
David Teigland [Mon, 30 Nov 2015 18:11:01 +0000 (12:11 -0600)]
process_each: resolve duplicate VG names

If two different VGs with the same name exist on the system,
a command that just specifies that ambiguous name will fail
with a new error:

$ vgs -o name,uuid
  ...
  foo qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf
  foo vfhKCP-mpc7-KLLL-Uh08-4xPG-zLNR-4cnxJX

$ lvs foo
  Multiple VGs found with the same name: foo
  Use the --select option with VG UUID (vg_uuid).

$ vgremove foo
  Multiple VGs found with the same name: foo
  Use the --select option with VG UUID (vg_uuid).

$ lvs -S vg_uuid=qyUS65-vn32-TuKs-a8yF-wfeQ-7DkF-Fds0uf
  lv1 foo ...

This is implemented for process_each_vg/lv, and works
with or without lvmetad.  It does not work for commands
that do not use process_each.

This change includes one exception to the behavior shown
above.  If one of the VGs is foreign, and the other is not,
then the command assumes that the intended VG is the local
one and uses it.

8 years agoprocess_each: always use list of vgnames on system
David Teigland [Mon, 30 Nov 2015 18:51:44 +0000 (12:51 -0600)]
process_each: always use list of vgnames on system

This makes process_each_vg/lv always use the list of
vgnames on the system.  When specific VGs are named on
the command line, the corresponding entries from
vgnameids_on_system are moved to vgnameids_to_process.

Previously, when specific VGs were named on the command
line, the vgnameids_on_system list was not created, and
vgnameids_to_process was created from the arg_vgnames
list (which is only names, without vgids).

Now, vgnameids_on_system is always created, and entries
are moved from that list to vgnameids_to_process -- either
some (when arg_vgnames specifies only some), or all (when
the command is processing all VGs, or needs to look at
all VGs for checking tags/selection).

This change adds one new lvmetad lookup (vg_list) to a
command that specifies VG names.  It adds no new work
for other commands, e.g. non-lvmetad commands, or
commands that look at all VGs.

When using lvmetad, 'lvs foo' previously sent one
request to lvmetad: 'vg_lookup foo'.
Now, 'lvs foo' sends two requests to lvmetad:
'vg_list' and 'vg_lookup foo <uuid>'.

(The lookup can now always include the uuid in the request
because the initial vg_list contains name/vgid pairs.)

8 years agomirror: fix condition
Zdenek Kabelac [Tue, 1 Dec 2015 12:59:20 +0000 (13:59 +0100)]
mirror: fix condition

Recent patch tested wrong condition for error

8 years agocleanup: use dm_get_status_mirror
Zdenek Kabelac [Mon, 30 Nov 2015 20:17:25 +0000 (21:17 +0100)]
cleanup: use dm_get_status_mirror

Use libdm function to parse mirror status report.

8 years agolib: pass mem pool to check_transient_status
Zdenek Kabelac [Mon, 30 Nov 2015 20:24:31 +0000 (21:24 +0100)]
lib: pass mem pool to check_transient_status

check_transient_status() may need to allocate some memory,
so pass in already existing mem pool.

8 years agotests: unit test for mirror status
Zdenek Kabelac [Mon, 30 Nov 2015 19:54:52 +0000 (20:54 +0100)]
tests: unit test for mirror status

8 years agolibdm: introduce dm_get_status_mirror
Zdenek Kabelac [Mon, 30 Nov 2015 20:16:43 +0000 (21:16 +0100)]
libdm: introduce  dm_get_status_mirror

Add missing function to parse mirror status.

8 years agolvconvert: Improve message for raid without -m.
Alasdair G Kergon [Mon, 30 Nov 2015 22:36:05 +0000 (22:36 +0000)]
lvconvert: Improve message for raid without -m.

8 years agolvmcache: new function to check if VG is foreign
David Teigland [Mon, 30 Nov 2015 17:54:56 +0000 (11:54 -0600)]
lvmcache: new function to check if VG is foreign

When not using lvmetad, this uses the system_id field in
the cached vginfo structs that are populated during a scan.

When using lvmetad, this requests the VG from lvmetad, and
checks the system_id field in the returned metadata.

8 years agosystem_id: refactor check for allowed system_id
David Teigland [Mon, 30 Nov 2015 17:46:55 +0000 (11:46 -0600)]
system_id: refactor check for allowed system_id

Refactor the code that checks for an allowable system_id
so that it can be used from other places.

8 years agolvmcache: include system_id in vginfo cache
David Teigland [Mon, 30 Nov 2015 17:32:17 +0000 (11:32 -0600)]
lvmcache: include system_id in vginfo cache

Save system_id just like creation_host and lock_type
strings in vginfo cache.

8 years agolvmetad: include both vgid and vgname in lookup request
David Teigland [Tue, 24 Nov 2015 20:47:53 +0000 (14:47 -0600)]
lvmetad: include both vgid and vgname in lookup request

When the command already knows both the vgid and vgname,
it should send both to lvmetad for a more exact request,
and it can save lvmetad the work of a name lookup.

8 years agopost-release
Alasdair G Kergon [Sat, 28 Nov 2015 01:29:00 +0000 (01:29 +0000)]
post-release

8 years agopre-release v2_02_136
Alasdair G Kergon [Sat, 28 Nov 2015 01:25:53 +0000 (01:25 +0000)]
pre-release

8 years agotests: make unit testing usable again
Zdenek Kabelac [Fri, 27 Nov 2015 09:54:57 +0000 (10:54 +0100)]
tests: make unit testing usable again

Make unit tests usable/compilable with newer header files.
Add 'initial' dmlist_t  for list tests.
More will come...

8 years agocleanup: clean gcc shadow declaration of version warning
Zdenek Kabelac [Thu, 26 Nov 2015 20:52:22 +0000 (21:52 +0100)]
cleanup: clean gcc shadow declaration of version warning

8 years agodebug: show LV name where dlid creation failed
Zdenek Kabelac [Thu, 26 Nov 2015 20:52:05 +0000 (21:52 +0100)]
debug: show LV name where dlid creation failed

8 years agocleanup: using display_lvname
Zdenek Kabelac [Wed, 25 Nov 2015 15:06:31 +0000 (16:06 +0100)]
cleanup: using display_lvname

Use for showing vgname/lvname in messages.
No functional change.

8 years agocleanup: remove unused code
Zdenek Kabelac [Wed, 25 Nov 2015 14:45:19 +0000 (15:45 +0100)]
cleanup: remove unused code

Remove long outstand unused code lines, which were already
been obsoleted by other code.

Statuses and snapshot tree creation is already handled differently.

Also drop some 'extra' log_error() and use only stack;
since error has already been reported.

8 years agocleanup: avoid allocation for vg_name
Zdenek Kabelac [Wed, 25 Nov 2015 15:04:27 +0000 (16:04 +0100)]
cleanup: avoid allocation for vg_name

Since we do not use dev_manager in a way we would have destroyed VG
content while  in-use - we could safely keep just pointer.
So dropping strdup.

Also it seems we actually no longer use vg_name for anything
so it may possibly go away completely unless it would be useful
for debugging...

8 years agolibdm: const raid params and error for unsupported type
Zdenek Kabelac [Thu, 26 Nov 2015 08:18:46 +0000 (09:18 +0100)]
libdm: const raid params and error for unsupported type

Accept const struct with raid params (No API change).
Also add extra error message when raid type is unsupported.

8 years agolvmconfig: add --sinceversion for --type new
Peter Rajnoha [Wed, 25 Nov 2015 13:09:20 +0000 (14:09 +0100)]
lvmconfig: add --sinceversion for --type new

Just for convenience to display all new configuration settings
introduced since given version (before, there was only --atversion
to display settings introduced in concrete version).

For example:
$ lvmconfig --type new --sinceversion 2.2.120
allocation {
# cache_mode="writethrough"
# cache_settings {
# }
}
global {
use_lvmlockd=0
# lvmlockd_lock_retries=3
# sanlock_lv_extend=256
use_lvmpolld=1
}
activation {
}
# report {
# compact_output_cols=""
# time_format="%Y-%m-%d %T %z"
# }
local {
# host_id=0
}

8 years agocleanup: rename lv_ondisk to lv_committed
Zdenek Kabelac [Wed, 25 Nov 2015 10:10:32 +0000 (11:10 +0100)]
cleanup: rename lv_ondisk to lv_committed

Patch has no functional change.

8 years agocleanup: change ondisk committed
Zdenek Kabelac [Wed, 25 Nov 2015 09:52:22 +0000 (10:52 +0100)]
cleanup: change ondisk committed

Patch has no functional change.

8 years agocleanup: rename vg_ondisk to vg_committed
Zdenek Kabelac [Tue, 24 Nov 2015 22:29:18 +0000 (23:29 +0100)]
cleanup: rename vg_ondisk to vg_committed

Unifying terminology.

Since all the metadata in-use are ALWAYS on disk - switch
to terminology  committed and precommitted.

Patch has no functional change inside.

8 years agothin: fix previous update of partial tree building
Zdenek Kabelac [Tue, 24 Nov 2015 22:24:11 +0000 (23:24 +0100)]
thin: fix previous update of partial tree building

We do want to preserve 'active' thin-pool,
so add this 'fake' layer only when activating.

TODO:  think how to use thin-pool without fake LV layer.

8 years agotests: improve teardown
Zdenek Kabelac [Mon, 23 Nov 2015 22:17:54 +0000 (23:17 +0100)]
tests: improve teardown

Do not try to execute vgremove, when test has left suspended devices.

8 years agotests: data correctness after thin-pool resize
Zdenek Kabelac [Fri, 20 Nov 2015 21:28:21 +0000 (22:28 +0100)]
tests: data correctness after thin-pool resize

8 years agocleanup: use display_lvname
Zdenek Kabelac [Sun, 22 Nov 2015 22:03:01 +0000 (23:03 +0100)]
cleanup: use display_lvname

Switch debug msg to use display_lvname.
Link to VG early, so we have access to VG from LV.

8 years agothin: skip detach preload from pools
Zdenek Kabelac [Sun, 22 Nov 2015 22:04:11 +0000 (23:04 +0100)]
thin: skip detach preload from pools

lv preload for detached LVs started to be used also
for various other types which just happens to pass through
weak if() condition.

TODO: find here better solution to rather explicitly check
for types we really need to preload.

8 years agocleanup: move towards using direct LV pointers
Zdenek Kabelac [Sat, 21 Nov 2015 22:31:44 +0000 (23:31 +0100)]
cleanup: move towards using direct LV pointers

We do not won't to 'expose'  internals of VG struct.
ATM we use lists to keep all LVs - we may want to switch
to better struct for quicker 'search'.

Since we do not need 'lists' but always actual LV,
switch find_lv_in_vg_by_lvid() to return LV,
and replaces some use case of  find_lv_in_vg()
with 'better' working find_lv() which already
returns LV.

8 years agothin: work with active thin-pool
Zdenek Kabelac [Mon, 23 Nov 2015 18:53:43 +0000 (19:53 +0100)]
thin: work with active thin-pool

When 'lvextend -L+XX vg/thinpool'  do not leave inactive table
loaded for 'wrapping' LV on top of resized thin-pool
(ATM we use linear  LV for this with same size as thin-pool).

8 years agomemlock: add more libs on ignore list
Zdenek Kabelac [Sat, 21 Nov 2015 23:26:06 +0000 (00:26 +0100)]
memlock: add more libs on ignore list

Udev recently start to 'link-in' major amount of useless libs.
(Seem to be faulty 'systemd' link-in all issue)
Anyway - avoid locking those libs in RAM.

8 years agolibdm: enhance thin-pool preload
Zdenek Kabelac [Mon, 23 Nov 2015 22:15:04 +0000 (23:15 +0100)]
libdm: enhance thin-pool preload

When preloading thin-pool device node for already
existing/running thin-pool do not resume such thin-pool.

This allows to properly schedule commit point for metadata,
when thin-pool data or metadata volume is resized.

8 years agolibdm: drop extra space from cache target line
Zdenek Kabelac [Mon, 23 Nov 2015 22:12:43 +0000 (23:12 +0100)]
libdm: drop extra space from cache target line

Extra space between 'cache' target and metadata device caused
string comparation being not equal and thus always causing
table reload even when uneeded.

8 years agoman lvmcache: include chunk size
David Teigland [Mon, 23 Nov 2015 17:57:41 +0000 (11:57 -0600)]
man lvmcache: include chunk size

8 years agopost-release
Alasdair G Kergon [Mon, 23 Nov 2015 03:40:34 +0000 (03:40 +0000)]
post-release

8 years agopre-release v2_02_135
Alasdair G Kergon [Mon, 23 Nov 2015 03:33:43 +0000 (03:33 +0000)]
pre-release

8 years agotests: more cache conversion checks
Zdenek Kabelac [Thu, 19 Nov 2015 13:31:58 +0000 (14:31 +0100)]
tests: more cache conversion checks

8 years agocache: lvconvert repairs only thin pools
Zdenek Kabelac [Thu, 19 Nov 2015 12:32:03 +0000 (13:32 +0100)]
cache: lvconvert repairs only thin pools

Avoid internal error message where thin pool repair code tries to
fix cache pool - was catched later in code stack, so rather
catch this early and make the repair function exlusive
to thin pools.

So far we have no code for repairing cache pools
(other then the automatic during activation/deactivation).

8 years agocache: enable raid conversion for _cdata and _cmeta
Zdenek Kabelac [Thu, 19 Nov 2015 12:30:55 +0000 (13:30 +0100)]
cache: enable raid conversion for _cdata and _cmeta

Since thin-pool supports convertion of data and metadata LV,
enable the same for cache data and metadata LV.

8 years agotests: stacktrace on skip if message is empty
Marian Csontos [Thu, 19 Nov 2015 11:11:58 +0000 (12:11 +0100)]
tests: stacktrace on skip if message is empty

8 years agotests: add missing --skip option and S env.variable
Marian Csontos [Thu, 19 Nov 2015 09:48:17 +0000 (10:48 +0100)]
tests: add missing --skip option and S env.variable

8 years agocleanup: cast resulting value explicitely
Zdenek Kabelac [Thu, 19 Nov 2015 10:59:19 +0000 (11:59 +0100)]
cleanup: cast resulting value explicitely

8 years agocleanup: add stack traces
Zdenek Kabelac [Wed, 18 Nov 2015 08:15:45 +0000 (09:15 +0100)]
cleanup: add stack traces

8 years agocleanup: use display_lvname in pmspare
Zdenek Kabelac [Wed, 18 Nov 2015 08:14:24 +0000 (09:14 +0100)]
cleanup: use display_lvname in pmspare

Just switch to use display_lvname().
Also squeeze possibly failing strncpy into INTERNAL_ERROR
as lvname always should fit.

8 years agolibdm: report: consolidate use of string list selection structures
Peter Rajnoha [Wed, 18 Nov 2015 09:54:09 +0000 (10:54 +0100)]
libdm: report: consolidate use of string list selection structures

8 years agotests: update lvmcache-exercise
David Teigland [Tue, 17 Nov 2015 18:05:22 +0000 (12:05 -0600)]
tests: update lvmcache-exercise

To handle multiple VGs with the same name.
Simply using the VG name is ambiguous, and
lvmetad requires the VG uuid be used to
specify which one is meant.

8 years agocoverity: trying different model
Zdenek Kabelac [Tue, 17 Nov 2015 17:58:15 +0000 (18:58 +0100)]
coverity: trying different model

Model reseting of given set, but it still makes
FD_SET to think it's accessing uninitialized value.

Maybe model also FD_SET.

8 years agocleanup: use embeded list
Zdenek Kabelac [Tue, 17 Nov 2015 12:38:17 +0000 (13:38 +0100)]
cleanup: use embeded list

Skip pointer and put list into selection_str_list.

8 years agocleanup: more readable code
Zdenek Kabelac [Tue, 17 Nov 2015 12:15:39 +0000 (13:15 +0100)]
cleanup: more readable code

Simplify if() expression.
Rename 'this' to 'vg'..

8 years agocleanup: add some test for NULL
Zdenek Kabelac [Tue, 17 Nov 2015 12:21:22 +0000 (13:21 +0100)]
cleanup: add some test for NULL

Coverity here is a bit 'blind' here and cannot resolve which
code paths are actually able to hit this code path.
(It's using 'statistic' to resolve all possible paths,
and it's not scanning 'individual' code paths.)

This just cleans warns and add 'cheap' tests.

8 years agocleanup: do not call vg_read with NULL mda
Zdenek Kabelac [Tue, 17 Nov 2015 12:23:28 +0000 (13:23 +0100)]
cleanup: do not call vg_read with NULL mda

Use 'mda' instead of NULL to quite Coverity warn.
However this code seems to be actually not even possible to hit.
With proper analysis it may possibly be dropped from code to
simplify logic.

8 years agocleanup: unify NULL custom check
Zdenek Kabelac [Tue, 17 Nov 2015 12:19:39 +0000 (13:19 +0100)]
cleanup: unify NULL custom check

Unify testing of NULL custom pointer.
Resolve 'factor' only in required if() branch.

8 years agoraid: drop unneeded NULL test
Zdenek Kabelac [Tue, 17 Nov 2015 12:17:59 +0000 (13:17 +0100)]
raid: drop unneeded NULL test

Skip testing target_pvs for NULL, we already
dereference it in many other places.
If check would ever be needed - it needs to be
in front of _raid_extract_images().

8 years agolibdm: update error message
Zdenek Kabelac [Mon, 16 Nov 2015 13:39:09 +0000 (14:39 +0100)]
libdm: update error message

Correcting error message.

8 years agohash: change name of new lookup function
David Teigland [Tue, 17 Nov 2015 17:59:44 +0000 (11:59 -0600)]
hash: change name of new lookup function

8 years agolvmetad: improve error message for VGs with same name
David Teigland [Tue, 17 Nov 2015 15:33:50 +0000 (09:33 -0600)]
lvmetad: improve error message for VGs with same name

8 years agolvmetad: different style for hash functions
David Teigland [Tue, 17 Nov 2015 16:19:04 +0000 (10:19 -0600)]
lvmetad: different style for hash functions

In lookup, return a count of entries with the
same key rather than the value from a second
entry with the same key.

Using some slightly different names.

8 years agolvmetad: add error explaining duplicate VG names
David Teigland [Mon, 16 Nov 2015 22:23:28 +0000 (16:23 -0600)]
lvmetad: add error explaining duplicate VG names

When a VG name lookup fails because the name matches
multiple VGs, return an explanatory error.

8 years agolvmetad: fix some error logging
David Teigland [Mon, 16 Nov 2015 21:08:52 +0000 (15:08 -0600)]
lvmetad: fix some error logging

For some errors old_meta may not be set, so
check before logging it.

8 years agolvmetad: use lookup_withval in another location
David Teigland [Mon, 16 Nov 2015 20:44:32 +0000 (14:44 -0600)]
lvmetad: use lookup_withval in another location

Simply use lookup_withval right away rather than doing a
standard lookup, checking for the wrong mapping, then
repeating with lookup_withval to get the right mapping.

8 years agolvmetad: remove unneeded FIXME
David Teigland [Mon, 16 Nov 2015 19:44:57 +0000 (13:44 -0600)]
lvmetad: remove unneeded FIXME

This case is now handled correctly.

8 years agohash: add comment about multiple values
David Teigland [Mon, 16 Nov 2015 17:01:53 +0000 (11:01 -0600)]
hash: add comment about multiple values

8 years agolibdm: fix check of pointer
Zdenek Kabelac [Mon, 16 Nov 2015 10:51:43 +0000 (11:51 +0100)]
libdm: fix check of pointer

Ahhh being blind here - wanted to check the pointer before dereference
not a dereferenced one.

8 years agolibdm: better error reporting from dm_split_lvm_name
Zdenek Kabelac [Mon, 16 Nov 2015 12:07:36 +0000 (13:07 +0100)]
libdm: better error reporting from dm_split_lvm_name

Report errors from all error paths correctly.
Validate passed args before dereferencing them.

8 years agocoverity: model FD_ZERO
Zdenek Kabelac [Fri, 13 Nov 2015 19:11:52 +0000 (20:11 +0100)]
coverity: model FD_ZERO

Coverity is not able to understand assembly language in
system's header file, so provide model for such macro.

Note: to really see model in-use: #nodef FD_ZERO model_FD_ZERO
need to go to coverity/config/user_nodefs.h

8 years agodebug: lvconvert add missing display_lvname
Zdenek Kabelac [Fri, 13 Nov 2015 22:38:34 +0000 (23:38 +0100)]
debug: lvconvert add missing display_lvname

Add missing display_lvname in _lvconvert_merge_thin_snapshot().

Also when we detect missing origin, report Internal error,
which would likely be the primary fault here
(and avoid dereft of NULL origin as noticed by Coverity).

8 years agocleanup: just alphabetically sort links
Zdenek Kabelac [Sat, 14 Nov 2015 21:14:37 +0000 (22:14 +0100)]
cleanup: just alphabetically sort links

8 years agocleanup: simplify dev_cache_exit
Zdenek Kabelac [Sat, 6 Dec 2014 22:56:14 +0000 (23:56 +0100)]
cleanup: simplify dev_cache_exit

Just set whole _cache struct into unitialized state just
like with lib init start usage.
Lists are initialized with dev_cache_init().

8 years agocleanup: add _free on error path
Zdenek Kabelac [Sat, 6 Dec 2014 22:55:25 +0000 (23:55 +0100)]
cleanup: add _free on error path

Just like with failing allocation above also _free(dev).

TODO: rework this to always use mempool and drop unneeded
comlexity we have in this function.

8 years agoformat-text: ensure no division by zero
Zdenek Kabelac [Mon, 16 Nov 2015 00:04:21 +0000 (01:04 +0100)]
format-text: ensure no division by zero

Coverity likes here to be 100% sure no division by zero is possible.
Add check for alignment !=0 which is made on other code paths here.

8 years agoconfig: check vdef pointer before dereference
Zdenek Kabelac [Sun, 15 Nov 2015 23:42:29 +0000 (00:42 +0100)]
config: check vdef pointer before dereference

Coverity notices we check for v_def != NULL elsewhere, so it thinks
it may be possibly NULL also here.

8 years agolibdm: check for passed custom time value
Zdenek Kabelac [Sun, 15 Nov 2015 23:41:25 +0000 (00:41 +0100)]
libdm: check for passed custom time value

Coverity reports custom should be checked before derefernce.

8 years agolibdm: check for null from pool strdup
Zdenek Kabelac [Sun, 15 Nov 2015 23:00:32 +0000 (00:00 +0100)]
libdm: check for null from pool strdup

Unlikely to happen, but Coverity shown we may have possible
derefer NULL pointer.

8 years agolibdm: check if passed return pointer is not NULL
Zdenek Kabelac [Sun, 15 Nov 2015 23:13:10 +0000 (00:13 +0100)]
libdm: check if passed return pointer is not NULL

Coverity: before storing return value, check passed space will
not dereference NULL pointer.

8 years agoman: improve cmirrord.8 manpage
Stéphane Aulery [Thu, 27 Nov 2014 01:32:38 +0000 (02:32 +0100)]
man: improve cmirrord.8 manpage

- Keywords in bold
- Add syslog and signal ref.
- Sort see also sections

Signed-off-by: Stéphane Aulery <saulery@free.fr>
8 years agoclvmd: remove -v option from getopt
Stéphane Aulery [Tue, 25 Nov 2014 01:57:22 +0000 (02:57 +0100)]
clvmd: remove -v option from getopt

-V is documented, not -v.

Signed-off-by: Stéphane Aulery <saulery@free.fr>
8 years agocache: handle older metadata format
Zdenek Kabelac [Sun, 15 Nov 2015 19:03:08 +0000 (20:03 +0100)]
cache: handle older metadata format

When reading older lvm2 metadata for cache-pool - we now handle more
extended syntax - basically we want to enter most setting when
actually creating cached LV.

For this new validation code has been added. However older metadata
without new settings set is now found as invalid.

Fix it by adding default settings for  cache policy  mq
and cache mode  writethrough.

8 years agolvmetad: change the new hash to take data len
David Teigland [Fri, 13 Nov 2015 22:54:22 +0000 (16:54 -0600)]
lvmetad: change the new hash to take data len

If the data len is passed into the hash table
and saved there, then the hash table internals
do not need to assume that the data value is
a string at any point.

8 years agotests: allow lvmetad tests with duplicate VG names
David Teigland [Fri, 13 Nov 2015 21:09:26 +0000 (15:09 -0600)]
tests: allow lvmetad tests with duplicate VG names

8 years agolvmetad: handle duplicate VG names
David Teigland [Thu, 12 Nov 2015 16:05:56 +0000 (10:05 -0600)]
lvmetad: handle duplicate VG names

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.)

8 years agopvmove: Remove unused find_pvmove_lv_from_pvname.
Alasdair G Kergon [Fri, 13 Nov 2015 18:06:08 +0000 (18:06 +0000)]
pvmove: Remove unused find_pvmove_lv_from_pvname.

8 years agocoverity: add few internal errors
Zdenek Kabelac [Fri, 13 Nov 2015 08:49:59 +0000 (09:49 +0100)]
coverity: add few internal errors

Mark impossible paths with internal errors.
Also replace 'strcmp() with more readable seg_is...()

8 years agocoverity: model some function
Zdenek Kabelac [Wed, 11 Nov 2015 21:03:42 +0000 (22:03 +0100)]
coverity: model some function

Reduce number of false-positives and model functions in a way
Coverity is able to understand it.

8 years agocoverity: hint
Zdenek Kabelac [Fri, 13 Nov 2015 08:47:14 +0000 (09:47 +0100)]
coverity: hint

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.

8 years agotests: without delay_dev skip some checks
Zdenek Kabelac [Fri, 13 Nov 2015 09:00:57 +0000 (10:00 +0100)]
tests: without delay_dev skip some checks

When delay_dev is missing these tests are just racy.

8 years agocleanup: better error message
Zdenek Kabelac [Fri, 13 Nov 2015 10:05:00 +0000 (11:05 +0100)]
cleanup: better error message

Use display_lvname.

8 years agocleanup: check LVs in one statement
Zdenek Kabelac [Wed, 11 Nov 2015 21:06:27 +0000 (22:06 +0100)]
cleanup: check LVs in one statement

Use a single statement to check all LVs we want to
deref via  get_only_segment_using_this_lv().

8 years agocleanup: missing check for PV2
Zdenek Kabelac [Wed, 11 Nov 2015 21:05:52 +0000 (22:05 +0100)]
cleanup: missing check for PV2

Patch missed also check this pointer dereference.

8 years agocleanup: drop unneded check for mem
Zdenek Kabelac [Wed, 11 Nov 2015 19:45:53 +0000 (20:45 +0100)]
cleanup: drop unneded check for mem

Revert missed to drop this extra check.

8 years agodebug: put stack on error path
Zdenek Kabelac [Wed, 11 Nov 2015 21:04:44 +0000 (22:04 +0100)]
debug: put stack on error path

At least check result and trace it.
However we may need better error reaction in this case.

8 years agoraid: ensure area_count is at least 2
Zdenek Kabelac [Fri, 13 Nov 2015 09:59:58 +0000 (10:59 +0100)]
raid: ensure area_count is at least 2

Enusure we will not divide by 0.

8 years agolibdm: put in secure check
Zdenek Kabelac [Wed, 11 Nov 2015 21:51:23 +0000 (22:51 +0100)]
libdm: put in secure check

Coverity complains about NULL deref - while this cannot currently
happen, put in secure INTERNAL_ERROR.

8 years agoreporter: add missing stack trace
Zdenek Kabelac [Wed, 11 Nov 2015 21:07:39 +0000 (22:07 +0100)]
reporter: add missing stack trace

Use goto_out on error paths.

8 years agolvmetad: tail chasing to shut up coverity
David Teigland [Thu, 12 Nov 2015 15:35:41 +0000 (09:35 -0600)]
lvmetad: tail chasing to shut up coverity

This page took 0.074754 seconds and 5 git commands to generate.