]> sourceware.org Git - lvm2.git/log
lvm2.git
5 years agodm: introduce DM_GET_TARGET_VERSION
Mikulas Patocka [Mon, 16 Sep 2019 09:58:10 +0000 (05:58 -0400)]
dm: introduce DM_GET_TARGET_VERSION

Adds support for the DM_GET_TARGET_VERSION to dmsetup.
It introduces a new comman "target-version" that will accept list
of targets and print their version.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
5 years agocmirrord: deamon links libdm
Zdenek Kabelac [Fri, 4 Oct 2019 15:23:34 +0000 (17:23 +0200)]
cmirrord: deamon links libdm

Correct included header files for this outdated tool since
it's linked with libdm, it need to use header files from this dir.

5 years agolvmlockd: set failure flag for test mode
David Teigland [Fri, 4 Oct 2019 15:07:24 +0000 (10:07 -0500)]
lvmlockd: set failure flag for test mode

Set a failure flag when vg_read returns an error
for test mode.  The caller can segfault if there's
an error with no flag set.

5 years agospec: Fix lvm2-activation-generator man page handling
Marian Csontos [Fri, 4 Oct 2019 14:29:38 +0000 (16:29 +0200)]
spec: Fix lvm2-activation-generator man page handling

lvm2-activation-generator is not installed when systemd is not in the
system.

5 years agotests: add wipefs wrapper
David Teigland [Wed, 2 Oct 2019 19:11:08 +0000 (14:11 -0500)]
tests: add wipefs wrapper

which falls back to using dd on old systems without
the wipefs command

5 years agotests: update to md dev name
David Teigland [Wed, 2 Oct 2019 17:51:17 +0000 (12:51 -0500)]
tests: update to md dev name

Use /dev/md33 instead of /dev/md0 to reduce chances of
conflicting with an existing name.

Only call 'mdadm --stop /dev/md33' for cleanup and don't
use 'mdadm --stop --scan' to avoid stopping other md devs.

5 years agotest: increase size of raid10 LV allowing tests to succeed on fast storage
Heinz Mauelshagen [Wed, 2 Oct 2019 12:59:17 +0000 (14:59 +0200)]
test: increase size of raid10 LV allowing tests to succeed on fast storage

Also add health char check.

5 years agotest: add RAID lvextend resynchronization test
Heinz Mauelshagen [Wed, 2 Oct 2019 12:54:00 +0000 (14:54 +0200)]
test: add RAID lvextend resynchronization test

Due to a dm-raid target flaw fixed in target version 1.15.0,
extents of raid sets don't get resynchronized when new MD bitmp
pages have to be allocated due to the extension.

Introduce lvextend-raid.sh to test this flaw.

Related: rhbz1671964

5 years agotest: add checks for not 100% sync ratio after initiation of check/repair
Heinz Mauelshagen [Wed, 2 Oct 2019 12:48:53 +0000 (14:48 +0200)]
test: add checks for not 100% sync ratio after initiation of check/repair

Related: rhbz1640630

5 years agopvck: handle PVs with zero metadata copies
David Teigland [Mon, 30 Sep 2019 21:20:17 +0000 (16:20 -0500)]
pvck: handle PVs with zero metadata copies

5 years agotests: update duplicate md tests
David Teigland [Fri, 27 Sep 2019 19:18:35 +0000 (14:18 -0500)]
tests: update duplicate md tests

adjust to recent improvements in duplicate handling

5 years agoscan: use PV device name hint for choosing duplicate PV
David Teigland [Fri, 27 Sep 2019 16:34:55 +0000 (11:34 -0500)]
scan: use PV device name hint for choosing duplicate PV

Prefer a device if its name matches the PV device name hint.

5 years agoscan: use PV size for choosing duplicate PV
David Teigland [Fri, 27 Sep 2019 16:11:57 +0000 (11:11 -0500)]
scan: use PV size for choosing duplicate PV

Prefer a device if it matches the size of the PV.

5 years agoscan: add PV summary info to lvmcache
David Teigland [Thu, 26 Sep 2019 16:27:38 +0000 (11:27 -0500)]
scan: add PV summary info to lvmcache

Expand the lvmcache info that is saved by the scan to
include PV info from the metadata.

