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).
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.
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).
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.
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.
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).
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.
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.)
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.
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().
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.
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).
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.
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.
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.)
Zdenek Kabelac [Wed, 11 Nov 2015 18:54:08 +0000 (19:54 +0100)]
dmeventd: fix check for failing open.
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).
Peter Rajnoha [Wed, 11 Nov 2015 14:15:34 +0000 (15:15 +0100)]
configure: check for udev_device_get_is_initialized is available
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.
Peter Rajnoha [Wed, 11 Nov 2015 12:13:54 +0000 (13:13 +0100)]
dev-ext: issue error if external_device_info_source=udev and udev db record 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].
...
David Teigland [Mon, 9 Nov 2015 19:23:59 +0000 (13:23 -0600)]
vgrename: check if new and old names match
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.