]> sourceware.org Git - lvm2.git/log
lvm2.git
6 years agoudev: keep systemd vars on change event in 69-dm-lvm-metad.rules for systemd reload
Martin Wilck [Tue, 17 Apr 2018 09:38:12 +0000 (11:38 +0200)]
udev: keep systemd vars on change event in 69-dm-lvm-metad.rules for systemd reload

The current logic that avoids setting SYSTEMD_ALIAS and SYSTEMD_WANTS
on "change" events is flawed in the default "systemd background job"
configuration. For systemd, it's important that device properties don't
change spuriously.

If an "add" event starts lvm2-pvscan@.service for a device, and a
"change" event follows, removing SYSTEMD_ALIAS and SYSTEMD_WANTS from the
udev db, information about unit dependencies between the device and the
pvscan service can be lost in systemd, in particular if the daemon
configuration is reloaded.

Steps to reproduce problem:

- create a device with an LVM PV
- remove device
- add device (generates "add" and "change" uevents for the device)
  (at this point SYSTEMD_ALIAS and SYSTEMD_WANTS are clear in udev db)
- systemctl daemon-reload
  (systemd reloads udev db)
- vgchange -a n
- remove device

=> the lvm2-pvscan@.service for the device is still active although the
device is gone.

- add device again

=> the PV is not detected, because systemd sees the lvm2-pvscan@.service
as active and thus doesn't restart it.

The original purpose of this logic was to avoid volumes being scanned
over and over again. With systemd background jobs, that isn't necessary,
because systemd will not restart the job as long as it's active.

Signed-off-by: Martin Wilck <mwilck@suse.com>
6 years agoudev: explicit pvscan rule in 69-dm-lvm-metad.rules
Martin Wilck [Tue, 17 Apr 2018 09:32:52 +0000 (11:32 +0200)]
udev: explicit pvscan rule in 69-dm-lvm-metad.rules

Make the distinction between the cases with and without systemd
background jobs explicit in 69-dm-lvm-metad.rules rather than
substituting the rule from the Makefile. At this stage,
this improves only readibility, at the cost of one GOTO statement.

This patch introduces no functional change to the udev rules.

Signed-off-by: Martin Wilck <mwilck@suse.com>
6 years agotest: add lvcreate-raid-volume_list
Heinz Mauelshagen [Fri, 6 Apr 2018 13:25:46 +0000 (15:25 +0200)]
test: add lvcreate-raid-volume_list

Test that no (Sub)LV remnants persist if the volume group is
not listed in configuration variable activation/volume_list,
hence not activatable thus causing initialization of rmeta
SubLVs to fail.

Related: rhbz1161347

6 years agotests: shellcheck misc
Zdenek Kabelac [Fri, 23 Mar 2018 16:01:13 +0000 (17:01 +0100)]
tests: shellcheck misc

Few more minor complains from ShellCheck.

6 years agotests: shellcheck split assing
Zdenek Kabelac [Fri, 23 Mar 2018 16:03:00 +0000 (17:03 +0100)]
tests: shellcheck split assing

Keep possibly error unmasked by assign

6 years agotests: shellcheck liter
Zdenek Kabelac [Fri, 23 Mar 2018 16:02:44 +0000 (17:02 +0100)]
tests: shellcheck liter

6 years agotests: shellcheck use grep -E
Zdenek Kabelac [Fri, 23 Mar 2018 15:59:51 +0000 (16:59 +0100)]
tests: shellcheck use grep -E

Replace egrep with grep -E

6 years agotests: shellcheck prevention check
Zdenek Kabelac [Fri, 23 Mar 2018 15:58:48 +0000 (16:58 +0100)]
tests: shellcheck prevention check