5 years agopvscan: use quick activation only with matching PV device names
David Teigland [Wed, 4 Sep 2019 20:59:49 +0000 (15:59 -0500)]
pvscan: use quick activation only with matching PV device names

When the PV device names in the VG metadata do not match the
current PV device names seen on the system, do not use the
optimized activation function (that avoids extra device scanning.)

When the device names do not match, it's a clue that there could
be duplicate PVs, in which case we want to scan all devicess to
find any duplicates and stop the activation if found.

This does not prevent autoactivating a VG from the incorrect
duplicate PV, because the incorrect duplicate may appear by itself
first.  At that point its duplicate PV does not exist to be seen.
(A future enhancement could use the WWID to strengthen this
detection.)

5 years agometadata: import device name hint from metadata
David Teigland [Wed, 4 Sep 2019 19:13:14 +0000 (14:13 -0500)]
metadata: import device name hint from metadata

Start by using it in a comment for a missing PV.

5 years agometadata: add args to metadata import functions
David Teigland [Thu, 26 Sep 2019 16:50:51 +0000 (11:50 -0500)]
metadata: add args to metadata import functions

instead of getting them through fid arg
no functional change

5 years agodmsetup: do not treat no groups as an error in dmstats list --group
Bryn M. Reeves [Mon, 30 Sep 2019 16:10:05 +0000 (17:10 +0100)]
dmsetup: do not treat no groups as an error in dmstats list --group

Analogous to the case of a device with no regions, it is not an
error to attempt to list the stats groups on a device that has no
configured groups: just return success and continue.

5 years agovdo: restore monitoring of vdo pool
Zdenek Kabelac [Mon, 30 Sep 2019 11:28:20 +0000 (13:28 +0200)]
vdo: restore monitoring of vdo pool

Switch to -vpool layered name needs to monitor proper device.

5 years agovdo: properly check percentage for resize
Zdenek Kabelac [Mon, 30 Sep 2019 11:25:42 +0000 (13:25 +0200)]
vdo: properly check percentage for resize

Avoid checking 'lv_is_active()' since special LV types does this
validation anyway what calling  _percent() function  and call it
ONLY when none of special types is queried.

This restores support for VDO resize (as with support for
separate VDO pool activation, plain query for lv_is_active()
is not working in this case).

5 years agovdo: deactivate forgotten vdo pool
Zdenek Kabelac [Mon, 30 Sep 2019 11:22:42 +0000 (13:22 +0200)]
vdo: deactivate forgotten vdo pool