Always make sure variable is set to something else the /dev/*

6 years agofsadm: shellcheck prefer explicit escaping
Zdenek Kabelac [Fri, 23 Mar 2018 14:53:36 +0000 (15:53 +0100)]
fsadm: shellcheck prefer explicit escaping

Backslash is literal in "\t". Prefer explicit escaping: "\\t".

6 years agotests: handle setting better
Zdenek Kabelac [Mon, 19 Mar 2018 18:58:53 +0000 (19:58 +0100)]
tests: handle setting better

When using 'make check...  LVM_TEST_AUX_TRACE=0'  make it behaving
like other supported VARS in use so it's like disabled.

6 years agolibdm: enhance mounted fs detection
Zdenek Kabelac [Tue, 20 Mar 2018 10:13:22 +0000 (11:13 +0100)]
libdm: enhance mounted fs detection

btrfs is using fake major:minor device numbers.
try to be smarter and detect used node via DM device name.

This shortens delays, where i.e. lvm2 is asked to deactivate
volume with mounted btrfs as such operation is not retryed
and user is informed about device being in use.

6 years agotests: update no tool test
Zdenek Kabelac [Mon, 19 Mar 2018 09:26:50 +0000 (10:26 +0100)]
tests: update no tool test

Correct testing with format 1 and mq policy.

Add testing of 'smq'

Fix testing with clvmd - where logged message is part of clvmd log
and we can only check command status.

6 years agocleanup: typo fix
Zdenek Kabelac [Mon, 19 Mar 2018 11:05:36 +0000 (12:05 +0100)]
cleanup: typo fix

6 years agocache: disallow to combine format 2 with mq
Zdenek Kabelac [Mon, 19 Mar 2018 09:23:48 +0000 (10:23 +0100)]
cache: disallow to combine format 2 with mq

Only policy 'smq' is meant to be used with format version 2.
Code used to let pass 'mq' policy also with format 2. But 'mq'
is obsoloted wth smq and kernel currently matches it. But this
is incompatible with older original mq logic - so disallow creation
of this rather useless combination.

6 years agotests: use 4k extents
Zdenek Kabelac [Sat, 17 Mar 2018 23:30:43 +0000 (00:30 +0100)]
tests: use 4k extents

Use 4K chunks since some older kernels are not capable
to create striped volumes with smaller size.

TODO: lvm2 should detect this ahead and avoid kernel
reporting "Invalid chunk".

6 years agotests: check activation of cache without cache_check
Zdenek Kabelac [Sat, 17 Mar 2018 22:26:48 +0000 (23:26 +0100)]
tests: check activation of cache without cache_check

6 years agotests: test striped COW LV
Zdenek Kabelac [Sat, 17 Mar 2018 13:26:15 +0000 (14:26 +0100)]
tests: test striped COW LV

6 years agocleanup: use zalloc
Zdenek Kabelac [Sat, 17 Mar 2018 13:14:25 +0000 (14:14 +0100)]
cleanup: use zalloc

Replace malloc() + memset()   with zalloc().

6 years agocleanup: use direct initializer
Zdenek Kabelac [Sat, 17 Mar 2018 13:13:30 +0000 (14:13 +0100)]
cleanup: use direct initializer

6 years agocoverity: drop unused local static var
Zdenek Kabelac [Sat, 17 Mar 2018 13:00:44 +0000 (14:00 +0100)]
coverity: drop unused local static var

6 years agocoverity: drop unneeded header files
Zdenek Kabelac [Sat, 17 Mar 2018 13:00:21 +0000 (14:00 +0100)]
coverity: drop unneeded header files

6 years agocoverity: move declaration out of the loop
Zdenek Kabelac [Sat, 17 Mar 2018 12:57:40 +0000 (13:57 +0100)]
coverity: move declaration out of the loop

Move declaration of count counter outside the while loop.

6 years agocoverity: make use of defined variable
Zdenek Kabelac [Sat, 17 Mar 2018 12:56:44 +0000 (13:56 +0100)]
coverity: make use of defined variable

Since we declare 'r', let's use the value for something.

6 years agocoverity: validate descriptor
Zdenek Kabelac [Sat, 17 Mar 2018 12:53:12 +0000 (13:53 +0100)]
coverity: validate descriptor

Since this function is called with 'fd == -1', but Coverity can't see
this path can't be visited with this argument, add explicit check for
valid descriptor.

6 years agocoverity: ensure lock_type is not NULL
Zdenek Kabelac [Sat, 17 Mar 2018 13:16:09 +0000 (14:16 +0100)]
coverity: ensure lock_type is not NULL

6 years agocoverity: add missing error check for str_list_add
Zdenek Kabelac [Sat, 17 Mar 2018 13:15:11 +0000 (14:15 +0100)]
coverity: add missing error check for str_list_add

Validate success.

6 years agolvconvert: accept striped LV as snapshot COW LV
Zdenek Kabelac [Sat, 17 Mar 2018 13:01:09 +0000 (14:01 +0100)]
lvconvert: accept striped LV as snapshot COW LV

Restore back acceptance of striped LV to be valid COW LV.

6 years agoraid: fix version check of target
Zdenek Kabelac [Sat, 17 Mar 2018 20:44:53 +0000 (21:44 +0100)]
raid: fix version check of target

Comparision missed to check patch level for matching minor version.
Howerver since all checked patchlevels were 0 - the fix doesn't change result.

6 years agopools: skip checks when tools are missing
Zdenek Kabelac [Sat, 17 Mar 2018 20:50:03 +0000 (21:50 +0100)]
pools: skip checks when tools are missing

If the tools for checking thin_pool or cache metadata are missing,
issue rather just a WARNING, but let the operation of activation
continue.

This has the advantage, the if user is missing those tools,
but he already started to use thinpool or cacheing, he can
access these volumes with a WARNING.

Also if the user is using too old tools i.e. for CacheV2 format
dmpd tool 0.7 is required - provide informative WARNING and
skip failure from older tool version which can't understand
new format V2.

6 years agolvcreate: remove RaidLV on creation failure
Heinz Mauelshagen [Fri, 16 Mar 2018 14:47:12 +0000 (15:47 +0100)]
lvcreate: remove RaidLV on creation failure

In case a newly created RaidLV is blacklisted using config
\"activation { volume list = [ ... ] }\" (i.e. its SubLVs stay inactive),
the metadata SubLVs can't get wiped thus failing the creation.

As a result, the RaidLV together with its SubLVs
is left behind in an inconsistent state.

Fix by removing the RaidLV and provide a hint about volume_list reasoning.

Resolves: rhbz1161347

6 years agoactivation: separate prioritized counter
Zdenek Kabelac [Thu, 15 Mar 2018 11:30:45 +0000 (12:30 +0100)]
activation: separate prioritized counter

While prioritized_section() based on raised priority works
nicely for standard lvm comman - separate counter is actually needed
when it's used in daemons like clvmd/dmeventd  where priority
stays raised all the time.

6 years agotests: skip test when not enough space
Zdenek Kabelac [Wed, 14 Mar 2018 10:21:56 +0000 (11:21 +0100)]
tests: skip test when not enough space

Make the test skipped instead of failing when there was not
enough space.

6 years agotests: use DM_DEBUG_WITH_LINE_NUMBERS
Zdenek Kabelac [Thu, 15 Mar 2018 09:41:08 +0000 (10:41 +0100)]
tests: use DM_DEBUG_WITH_LINE_NUMBERS

Use src:line also for debugging of tools like dmsetup.

6 years agotests: fix running tests on systems without udevd
Zdenek Kabelac [Wed, 14 Mar 2018 10:23:14 +0000 (11:23 +0100)]
tests: fix running tests on systems without udevd

Variable was unbound on systems without running udevd.

6 years agocleanup: missing dots and indent
Zdenek Kabelac [Wed, 14 Mar 2018 20:00:20 +0000 (21:00 +0100)]
cleanup: missing dots and indent

6 years agoactivation: check for prioritized_section
Zdenek Kabelac [Thu, 15 Mar 2018 09:28:43 +0000 (10:28 +0100)]
activation: check for prioritized_section

Detect we are in prioritezed section instead of critical one,
since these operation were supposed to NOT be happining during
whole set of operation.

This patch fixes verification of udev operations.

6 years agolocking: introduce prioritized_section
Zdenek Kabelac [Thu, 15 Mar 2018 08:07:24 +0000 (09:07 +0100)]
locking: introduce prioritized_section

Introduce prioritized_section() as a closer match to previous logic
of critical_section() that has been held over longer sequence of
ioctl commands - essentially it's matching operation on a single
cookie.

While 'critical_section()' now corresponds to locked memory - we hold
this memory only between suspend/resume thus notion of 'cookie' was
lost.

This patch restores some logic unintentionaly lost with dropping
memory locking for just activation/deactivation calls.

6 years agolibdm-stats: fix error messages
Zdenek Kabelac [Wed, 14 Mar 2018 20:00:46 +0000 (21:00 +0100)]
libdm-stats: fix error messages

When function dm_stats_populate() returns 0 it's an error and needs
log_error() message -  function can't have 'success' returning 0 or
error without reasons.

6 years agodmstatus: check nr_regions ahead of find call
Zdenek Kabelac [Wed, 14 Mar 2018 20:01:22 +0000 (21:01 +0100)]
dmstatus: check nr_regions ahead of find call

Prevent call of dm_stats_populate(), when there has been no
stats region detected for a DM device.
Such skip is evaluated as 'correct' visit of stats call and
not causing 'dmstats' command failure.

6 years agodmsetup: loop output table as verbose
Zdenek Kabelac [Wed, 14 Mar 2018 20:02:32 +0000 (21:02 +0100)]
dmsetup: loop output table as verbose

Resulting loop table line was streamed to 'stderr' stream - assuming this
was not a feature when user used '-v' for more verbose output
and properly show it via  'log_verbose()' on 'stdout'.

6 years agodevcache: add reason and always log_error
Zdenek Kabelac [Wed, 14 Mar 2018 18:33:20 +0000 (19:33 +0100)]
devcache: add reason and always log_error

With these read errors it's useful to know the reason.
Also avoid to log error just once so we know exactly
how many times we did failing read.

On the other hand reduce repeated log_error() on code 'backtrace'
path and change severity of message to just log_debug() so the
actual read error is printed once for one read.

6 years agolibdm: support for DM_DEBUG_WITH_LINE_NUMBERS
Zdenek Kabelac [Wed, 14 Mar 2018 17:08:16 +0000 (18:08 +0100)]
libdm: support for DM_DEBUG_WITH_LINE_NUMBERS

For any libdm tool using default debugging function allow
to show source filename and code line number when this
functionality is available.

6 years agotest: Skip tests which require too much RAM
Marian Csontos [Tue, 13 Mar 2018 12:41:33 +0000 (13:41 +0100)]
test: Skip tests which require too much RAM

- Tests for RAID reshape under load require too much RAM

6 years agotests: try unfreezeing raids
Zdenek Kabelac [Thu, 8 Mar 2018 16:32:47 +0000 (17:32 +0100)]
tests: try unfreezeing raids

With problematic kernels raid devices can be occasionaly left with
'frozen' status - try to 'unfreeze' them with idle message on teardown.

Also replace couple greps with 'built-in' dmsetup --select feature.

Note: dmsetup --select  currently reports 'No devices found' on stdout
and return success - looks like a bug to fix.

6 years agodmsetup: indent
Zdenek Kabelac [Mon, 12 Mar 2018 10:58:04 +0000 (11:58 +0100)]
dmsetup: indent

6 years agocleanup: matching signess
Zdenek Kabelac [Sun, 11 Mar 2018 20:08:07 +0000 (21:08 +0100)]
cleanup: matching signess

6 years agodmsetup: report close as debug
Zdenek Kabelac [Mon, 12 Mar 2018 22:01:52 +0000 (23:01 +0100)]
dmsetup: report close as debug

Since close() failures are not causing command errors,
issue error via debug log stream only.

6 years agodmsetup: use dm_snprintf
Zdenek Kabelac [Mon, 12 Mar 2018 10:57:31 +0000 (11:57 +0100)]
dmsetup: use dm_snprintf

6 years agodmsetup: update _display_info
Zdenek Kabelac [Mon, 12 Mar 2018 10:56:54 +0000 (11:56 +0100)]
dmsetup: update _display_info

Handle error code.

6 years agodmsetup: update messages
Zdenek Kabelac [Mon, 12 Mar 2018 10:56:25 +0000 (11:56 +0100)]
dmsetup: update messages

6 years agodmsetup: join large fprintf
Zdenek Kabelac [Mon, 12 Mar 2018 10:41:12 +0000 (11:41 +0100)]
dmsetup: join large fprintf

Concatenate strings and make binary slightly smaller.

6 years agodmsetup: stderr to log_error
Zdenek Kabelac [Mon, 12 Mar 2018 10:40:30 +0000 (11:40 +0100)]
dmsetup: stderr to log_error

6 years agodmsetup: cleanup err usage
Zdenek Kabelac [Fri, 9 Mar 2018 19:50:43 +0000 (20:50 +0100)]
dmsetup: cleanup err usage

Macro err() add '\n'.

6 years agodmsetup: use stderr for error output
Zdenek Kabelac [Fri, 9 Mar 2018 22:29:09 +0000 (23:29 +0100)]
dmsetup: use stderr for error output

When dmsetup command returns error, the message goes to stderr.

6 years agomirror: correct locking for mirror log initialization
Zdenek Kabelac [Tue, 13 Mar 2018 11:48:36 +0000 (12:48 +0100)]
mirror: correct locking for mirror log initialization

The code was not acking proper lock holding LVs when trying to
initialize mirror log to predefined values.

6 years agoscanning: skip more private devices
Zdenek Kabelac [Fri, 9 Mar 2018 13:49:38 +0000 (14:49 +0100)]
scanning: skip more private devices

Just like lvm2 has internal devices like _tdata which is using UUID with
suffix, there is similar private type of device for crypto device where
they are using CRYPT-TEMP uuid prefix.

Also ignore stratis.

6 years agocleanup: use path on stack
Zdenek Kabelac [Fri, 9 Mar 2018 11:59:13 +0000 (12:59 +0100)]
cleanup: use path on stack

6 years agoraid: skip frozen raid devices
Zdenek Kabelac [Thu, 8 Mar 2018 12:18:39 +0000 (13:18 +0100)]
raid: skip frozen raid devices

Some kernel version suffer from bad state transition where a device
steps into 'frozen' mode. Any application that tries to read such
raid gets unfortunatelly bloked.

As some sort of protection try to skip such raid device from being
scanned to minimize chances to block lvm2 command on such scan.

When such device is found, warning gets printed.

6 years agocleanup: all tests needs target_type
Zdenek Kabelac [Thu, 8 Mar 2018 12:01:12 +0000 (13:01 +0100)]
cleanup: all tests needs target_type

Simplify code.

6 years agodev_manager: always activate RAID SubLVs readwrite
Heinz Mauelshagen [Mon, 12 Mar 2018 21:21:13 +0000 (22:21 +0100)]
dev_manager: always activate RAID SubLVs readwrite

RaidLVs on read_only_volume_list have their SubLVs
activated readonly thus disabling metadata updates
or image resynchronization/recovery.  Bug also causes
automatic repairs to fail.

Fix by always activating the RAID SubLVs readwrite.

Resolves: rhbz1208269

6 years agoraid: support raid5_n convenience type on conversion to raid10
Heinz Mauelshagen [Fri, 9 Mar 2018 20:15:41 +0000 (21:15 +0100)]
raid: support raid5_n convenience type on conversion to raid10

Fix requesting a conversion on raid5_{ls,rs,la,ra} -> raid10
not offering offering interim convenience type raid5_n.

Resolves: rhbz1468600

6 years agocleanup: use log_warn
Zdenek Kabelac [Thu, 8 Mar 2018 09:29:49 +0000 (10:29 +0100)]
cleanup: use log_warn

There message are not causing command failure thus turn them
into warnings.

6 years agocache: fix lock usage for cache conversion
Zdenek Kabelac [Thu, 8 Mar 2018 09:30:46 +0000 (10:30 +0100)]
cache: fix lock usage for cache conversion

Just like with lvcreate, this lvconvert case also need to properly
check which LV actually holds lock for cached origin - as it might
be i.e. thin-pool tdata subLV.

6 years agosnapshot: skip invalid snapshost
Zdenek Kabelac [Thu, 8 Mar 2018 09:32:15 +0000 (10:32 +0100)]
snapshot: skip invalid snapshost

When scanning DM device, skip automatically invalid snapshot devices.
They behave just like 'error' device.

6 years agosnapshot: keep COW writable for read-only volumes
Zdenek Kabelac [Thu, 8 Mar 2018 09:27:04 +0000 (10:27 +0100)]
snapshot: keep COW writable for read-only volumes

When snapshot is created in read-only mode with 'lvcreate -s -pr...',
lvm2 still needs to be able to write to layered -cow volume
to store metadata and exceptions blocks.

TODO: in some case we might be able to do full tree with read-only
volume but this probably needs futher validation:
1. checking snapshot header already exist
2. origin & snapshot are both in read-only mode.

6 years agotests: skipping test waiting for fixed kernel
Zdenek Kabelac [Tue, 6 Mar 2018 14:32:27 +0000 (15:32 +0100)]
tests: skipping test waiting for fixed kernel

Once working kernel is released, reenable me...

6 years agotests: component activation
Zdenek Kabelac [Fri, 2 Mar 2018 14:07:25 +0000 (15:07 +0100)]
tests: component activation

6 years agoactivation: support proper /dev names for component LVs
Zdenek Kabelac [Wed, 28 Feb 2018 16:22:09 +0000 (17:22 +0100)]
activation: support proper /dev names for component LVs

When LV is activated AS componet LV - ensure there will
be /dev/vgname/lvname  link present for such LV.

6 years agoactivation: support activation of component LVs
Zdenek Kabelac [Wed, 28 Feb 2018 16:16:17 +0000 (17:16 +0100)]
activation: support activation of component LVs

Occasionaly users may need to peek into 'component devices.
Normally lvm2 does not let users activation component.

This patch adds special mode where user can activate
component LV in a 'read-only' mode i.e.:

lvchange -ay vg/pool_tdata

All devices can be deactivated with:

lvchange -an vg  |  vgchange -an....

6 years agolvconvert: support for convertsion with active component devices
Zdenek Kabelac [Fri, 2 Mar 2018 15:34:09 +0000 (16:34 +0100)]
lvconvert: support for convertsion with active component devices

If componet devices could be activated alone, ensure they are not breaking
common commands.

TODO: mostly likely this is not a definite list of all needed checks
and more will come later.

6 years agolvremove: ensure no subLV is active
Zdenek Kabelac [Fri, 2 Mar 2018 21:07:14 +0000 (22:07 +0100)]
lvremove: ensure no subLV is active

Since component activation is going to be enabled, enusure,
no subLV is active when we deactivate LV.

6 years agolvremove: validate removed component LV is not active
Zdenek Kabelac [Fri, 2 Mar 2018 15:32:05 +0000 (16:32 +0100)]
lvremove: validate removed component LV is not active

This is the 'last' place where a LV is present in metadata.
Any removed device should not be left active in dm table.
So this check is an extra validation protection to capture any
forgotten deactivation (adding 1 extra ioctl into lvremove path)

6 years agoactivation: add base lv component function
Zdenek Kabelac [Tue, 27 Feb 2018 13:13:00 +0000 (14:13 +0100)]
activation: add base lv component function

Introduce:

lv_is_component() check is LV is actually a component device.

lv_component_is_active() checking if any component device is active.

lv_holder_is_active() is any component holding device is active.

6 years agodebug: update comment
Zdenek Kabelac [Fri, 2 Mar 2018 14:06:36 +0000 (15:06 +0100)]
debug: update comment

6 years agocleanup: more usage of dm_strncpy
Zdenek Kabelac [Fri, 2 Mar 2018 15:25:37 +0000 (16:25 +0100)]
cleanup: more usage of dm_strncpy

Use existing wrapper function arournd  strncpy + buf[] = 0;

6 years agolvremove: drop duplicate check for active LV
Zdenek Kabelac [Tue, 6 Mar 2018 12:31:06 +0000 (13:31 +0100)]
lvremove: drop duplicate check for active LV

Since this code branch already tested LV is active,
avoid repeating same query.

6 years agolvcreate: fix activation of cached LV
Zdenek Kabelac [Mon, 5 Mar 2018 11:54:39 +0000 (12:54 +0100)]
lvcreate: fix activation of cached LV

Since LV for caching can be already a stacked LV, proper activation
needs to use lock holding LV.

6 years agoraid: move VG update after archiving happened
Zdenek Kabelac [Tue, 6 Mar 2018 12:38:00 +0000 (13:38 +0100)]
raid: move VG update after archiving happened

Update of LV le_count needs to happen after archive().

6 years agoraid: fix error path for lv_raid_data_offset
Zdenek Kabelac [Fri, 2 Mar 2018 14:49:12 +0000 (15:49 +0100)]
raid: fix error path for lv_raid_data_offset

Avoid using allocated status on error path.

6 years agothin: pass environment to scripts
Zdenek Kabelac [Mon, 5 Mar 2018 14:09:16 +0000 (15:09 +0100)]
thin: pass environment to scripts

When dmeventd thin plugin forks a configurable script, switch to use
execvp to pass whole environment present to dmeventd - so all configured
paths present at dmeventd startup are visible to script.

This was likely not a problem for common user enviroment,
however in test suite case variable like LVM_SYSTEM_DIR were
not actually used from test itself but rather from
a system present lvm.conf and this may have cause strange
behavior of a testing script.

6 years agocleanup: indent
Zdenek Kabelac [Mon, 26 Feb 2018 13:44:51 +0000 (14:44 +0100)]
cleanup: indent

6 years agocleanup: use lv_is_used_cache_pool
Zdenek Kabelac [Wed, 28 Feb 2018 16:38:43 +0000 (17:38 +0100)]
cleanup: use lv_is_used_cache_pool

Use lv_is_used_cache_pool() to simplify the code.
Function was introduced later and this code missed to use it.

6 years agocleanup: explicitely ignore result code
Zdenek Kabelac [Sun, 25 Feb 2018 15:18:31 +0000 (16:18 +0100)]
cleanup: explicitely ignore result code

ATM too long prefix is silently ignored.

6 years agocleanup: unused header file
Zdenek Kabelac [Sun, 25 Feb 2018 15:18:11 +0000 (16:18 +0100)]
cleanup: unused header file

6 years agodebug: change message severity
Zdenek Kabelac [Wed, 21 Feb 2018 13:08:17 +0000 (14:08 +0100)]
debug: change message severity

Although it's internal issue - in this case command continue without
any reported error - thus hide this internal error into debug.

6 years agotests: check inactive extorig resize
Zdenek Kabelac [Wed, 28 Feb 2018 18:03:20 +0000 (19:03 +0100)]
tests: check inactive extorig resize

6 years agolvresize: check external origin with new size
Zdenek Kabelac [Wed, 28 Feb 2018 16:04:26 +0000 (17:04 +0100)]
lvresize: check external origin with new size

Instead of checking with existing size of external origin LV,
use correctly the new 'wanted' size of this LV whether it fits
the limitiation requirements for older thin-pool target.

Otherwise code started to the the resize, updates metadata and
just fails during 'resize' in case the LV was active. For
inactive LV operation could have actually passed.

6 years agolvremove: drop unneded check
Zdenek Kabelac [Wed, 28 Feb 2018 16:37:03 +0000 (17:37 +0100)]
lvremove: drop unneded check

Checking here for cache_pool is not necessary and in effect
the check is not even right - since there are internal
states that do allow to active such LV.

6 years agocommand: use bigger buffer
Zdenek Kabelac [Wed, 28 Feb 2018 15:57:53 +0000 (16:57 +0100)]
command: use bigger buffer

Instead of use 'silently' shortened passed string - always
make sure we take either a full copy or return error.

6 years agolv_manip: enhance for_each_sub_lv
Zdenek Kabelac [Wed, 28 Feb 2018 16:00:33 +0000 (17:00 +0100)]
lv_manip: enhance for_each_sub_lv

Fix missing 'externalLV' traversing for thins with external origins.

Replace extra for_each_sub_lv_except_pools() with better
internal logic allowing selectively to cut of processed subLV tree.

Extend error code for function 'fn()' when it returns -1 it will
stop futher tree scan for given LV.

Also a bit simplify code to have only one place that
is calling 'fn()' and use level counter to know
depth of traversing.

Update renaming travering to skip trees for pools
and external origins.

6 years agoio: keep 64b arithmetic
Zdenek Kabelac [Sun, 25 Feb 2018 21:32:14 +0000 (22:32 +0100)]
io: keep 64b arithmetic

Widen to 64b arithmetic from start.

6 years agoraid: add free for error path
Zdenek Kabelac [Sun, 25 Feb 2018 15:20:30 +0000 (16:20 +0100)]
raid: add free for error path

Recent patch forget to release now allocated 'dso' on error path.

6 years agocoverity: missing free on error path
Zdenek Kabelac [Sun, 25 Feb 2018 15:17:42 +0000 (16:17 +0100)]
coverity: missing free on error path

6 years agotests: check vgsplit thin-data and ext.origin
Marian Csontos [Tue, 27 Feb 2018 12:45:39 +0000 (13:45 +0100)]
tests: check vgsplit thin-data and ext.origin

6 years agotests: correct usage of pipe
Zdenek Kabelac [Sat, 17 Feb 2018 10:24:32 +0000 (11:24 +0100)]
tests: correct usage of pipe

This is somewhat tricky - for test suite we keep using
'set -e -o pipefail'  - the effect here is - we get error report
from any 'failing' command in whole pipeline - thus when something
like this:   'lvs | head -1'  is used - and  'head' finishes before
lead 'lvs' is done - it recieves SIGPIPE and exits with error,
and somewhat misleading gets occasionally reported depending
of speed of commands.

For this case we have to avoid using standard pipes and rather
switch to using streamed results with temporary output file.
This is all nicely handled with bash feature '< <()'.

For more info:
https://stackoverflow.com/questions/41516177/bash-zcat-head-causes-pipefail

6 years agodebug: capture internal error for too long resource name
Zdenek Kabelac [Mon, 19 Feb 2018 14:30:55 +0000 (15:30 +0100)]
debug: capture internal error for too long resource name

Should never happen, so just put in internal error instead of silently
passing some shortened resource name.

6 years agolocking: move cache dropping to primary locking code
Zdenek Kabelac [Mon, 19 Feb 2018 15:31:52 +0000 (16:31 +0100)]
locking: move cache dropping to primary locking code

While 'file-locking' code always dropped cached VG before
lock was taken - other locking types actually missed this.

So while the cache dropping has been implement for i.e. clvmd,
actually running command in cluster keept using cache even
when the lock has been i.e. dropped and taken again.

This rather 'hard-to-hit' error was noticable in some
tests running in cluster where content of PV has been
changed (metadata-balance.sh)

Fix the code by moving cache dropping directly lock_vol() function.

TODO: it's kind of strange we should ever need drop_cached_metadata()
used in several places - this all should happen automatically
this some futher thinking here is likely needed.

6 years agosanlock: set proper return value
Zdenek Kabelac [Sat, 17 Feb 2018 10:23:19 +0000 (11:23 +0100)]
sanlock: set proper return value

In last patch one error path missed to assign correct return value.
Assing it directly to 'ret' as log_error was already reported.

6 years agodoc: Fixing VDO document
Marian Csontos [Fri, 16 Feb 2018 16:09:40 +0000 (17:09 +0100)]
doc: Fixing VDO document

6 years agotests: update
Zdenek Kabelac [Wed, 14 Feb 2018 22:08:26 +0000 (23:08 +0100)]
tests: update

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