If the linear mapping is lost (for whatever reason, i.e.
test suite forcible  'dmsetup remove' linear LV,
lvm2 had hard times figuring out how to deactivate such DM table.

So add function which is in case inactive VDO pool LV checks if
the pool is actually still active (-vpool device present) and
it has open count == 0.  In this case deactivation is allowed
to continue and cleanup DM table.

5 years agotests: mdadm stop in test cleanup
David Teigland [Fri, 27 Sep 2019 17:51:34 +0000 (12:51 -0500)]
tests: mdadm stop in test cleanup

try to clear any existing md devs remaining after
a test

5 years agotests: skip md tests if system not clean
David Teigland [Fri, 27 Sep 2019 17:40:42 +0000 (12:40 -0500)]
tests: skip md tests if system not clean

5 years agotests: writecache-split check have_writecache
David Teigland [Thu, 26 Sep 2019 15:45:53 +0000 (10:45 -0500)]
tests: writecache-split check have_writecache

5 years agospec: enable writecache
Marian Csontos [Wed, 25 Sep 2019 06:39:56 +0000 (08:39 +0200)]
spec: enable writecache

5 years agobuild: make generate
Marian Csontos [Wed, 25 Sep 2019 06:27:49 +0000 (08:27 +0200)]
build: make generate

5 years agolvconvert: enable --uncache with dm-writecache cachevol
David Teigland [Tue, 24 Sep 2019 20:49:21 +0000 (15:49 -0500)]
lvconvert: enable --uncache with dm-writecache cachevol

splitcache followed by an automatic lvremove of
the cachevol LV

5 years agowritecache: allow removing LV with attached writecache
David Teigland [Tue, 24 Sep 2019 20:33:09 +0000 (15:33 -0500)]
writecache: allow removing LV with attached writecache

5 years agowritecache: move code into new file
David Teigland [Tue, 24 Sep 2019 20:28:02 +0000 (15:28 -0500)]
writecache: move code into new file

put writecache specific code in writecache_manip.c

should be no functional change

5 years agolvremove: remove attached cachevol with removed LV
David Teigland [Tue, 24 Sep 2019 18:46:40 +0000 (13:46 -0500)]
lvremove: remove attached cachevol with removed LV

When an LV is removed that has an attached cachevol,
also remove the cachevol LV.

5 years agotests: update cache-single-split
David Teigland [Tue, 24 Sep 2019 18:17:40 +0000 (13:17 -0500)]
tests: update cache-single-split

add some uncache commands

5 years agolvconvert: enable --uncache with dm-cache cachevol
David Teigland [Tue, 24 Sep 2019 16:57:44 +0000 (11:57 -0500)]
lvconvert: enable --uncache with dm-cache cachevol

splitcache followed by an automatic lvremove of
the cachevol LV

5 years agolvconvert: separate splitcache and uncache functions
David Teigland [Tue, 24 Sep 2019 16:28:30 +0000 (11:28 -0500)]
lvconvert: separate splitcache and uncache functions

Reorg code so there are separate functions for splitcache
and uncache for both cachepool and cachevol.  Should be no
functional change.

5 years agotests: add writecache-split
David Teigland [Mon, 23 Sep 2019 19:37:46 +0000 (14:37 -0500)]
tests: add writecache-split

5 years agolvconvert: allow --cache shortcut for --type cache with cachevol
David Teigland [Mon, 23 Sep 2019 16:07:12 +0000 (11:07 -0500)]
lvconvert: allow --cache shortcut for --type cache with cachevol

5 years agotests: update cache-single-split
David Teigland [Mon, 23 Sep 2019 19:20:01 +0000 (14:20 -0500)]
tests: update cache-single-split

enable splitting while LV is active which works
again since the cvol suffix was dropped.

5 years agodrop cvol dm uuid suffix for cachevol LVs
David Teigland [Mon, 23 Sep 2019 19:10:56 +0000 (14:10 -0500)]
drop cvol dm uuid suffix for cachevol LVs

The "-cvol" suffix on the uuid is interfering with
activation code, so drop the suffix for now.

5 years agotests: update cache-single-split
David Teigland [Fri, 20 Sep 2019 21:33:35 +0000 (16:33 -0500)]
tests: update cache-single-split

the new use of uuid suffixes on internal dm devs
has impacted splitting when an LV is active,
so temporarily disable that until fixed.

5 years agowritecache: display layout and role fields
David Teigland [Fri, 20 Sep 2019 19:54:00 +0000 (14:54 -0500)]
writecache: display layout and role fields

5 years agowritecache: use dm suffixes and lv attributes
David Teigland [Fri, 20 Sep 2019 19:04:18 +0000 (14:04 -0500)]
writecache: use dm suffixes and lv attributes

- use internal CACHE_VOL flag on cachevol LV
- add suffixes to dm uuids for internal LVs
- display appropriate letters in the LV attr field
- display writecache's cachevol in lvs output

5 years agodmeventd: avoid bail out preventing repair in raid plugin but keep message
Heinz Mauelshagen [Fri, 20 Sep 2019 15:35:35 +0000 (17:35 +0200)]
dmeventd: avoid bail out preventing repair in raid plugin but keep message

Followup patch mentioned in previous commit fe577f84cbf6bd7be76b457c9d54d0e54e57f93d.

Problem:
  even though dead raid component devices are detected, the
  raid plugin is bailing out thus preventing a repair attempt.

Rational:
  in case of component device errors, the MD resynchronization
  thread runs in parallel with the thrown event being processed
  by the raid plugin.  The plugin retrieves the raid device status
  but that still reflects insync regions as 0 (when it should
  already be total regions) because the MD thread didn't update it yet.

Solution:
  Remove the insync regions check but keep the informal message
  "waiting for resynchronization"  and let lvconvert carry out its
  pre-repair checks and optionally carry out a repair attempt.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1751887
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1560739
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1468590
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1654860
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1729303
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1741016

5 years agoRevert "dmeventd: avoid bail out preventing repair in raid plugin"
Heinz Mauelshagen [Fri, 20 Sep 2019 15:26:36 +0000 (17:26 +0200)]
Revert "dmeventd: avoid bail out preventing repair in raid plugin"

This reverts commit ad560a286a0b5d08086324e6194b060c136e9353.

The reverted patch also removed the warning which we realized we need
to keep as valuable process information (see related bugzilla below).

In a followup patch, we'll keep the message and avoid bailing out thus
always allowing lvconvert to try repairing if 'allocate' fault policy set.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1751887

5 years agotests: add cache-single-split
David Teigland [Wed, 18 Sep 2019 20:14:22 +0000 (15:14 -0500)]
tests: add cache-single-split

5 years agolvconvert: detaching cachevol with missing PVs
David Teigland [Tue, 17 Sep 2019 21:32:34 +0000 (16:32 -0500)]
lvconvert: detaching cachevol with missing PVs

. For dm-cache in writethrough, always allow splitcache,
  whether the cache is missing PVs or not.

. For dm-cache in writeback, if the cache is missing PVs,
  allow splitcache with force and yes.

. For dm-writecache, if the cache is missing PVs,
  allow splitcache with force and yes.

5 years agolvchange: allow activating cachevol
David Teigland [Thu, 19 Sep 2019 21:18:47 +0000 (16:18 -0500)]
lvchange: allow activating cachevol

5 years agocachevol: add dm uuid suffixes to hidden lvs
David Teigland [Fri, 20 Sep 2019 14:46:03 +0000 (09:46 -0500)]
cachevol: add dm uuid suffixes to hidden lvs

to indicate they are private lvm devs

5 years agolvconvert: cachevol LV can have multiple segments
David Teigland [Wed, 18 Sep 2019 20:11:14 +0000 (15:11 -0500)]
lvconvert: cachevol LV can have multiple segments

5 years agospec: Move blkdeactivate to device-mapper
Marian Csontos [Fri, 20 Sep 2019 08:55:29 +0000 (10:55 +0200)]
spec: Move blkdeactivate to device-mapper

5 years agotests: check vdo
Zdenek Kabelac [Sat, 14 Sep 2019 07:50:18 +0000 (09:50 +0200)]
tests: check vdo

5 years agovdo: enhance activation with layer -vpool
Zdenek Kabelac [Fri, 13 Sep 2019 23:13:33 +0000 (01:13 +0200)]
vdo: enhance activation with layer -vpool

Enhance 'activation' experience for VDO pool to more closely match
what happens for thin-pools where we do use a 'fake' LV to keep pool
running even when no thinLVs are active. This gives user a choice
whether he want to keep thin-pool running (wihout possibly lenghty
activation/deactivation process)

As we do plan to support multple VDO LVs to be mapped into a single VDO,
we want to give user same experience and 'use-patter' as with thin-pools.

This patch gives option to activate VDO pool only without activating
VDO LV.

Also due to 'fake' layering LV we can protect usage of VDO pool from
command like 'mkfs' which do require exlusive access to the volume,
which is no longer possible.

Note: VDO pool contains 1024 initial sectors as 'empty' header - such
header is also exposed in layered LV (as read-only LV).
For blkid we are indentified as LV with UUID suffix - thus private DM
device of lvm2 - so we do not need to store any extra info in this
header space (aka zero is good enough).

5 years agothin: activate layer pool aas read-only LV
Zdenek Kabelac [Fri, 13 Sep 2019 23:08:14 +0000 (01:08 +0200)]
thin: activate layer pool aas read-only LV

When lvm2 is activating layered pool LV (to basically keep pool opened,
the other function used to be 'locking' be in sync with DM table)
use this LV in read-only mode - this prevents 'write' access into
data volume content of thin-pool.

Note: since EMPTY/unused thin-pool is created as 'public LV' for generic
use by any user who i.e. wish to maintain thin-pool and thins himself.
At this moment, thin-pool appears as writable LV.  As soon as the 1st.
thinLV is created, layer volume will appear is 'read-only' LV from this moment.

5 years agodevices: crypto skip
Zdenek Kabelac [Fri, 13 Sep 2019 11:22:07 +0000 (13:22 +0200)]
devices: crypto skip

Devices with UUID signature CRYPT-SUBDEV are internal crypto devices.

5 years agotests: pool conversion
Zdenek Kabelac [Tue, 17 Sep 2019 09:27:13 +0000 (11:27 +0200)]
tests: pool conversion

Test conversion of cached LV.

5 years agolvconvert: improve validation thin and cache pool conversion
Zdenek Kabelac [Fri, 6 Sep 2019 16:09:40 +0000 (18:09 +0200)]
lvconvert: improve validation thin and cache pool conversion

Limit convertible LVs to thin-pool and cache-pools.
Also fix return code on  interal error path to return ECMD_FAILED.

5 years agoRevert "tests: drop unnecessary pid from LVMTEST prefix"
David Teigland [Mon, 16 Sep 2019 18:01:50 +0000 (13:01 -0500)]
Revert "tests: drop unnecessary pid from LVMTEST prefix"

This reverts commit 51c105702f24d64f1adc25a692ef37e20878cec5.

it seems the test system still needs this for some reason

5 years agoRevert "lvmlockd: use commonly used define NOTIFYDBUS_SUPPORT"
David Teigland [Mon, 16 Sep 2019 16:42:23 +0000 (11:42 -0500)]
Revert "lvmlockd: use commonly used define NOTIFYDBUS_SUPPORT"

This reverts commit 71af650760c2b75b3c267277f47d8ba235421300.

It disabled sd_notify() which broke 'systemctl start lvmlockd'.

5 years agotests: drop unnecessary pid from LVMTEST prefix
David Teigland [Thu, 12 Sep 2019 19:52:13 +0000 (14:52 -0500)]
tests: drop unnecessary pid from LVMTEST prefix

5 years agotests: don't change real test output
David Teigland [Thu, 12 Sep 2019 19:45:13 +0000 (14:45 -0500)]
tests: don't change real test output

5 years agotests: metadata-zero-space more debugging
David Teigland [Thu, 12 Sep 2019 19:38:20 +0000 (14:38 -0500)]
tests: metadata-zero-space more debugging

5 years agotests: unnecessary braces causes test failures
David Teigland [Thu, 12 Sep 2019 17:55:00 +0000 (12:55 -0500)]
tests: unnecessary braces causes test failures

5 years agotests: skip some without wipefs
David Teigland [Thu, 12 Sep 2019 16:23:30 +0000 (11:23 -0500)]
tests: skip some without wipefs

5 years agotests: more debug in metadata-zero-space
David Teigland [Thu, 12 Sep 2019 16:19:44 +0000 (11:19 -0500)]
tests: more debug in metadata-zero-space

5 years agotests: use standard md devices
David Teigland [Wed, 11 Sep 2019 18:26:41 +0000 (13:26 -0500)]
tests: use standard md devices

5 years agotests: metadata-zero-space add info for debugging
David Teigland [Wed, 11 Sep 2019 19:20:59 +0000 (14:20 -0500)]
tests: metadata-zero-space add info for debugging

5 years agotests: skip without xxd
David Teigland [Wed, 11 Sep 2019 18:59:16 +0000 (13:59 -0500)]
tests: skip without xxd

5 years agotests: open-file-limit skip without prlimit
David Teigland [Wed, 11 Sep 2019 18:55:47 +0000 (13:55 -0500)]
tests: open-file-limit skip without prlimit

5 years agotests: allow-mixed-block-sizes skip with older losetup
David Teigland [Wed, 11 Sep 2019 18:52:51 +0000 (13:52 -0500)]
tests: allow-mixed-block-sizes skip with older losetup

5 years agotests: cache-single tests require version 1 10
David Teigland [Wed, 11 Sep 2019 18:48:03 +0000 (13:48 -0500)]
tests: cache-single tests require version 1 10

5 years agopvscan: allow use of noudevsync option
David Teigland [Tue, 10 Sep 2019 14:47:33 +0000 (09:47 -0500)]
pvscan: allow use of noudevsync option

When pvscan is used to activate a VG via an
asynchronous service (i.e. lvm2-pvscan), there
is no requirement that the command wait for
udev to create device nodes before returning.

It's possible that waiting for udev is slow
enough to cause the service running the command
to time out.  So, allow the --noudevsync option
to be given to pvscan to skip waiting for udev.

(This commit is not changing the lvm2-pvscan
service itself to use --noudevsync.)

Still unknown is whether there are any complex
LV activation cases in which lvm itself requires
access to a device node, in which case the udev
wait could be needed by lvm itself.

(When running an activation command directly
from the command line, it's generally expected
that the activated LVs are ready to use when
the command is finished, so lvm waits for
udev to finish creating the dev nodes.)

5 years agolvchange: add --resync help/manual text relative to 'R' attribute
Heinz Mauelshagen [Fri, 6 Sep 2019 12:08:29 +0000 (14:08 +0200)]
lvchange: add --resync help/manual text relative to 'R' attribute

Add information that --resync clears the 'R' attribute
on not initially synchronized mirror/RAID LVs.

Related: 1708299

5 years agotests: metadata-bad-text.sh with lvmlockd
David Teigland [Thu, 5 Sep 2019 20:27:52 +0000 (15:27 -0500)]
tests: metadata-bad-text.sh with lvmlockd

skip part of test that doesn't apply

5 years agobcache: change log level for prefetch message
David Teigland [Tue, 3 Sep 2019 17:02:09 +0000 (12:02 -0500)]
bcache: change log level for prefetch message

The "new new blocks" message was printed as an error
but it's not an error condition.

5 years agopvscan: avoid full scan for activation
David Teigland [Mon, 26 Aug 2019 22:07:18 +0000 (17:07 -0500)]
pvscan: avoid full scan for activation

When an online PV completed a VG, the standard
activation functions were used to activate the VG.
These functions use a full scan of all devs.
When many pvscans are run during startup and need
to activate many VGs, scanning all devs from all
the pvscans can take a long time.

Optimize VG activation in pvscan to scan only the
devs in the VG being activated.  This makes use of
the online file info that was used to determine
the VG was complete.

The downside of this approach is that pvscan activation
will not detect duplicate PVs and block activation,
where a normal activation command (which scans all
devices) would.

5 years agovgextend: check missing device during block size check
David Teigland [Tue, 3 Sep 2019 15:07:56 +0000 (10:07 -0500)]
vgextend: check missing device during block size check

Checking the block size when a device is missing could
trigger a segfault.

5 years agofix segfault for invalid characters in vg name
David Teigland [Thu, 29 Aug 2019 16:35:46 +0000 (11:35 -0500)]
fix segfault for invalid characters in vg name

Fixes a regression from commit ba7ff96faff0
"improve reading and repairing vg metadata"

where the error path for a vg name with invalid
charaters was missing an error flag, which led
to the caller not recognizing an error occured.
Previously, an error flag was hidden in the old
_vg_make_handle function.

5 years agohints: check for malloc failure
David Teigland [Wed, 28 Aug 2019 17:39:50 +0000 (12:39 -0500)]
hints: check for malloc failure

5 years agohints: fix copy of filter
David Teigland [Wed, 28 Aug 2019 17:33:04 +0000 (12:33 -0500)]
hints: fix copy of filter

Only the first entry of the filter array was being
included in the copy of the filter, rather than the
entire thing.  The result is that hints would not be
refreshed if the filter was changed but the first
entry was unchanged.

5 years agofix duplicate pv size check
David Teigland [Tue, 27 Aug 2019 20:40:24 +0000 (15:40 -0500)]
fix duplicate pv size check

Fixes a segfault in the recent commit e01fddc57:
"improve duplicate pv handling for md components"

While choosing between duplicates, the info struct is
not always valid; it may have been dropped already.

Remove the code that was still using the info struct for
size comparisons.  The size comparisons were a bogus check
anyway because it was just preferring the dev that had
already been chosen, it wasn't actually comparing the
dev size to the PV size.  It would be good to use a
dev/PV size comparison in the duplicate handling code, but
the PV size is not available until after vg_read, not
from the scan.

5 years agoFix converting dbus.UInt types to string
Vojtech Trefny [Mon, 26 Aug 2019 12:35:51 +0000 (14:35 +0200)]
Fix converting dbus.UInt types to string

With Python 3.8 converting these directly to string using str()
no longer works, we need to convert these to integer first.

On Python 3.8:

>>> str(dbus.Int64(1))
'dbus.Int64(1)'

On Python 3.7 (and older):
>>> str(dbus.UInt64(1))
'1'

This is probably related to removing __str__ function from method
from int (dbus.UInt is subclass of int) which happened in 3.8, see
https://docs.python.org/3.8/whatsnew/3.8.html

Signed-off-by: Vojtech Trefny <vtrefny@redhat.com>
5 years agoactivation: use cmd pending mem for pending_delete
Zdenek Kabelac [Tue, 27 Aug 2019 10:18:47 +0000 (12:18 +0200)]
activation: use cmd pending mem for pending_delete

Since we need to preserve allocated strings across 2 separate
activation calls of '_tree_action()' we need to use other mem
pool them dm->mem - but since cmd->mem is released between
individual lvm2 locking calls, we rather introduce a new separate
mem pool just for pending deletes with easy to see life-span.
(not using 'libmem' as it would basicaly keep allocations over
the whole lifetime of clvmd)

This patch is fixing previous commmit where the memory was
improperly used after pool release.

5 years agoconfigure: continue build if prlimit is missing
Zdenek Kabelac [Mon, 26 Aug 2019 15:34:45 +0000 (17:34 +0200)]
configure: continue build if prlimit is missing

5 years agoconfigure: check for prlimit
Zdenek Kabelac [Mon, 26 Aug 2019 15:19:16 +0000 (17:19 +0200)]
configure: check for prlimit

Update configure and make code compilable if prlimit() is not present.
Since the code is suspicious do not cope yet with it's replacement
with  set/getrlimit().

5 years agodmsetup: missed trailing newline
Zdenek Kabelac [Mon, 26 Aug 2019 13:37:57 +0000 (15:37 +0200)]
dmsetup: missed trailing newline

5 years agolv_manip: add synchronizations
Zdenek Kabelac [Mon, 26 Aug 2019 11:28:17 +0000 (13:28 +0200)]
lv_manip: add synchronizations

New udev in rawhide seems to be 'dropping' udev rule operations for devices
that are no longer existing - while this is 'probably' a bug - it's
revealing moments in lvm2 that likely should not run in a single
transaction and we should wait for a cookie before submitting more work.

TODO: it seem more 'error' paths should always include synchronization
before starting deactivating 'just activated' devices.
We should probably figure out some 'automatic' solution for this instead
of placing sync_local_dev_name() all over the place...

5 years agocache: improve vgremove loop
Zdenek Kabelac [Mon, 26 Aug 2019 11:28:00 +0000 (13:28 +0200)]
cache: improve vgremove loop

Support internal removal of 'cache origin' volume - which we
do not normally expose to a user - however internal processing
loops may hit this condition (depending on order of list LVs).

So when this operation is internally requested - we automatically
try to remove it's 'holding' LV (cache LV) - which will also
remove the origin.

5 years agosnapshot: always activate
Zdenek Kabelac [Mon, 26 Aug 2019 13:13:55 +0000 (15:13 +0200)]
snapshot: always activate

Drop the 'cluster-only' optimization so we do resume ALL device
before we try to wait on cookie before 'removal' operation.

It's more correct order of operation - alhtough possibly slightly
less efficient - but until we have correct list of operations
'in-progress' we can't do anything better.

5 years agoactivation: extend handling of pending_delete
Zdenek Kabelac [Fri, 23 Aug 2019 11:08:34 +0000 (13:08 +0200)]
activation: extend handling of pending_delete

With previous patch 30a98e4d6710a543692d40d11428ae4baea11b7b we
started to put devices one pending_delete list instead
of directly scheduling their removal.

However we have operations like 'snapshot merge' where we are
resuming device tree in 2 subsequent activation calls - so
1st such call will still have suspened devices and no chance
to push 'remove' ioctl.

Since we curently cannot easily solve this by doing just single
activation call (which would be preferred solution) - we introduce
a preservation of pending_delete via command structure and
then restore it on next activation call.

This way we keep to remove devices later - although it might be
not the best moment - this may need futher tunning.

Also we don't keep the list of operation in 1 trasaction
(unless we do verify udev symlinks) - this could probably
also make it more correct in terms of which 'remove' can
be combined we already running 'resume'.

5 years agodmsetup: debug print
Zdenek Kabelac [Fri, 16 Aug 2019 21:49:38 +0000 (23:49 +0200)]
dmsetup: debug print

Udev debugging is a bit tricky, so to more easily pair cookie ID,
which is the lowest 16 bit - print cookie as hexa number.
This simplify pairing of processed cookies while the 'higher bit flags'
are changed for the same cookie.

5 years agoactivation: add synchronization point
Zdenek Kabelac [Fri, 16 Aug 2019 21:49:59 +0000 (23:49 +0200)]
activation: add synchronization point

Resuming of 'error' table entry followed with it's dirrect removal
is now troublesame with latest udev as it may skip processing of
udev rules for already 'dropped' device nodes.

As we cannot 'synchronize' with udev while we know we have devices
in suspended state - rework 'cleanup' so it collects nodes
for removal into pending_delete list and process the list with
synchronization once we are without any suspended nodes.

5 years agopvmove: add missing synchronization
Zdenek Kabelac [Tue, 20 Aug 2019 10:23:08 +0000 (12:23 +0200)]
pvmove: add missing synchronization

Between 'resume' and 'remove' we need to wait for udev to synchronize,
otherwise udev may 'skip' resume event processing if the udev node
is already gone.

5 years agopvmove: correcting read_ahead setting
Zdenek Kabelac [Tue, 20 Aug 2019 10:30:25 +0000 (12:30 +0200)]
pvmove: correcting read_ahead setting

When pvmove is finished, we do a tricky operation since we try to
resume multiple different device that were all joined into 1 big tree.

Currently we use the infromation from existing live DM table,
where we can get list of all holders of pvmove device.
We look for these nodes (by uuid) in new metadata, and we do now a full
regular device add into dm tree structure.  All devices should be
already PRELOAD with correct table before entering suspend state,
however for correctly working readahead we need to put correct info
also into RESUME tree.  Since table are preloaded, the same table
is skip and resume, but correct read ahead is now set.

5 years agoman lvmthin: remove nonexistent topic
David Teigland [Mon, 19 Aug 2019 19:06:32 +0000 (14:06 -0500)]
man lvmthin: remove nonexistent topic

5 years agoconfigure: Fix setting of CLDFLAGS default
Marian Csontos [Mon, 19 Aug 2019 12:54:43 +0000 (14:54 +0200)]
configure: Fix setting of CLDFLAGS default

5 years agoconfigure: Fix the default in help string
Marian Csontos [Wed, 31 Jul 2019 14:24:18 +0000 (16:24 +0200)]
configure: Fix the default in help string

5 years agopvscan: disable sleeping and retrying for udev
David Teigland [Fri, 16 Aug 2019 19:35:17 +0000 (14:35 -0500)]
pvscan: disable sleeping and retrying for udev

When systemd is running pvscans, udev may not be
entirely initialized, so the pvscan should not
sleep and retry waiting for udev info.

5 years agobcache: increase max allowed bcache size
David Teigland [Fri, 16 Aug 2019 18:35:09 +0000 (13:35 -0500)]
bcache: increase max allowed bcache size

from 128MB to 512MB (the default remains 8MB)

5 years agotests: duplicate-pvs-md
David Teigland [Fri, 16 Aug 2019 18:22:58 +0000 (13:22 -0500)]
tests: duplicate-pvs-md

Testing duplicate PV handling for various md device setups/states.

5 years agopvscan cache: use lvmcache_label_scan
David Teigland [Thu, 1 Aug 2019 20:07:59 +0000 (15:07 -0500)]
pvscan cache: use lvmcache_label_scan

instead of the lower level label_scan.  The lvmcache wrapper
around label_scan checks for and eliminates more duplicate devs
and md components.

5 years agoimprove duplicate pv handling for md components
David Teigland [Thu, 1 Aug 2019 20:04:10 +0000 (15:04 -0500)]
improve duplicate pv handling for md components

Eliminate md components at the start so they don't
interfere with actual duplicates, and don't need
to be removed later.  This also allows for choosing
no copy of a PVID if they all happen to be md
components.

5 years agolvmcache: use devl list helper
David Teigland [Thu, 1 Aug 2019 18:58:14 +0000 (13:58 -0500)]
lvmcache: use devl list helper

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