]> sourceware.org Git - lvm2.git/log
lvm2.git
6 years agometadata: improve write and commit code
David Teigland [Thu, 30 Aug 2018 15:44:53 +0000 (10:44 -0500)]
metadata: improve write and commit code

The vg_write/vg_commit code was imprecise, uncommented, and
hard to understand.  Rewrite it with clearer, cleaner code,
extensive comments, descriptions of how it works, and add
more info in debugging output.

The minor changes in behavior are to things that were
either incorrect or probably unintended:

- vg_write/vg_commit no longer check that the current vgname at
  the start of the text metadata matches the vgname being written.
  This has already been done at least twice by the time they are
  called, and repeating it again against the same cached data has
  no use.

- A fragment of old removed code had been left behind that checked
  if the old unused alignment policy would wrap.  It was still
  being checked to decide if the metadata area was full, which
  could possibly cause an incorrect full metadata failure.

- vg_remove now clears both the raw_locns in the mda_header that
  point to committed metadata (raw_locn slot 0) and precommitted
  metadata (raw_locn slot 1).  Previously it fully cleared the
  committed slot, and would only clear the offset field in the
  precommitted slot if it saw a problem with the metadata in the
  vg being removed.

- read_metadata_location_summary was wrongly comparing the number
  of wrapped bytes with an offset to report an error about the
  metadata being too large.  This wrong check is removed, it
  could have resulted in erroneous errors.

6 years agotests: bump dm-raid version to 1.14.0
Heinz Mauelshagen [Tue, 11 Sep 2018 13:58:43 +0000 (15:58 +0200)]
tests: bump dm-raid version to 1.14.0

Commit 989626926c98cd00f0236c4fcac883107d76899d
introduced 2 new tests
lvconvert-raid-takeover-linear_to_raid4.sh and
lvconvert-raid-takeover-raid4_to_linear.sh
which involve raid reshaping.

Bump the checked dm-raid target version to 1.14.0
which has reshape kernel fixes to avoid test suite
runs to hang.

6 years agotests: adjust target version to enable reshape tests
Heinz Mauelshagen [Tue, 11 Sep 2018 13:39:31 +0000 (15:39 +0200)]
tests: adjust target version to enable reshape tests

Bump target version to 1.14.0 which contains fixes
for reshape deadlock/corruption to allow tests to
run once the respective fixes show up in kernels.

Remove now superfluous multi-core checks.

Resolves: rhbz1501145
Related: rhbz1514539
Related: rhbz1586123
Related: rhbz1613039

6 years agoMerge branch 'master' of git://sourceware.org/git/lvm2
Joe Thornber [Tue, 11 Sep 2018 12:19:08 +0000 (13:19 +0100)]
Merge branch 'master' of git://sourceware.org/git/lvm2

6 years ago[bcache] Remove unused 'hash' field from blocks.
Joe Thornber [Tue, 11 Sep 2018 12:17:29 +0000 (13:17 +0100)]
[bcache] Remove unused 'hash' field from blocks.

We use a radix tree these days rather than a hash table.

6 years ago[radix-tree] alternative radix-tree implementation.
Joe Thornber [Tue, 11 Sep 2018 10:11:35 +0000 (11:11 +0100)]
[radix-tree] alternative radix-tree implementation.

Sacrifices performance for simplicity, meant only for verification of
the real adaptive implementation.

6 years agotests: remove lvmetad variation
David Teigland [Mon, 10 Sep 2018 19:26:57 +0000 (14:26 -0500)]
tests: remove lvmetad variation

6 years agotests: drop lvmetad parts of system_id test
David Teigland [Mon, 10 Sep 2018 19:08:27 +0000 (14:08 -0500)]
tests: drop lvmetad parts of system_id test

6 years agotests: drop lvmetad bits
David Teigland [Mon, 10 Sep 2018 16:10:55 +0000 (11:10 -0500)]
tests: drop lvmetad bits

6 years agolvconvert: allow raid4 -> linear conversion request
Heinz Mauelshagen [Mon, 10 Sep 2018 16:36:52 +0000 (18:36 +0200)]
lvconvert: allow raid4 -> linear conversion request

Allow "lvconvert --type linear RaidLV" on a raid4 LV
providing convenient interim steps to convert to linear.

Add respective new test
   lvconvert-raid-takeover-raid4_to_linear.sh
and
   lvconvert-raid-takeover-linear_to_raid4.sh
for linear to raid4 once on it.

6 years agolvconvert: fix interim segtype regression on raid6 conversions
Heinz Mauelshagen [Fri, 7 Sep 2018 11:48:13 +0000 (13:48 +0200)]
lvconvert: fix interim segtype regression on raid6 conversions

When converting from striped/raid0/raid0_meta
to raid6 with > 2 stripes, allow possible
direct conversion (to raid6_n_6).

In case of 2 stripes, first convert to raid5_n to restripe
to at least 3 data stripes (the raid6 minimum in lvm2) in
a second conversion before finally converting to raid6_n_6.

As before, raid6_n_6 then can be converted
to any other raid6 layout.

Enhance lvconvert-raid-takeover.sh to test the
2 stripes conversions to raid6.

Resolves: rhbz1624038

6 years agolvconvert: avoid superfluous interim raid type
Heinz Mauelshagen [Fri, 31 Aug 2018 17:03:52 +0000 (19:03 +0200)]
lvconvert: avoid superfluous interim raid type

When converting striped/raid0*/raid6_n_6 <-> raid4,
avoid superfluous interim raid5_n layout.

Related: rhbz1447809

6 years agotest: comment fixes
Heinz Mauelshagen [Fri, 31 Aug 2018 13:07:24 +0000 (15:07 +0200)]
test: comment fixes

Fix comments in

   test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
   test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
   test/shell/lvconvert-raid-reshape-stripes-load.sh

6 years agotests: add scan-lvs
David Teigland [Thu, 30 Aug 2018 14:54:02 +0000 (09:54 -0500)]
tests: add scan-lvs

6 years agofilter: add config setting to skip scanning LVs
David Teigland [Wed, 29 Aug 2018 18:14:18 +0000 (13:14 -0500)]
filter: add config setting to skip scanning LVs

devices/scan_lvs (default 1) determines whether lvm
will scan LVs for layered PVs.  The lvm behavior has
always been to scan LVs, but it's rare for LVs to have
layered PVs, and much more common for there to be many
LVs that substantially slow down scanning with no benefit.

This is implemented in the usable filter, and has the
same effect as listing all LVs in the global_filter.

6 years agoconfigure: fix LVMCONFIG_PATH assignment
Peter Rajnoha [Thu, 30 Aug 2018 10:59:59 +0000 (12:59 +0200)]
configure: fix LVMCONFIG_PATH assignment

6 years agoscripts: lvm2-activation-generator: also log possible execv error
Peter Rajnoha [Thu, 30 Aug 2018 10:48:50 +0000 (12:48 +0200)]
scripts: lvm2-activation-generator: also log possible execv error

6 years agoscripts: lvm2-activation-generator: add prefix for all kmsg messages
Peter Rajnoha [Thu, 30 Aug 2018 10:46:41 +0000 (12:46 +0200)]
scripts: lvm2-activation-generator: add prefix for all kmsg messages

Add "lvm2-activation-generator: " prefix for all kmsg messages written by
lvm2-activation-generator so we can identify the message in global system log.

6 years agoscripts: add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service
Peter Rajnoha [Thu, 30 Aug 2018 10:35:58 +0000 (12:35 +0200)]
scripts: add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service

We need to have Ceph RBD devices mapped first before use in a stack
where LVM is on top so make sure rbdmap.service is called before
generated lvm2-activation-net.service.

On shutdown, we need to stop blk-availability first before we stop the
rbdmap.service.

Resolves: rhbz1623479

6 years agobcache: reduce MAX_IO to 256
David Teigland [Fri, 24 Aug 2018 19:46:51 +0000 (14:46 -0500)]
bcache: reduce MAX_IO to 256

This is the number of concurrent async io requests that
the scan layer will submit to the bcache layer.  There
will be an open fd for each of these, so it is best to
keep this well below the default limit for max open files
(1024), otherwise lvm may get EMFILE from open(2) when
there are around 1024 devices to scan on the system.

6 years agotest: add striped -> raid0 test script
Heinz Mauelshagen [Wed, 22 Aug 2018 15:11:03 +0000 (17:11 +0200)]
test: add striped -> raid0 test script

6 years agolvconvert: fix conversion attempts to linear
Heinz Mauelshagen [Wed, 22 Aug 2018 14:39:36 +0000 (16:39 +0200)]
lvconvert: fix conversion attempts to linear

"lvconvert --type linear RaidLV" on striped and raid4/5/6/10
have to provide the convenient interim layouts.  Fix involves
a cleanup to the convenience type function.

As a result of testing, add missing sync waits to
lvconvert-raid-reshape-linear_to_raid6-single-type.sh.

Resolves: rhbz1447809

6 years agoconfig: improve use_blkid_wiping
David Teigland [Tue, 21 Aug 2018 17:24:35 +0000 (12:24 -0500)]
config: improve use_blkid_wiping

mention that libblkid is used to both detect
and erase signatures.

6 years agolvconvert: fix regression preventing direct striped conversion
Heinz Mauelshagen [Tue, 21 Aug 2018 15:12:33 +0000 (17:12 +0200)]
lvconvert: fix regression preventing direct striped conversion

Conversion to striped from raid0/raid0_meta is directly possible.

Fix a regression setting superfluous interim raid5_n conversion type
introduced by commit bd7cdd0b09ba123b064937fddde08daacbed7dab.

Add new test script lvconvert-raid0-striped.sh.

Resolves: rhbz1608067

6 years agoradix-tree: Fix bug in remove_prefix()
Joe Thornber [Mon, 20 Aug 2018 14:23:40 +0000 (15:23 +0100)]
radix-tree: Fix bug in remove_prefix()

Accidental decrement of the nr entries when a n256 didn't have the
entry in the first place.

6 years agotests: check policy mq can be used with format2
Zdenek Kabelac [Tue, 7 Aug 2018 13:20:31 +0000 (15:20 +0200)]
tests: check policy mq can be used with format2

6 years agotests: splitmirror for mirror type
Zdenek Kabelac [Tue, 7 Aug 2018 08:34:59 +0000 (10:34 +0200)]
tests: splitmirror for mirror type

6 years agomirror: fix splitmirrors for mirror type
Zdenek Kabelac [Tue, 7 Aug 2018 08:34:17 +0000 (10:34 +0200)]
mirror: fix splitmirrors for mirror type

With improved mirror activation code --splitmirror issue poppedup
since there was missing proper preload code and deactivation
for splitted mirror leg.

6 years agocache: drop metadata_format validation
Zdenek Kabelac [Tue, 7 Aug 2018 08:33:19 +0000 (10:33 +0200)]
cache: drop metadata_format validation

Allow to use any combination of cache metadata format for policy.

6 years agomirrors: fix read_only_volume_list
David Teigland [Thu, 2 Aug 2018 16:26:59 +0000 (11:26 -0500)]
mirrors: fix read_only_volume_list

If a mirror LV is listed in read_only_volume_list, it would
still be activated rw.  The activation would initially be
readonly, but the monitoring function would immediately
change it to rw.  This was a regression from commit

fade45b1d14c mirror: improve table update

The monitoring function needs to copy the read_only setting
into the new set of mirror activation options it uses.

6 years agovgcreate: close exclusive fd after pvcreate
David Teigland [Wed, 1 Aug 2018 15:26:28 +0000 (10:26 -0500)]
vgcreate: close exclusive fd after pvcreate

When vgcreate does an automatic pvcreate, it opens the
dev with O_EXCL to ensure no other subsystem is using
the device.  This exclusive fd remained in bcache and
prevented activation parts of lvm from using the dev.

This appeared with vgcreate of a sanlock VG because of
the unique combination where the dev is not yet a PV,
so pvcreate is needed, and the vgcreate also creates
and activates an internal LV for sanlock.

Fix this by closing the exclusive fd after it's used
by pvcreate so that it won't interfere with other
bits of lvm that may try to use the device.

6 years agoAdd BSD 2-Clause License
Marian Csontos [Fri, 27 Jul 2018 15:08:19 +0000 (17:08 +0200)]
Add BSD 2-Clause License

This is required by C++ test harness.

6 years agotest: Check flavour is used and exists
Marian Csontos [Thu, 26 Jul 2018 13:01:50 +0000 (15:01 +0200)]
test: Check flavour is used and exists

6 years agotest: Remove excessive comma resulting in empty flavour
Marian Csontos [Thu, 26 Jul 2018 12:56:08 +0000 (14:56 +0200)]
test: Remove excessive comma resulting in empty flavour

6 years agolvconvert: reject conversions on raid1 split trackchanges LVs
Heinz Mauelshagen [Wed, 25 Jul 2018 23:47:39 +0000 (01:47 +0200)]
lvconvert: reject conversions on raid1 split trackchanges LVs

Prohibit, because the tracking can't continue and
further conversions may fail with bogus error messages.

Resolves: rhbz1579072

6 years agolvconvert: reject conversions on raid1 split trackchanges SubLVs
Heinz Mauelshagen [Wed, 25 Jul 2018 23:00:11 +0000 (01:00 +0200)]
lvconvert: reject conversions on raid1 split trackchanges SubLVs

Prohibit conversions of raid1 split trackchanges SubLVs
because they will fail to get merged back into the RaidLV.

Resolves: rhbz1579438

6 years agotest: new lvcreate-raid1-error-read.sh
Heinz Mauelshagen [Tue, 24 Jul 2018 18:38:22 +0000 (20:38 +0200)]
test: new lvcreate-raid1-error-read.sh

Test for MD RAID kernel bug in read_balance() preventing
reads of failed sectors to get rescheduled to another leg.

6 years agospec: Fix conditional
Marian Csontos [Tue, 24 Jul 2018 14:22:23 +0000 (16:22 +0200)]
spec: Fix conditional

6 years agobuild: Update configure
Marian Csontos [Tue, 24 Jul 2018 14:17:42 +0000 (16:17 +0200)]
build: Update configure

6 years agospec: Add vdo files
Marian Csontos [Tue, 24 Jul 2018 13:37:15 +0000 (15:37 +0200)]
spec: Add vdo files

6 years agobuild: Remove lvmetad leftovers
Marian Csontos [Tue, 24 Jul 2018 13:02:32 +0000 (15:02 +0200)]
build: Remove lvmetad leftovers

6 years agospec: Remove unsupported config options
Marian Csontos [Tue, 24 Jul 2018 12:57:52 +0000 (14:57 +0200)]
spec: Remove unsupported config options

6 years agospec: Remove python bindings
Marian Csontos [Tue, 24 Jul 2018 12:55:32 +0000 (14:55 +0200)]
spec: Remove python bindings

6 years agospec: Remove lvmetad
Marian Csontos [Tue, 24 Jul 2018 12:50:52 +0000 (14:50 +0200)]
spec: Remove lvmetad

6 years agolvconvert: reject conversions of LVs under snapshot
Heinz Mauelshagen [Mon, 23 Jul 2018 17:20:18 +0000 (19:20 +0200)]
lvconvert: reject conversions of LVs under snapshot

Conversions of LVs under snapshot to thinpool or cachepool
correctly fail but leave them inactive and provide cryptic
error messages like 'Internal error: #LVs (10) != #visible
LVs (2) + #snapshots (1) + #internal LVs (5) in VG VG'.

Reject and provide better error message.

Resolves: rhbz1514146

6 years agolvconvert: improve text about splitmirrors
David Teigland [Mon, 23 Jul 2018 17:28:48 +0000 (12:28 -0500)]
lvconvert: improve text about splitmirrors

in messages and man page.

6 years agolvconvert: restrict command matching for no option variant
David Teigland [Mon, 23 Jul 2018 16:08:12 +0000 (11:08 -0500)]
lvconvert: restrict command matching for no option variant

The 'lvconvert LV' command def has caused multiple problems
for command matching because it matches the required options
of any lvconvert command.  Any lvconvert with incorrect options
ends up matching 'lvconvert LV', which then produces an error
about incorrect options being used for 'lvconvert LV'.  This
prevents suggestions from nearest-command partial command matches.

Add a special case for 'lvconvert LV' so that it won't be used
as a partial match for a command that has options specified.

6 years agotests: remove lvmetad tests
David Teigland [Tue, 10 Jul 2018 19:40:48 +0000 (14:40 -0500)]
tests: remove lvmetad tests

6 years agoRemove lvmetad
David Teigland [Tue, 10 Jul 2018 18:39:29 +0000 (13:39 -0500)]
Remove lvmetad

Native disk scanning is now both reduced and
async/parallel, which makes it comparable in
performance (and often faster) when compared
to lvm using lvmetad.

Autoactivation now uses local temp files to record
online PVs, and no longer requires lvmetad.

There should be no apparent command-level change
in behavior.

6 years agotests: fix mkdir pvs_online
David Teigland [Tue, 10 Jul 2018 19:19:46 +0000 (14:19 -0500)]
tests: fix mkdir pvs_online

6 years agotests: autoactivation tests for use without lvmetad
David Teigland [Tue, 10 Jul 2018 14:58:22 +0000 (09:58 -0500)]
tests: autoactivation tests for use without lvmetad

Adjust a few lvmetad pvscan/autoactivation tests to be
used without lvmetad, and add a test to cover some cases
that have not been tested before.

6 years agopvscan: autoactivate without lvmetad
David Teigland [Thu, 28 Jun 2018 19:48:03 +0000 (14:48 -0500)]
pvscan: autoactivate without lvmetad

When lvmetad is not used, use temporary files to record
which PVs have appeared.  Use these temp files to determine
when a VG is complete, to trigger autoactivation.

This change allows us to remove lvmetad while keeping the
same autoactivation behavior that lvmetad provides.

The temp files are created in /run/lvm/pvs_online/ and are
named for the PVID of the PV.  The files contain the
major:minor of the device the PV was read from.

e.g. if VG foo has dev1 and dev2, then:

. pvscan --cache -aay dev1
  reads vg metadata from dev1
  creates /run/lvm/pvs_online/<pvid-of-dev1>
  checks if all vg->pvs are online: no

. pvscan --cache -aay dev2
  reads vg metadata from dev2
  creates /run/lvm/pvs_online/<pvid-of-dev2>
  checks if all vg->pvs are online: yes
  autoactivates vg

A 'pvscan --cache dev' (without -aay) still records that
dev is online.

A 'pvscan --cache --major X --minor Y' after a device is
gone will remove the temp file for it.

A 'pvscan --cache [-aay]' (no devs) resets the state of
temp files by removing them all, then scanning all devs
and creating temp files for PVs that are found.

If no online files exist, the first pvscan --cache scans
all devs and creates temp files for any PVs found.

The scope of the temp files is only pvscan, and they are only
used for pvscan-based autoactivation.  No other commands are
concerned with or aware of these temp files.  When lvm creates
or removes PVs, no attempt is made to update the temp files.

6 years agotests: initial vdo tests
Zdenek Kabelac [Sun, 24 Jun 2018 18:06:59 +0000 (20:06 +0200)]
tests: initial vdo tests

Basic functionality of lvcreate, lvchange.

6 years agodmeventd: lvm vdo support
Zdenek Kabelac [Mon, 9 Jul 2018 09:43:12 +0000 (11:43 +0200)]
dmeventd: lvm vdo support

6 years agovgchange: vdo support
Zdenek Kabelac [Sun, 1 Jul 2018 10:03:23 +0000 (12:03 +0200)]
vgchange: vdo support

Support vgchange usage with VDO segtype.
Also changing extent size need small update for vdo virtual extent.

TODO: API needs enhancements so it's not about adding ifs() everywhere.

6 years agolvconvert: support to convert lv into vdopool
Zdenek Kabelac [Sat, 30 Jun 2018 21:38:49 +0000 (23:38 +0200)]
lvconvert: support to convert lv into vdopool

Support:

lvconvert --type vdo-pool  vg/lv

lvconvert --vdopool  vg/lv   --virtualsize 10G

6 years agolvchange: vdo support compression deduplication change
Zdenek Kabelac [Mon, 2 Jul 2018 08:51:45 +0000 (10:51 +0200)]
lvchange: vdo support compression deduplication change

Add basic support for changing compression and deduplication state
of a VDO pool volume.

Allowing to access it also via top-level VDO volume.

6 years agolvcreate: vdo support
Zdenek Kabelac [Fri, 29 Jun 2018 11:16:08 +0000 (13:16 +0200)]
lvcreate: vdo support

Supports basic:  'lvcreate --vdo -LXXXG -VYYYG vg/vdoname -n lvname'
Allows to create basic VDO pool volume and virtual VDO volume.

6 years agolvresize: vdo support
Zdenek Kabelac [Mon, 2 Jul 2018 08:54:56 +0000 (10:54 +0200)]
lvresize: vdo support

Unsupported ATM.

Wait till VDO kernel target starts to use updated resize sequence,
LOAD, SUSPEND, RESUME.

6 years agoargs: new options for vdo segment
Zdenek Kabelac [Fri, 29 Jun 2018 09:31:08 +0000 (11:31 +0200)]
args: new options for vdo segment

Introduce new options usable with commands supporting VDO:
 --compression, --deduplication, --vdo, --vdopool

6 years agotoollib: support new command rules queries
Zdenek Kabelac [Mon, 2 Jul 2018 08:50:41 +0000 (10:50 +0200)]
toollib: support new command rules queries

Add: LV_vdo, LV_vdopool, LV_vdopooldata

6 years agovdo: data percentage
Zdenek Kabelac [Wed, 4 Jul 2018 21:17:38 +0000 (23:17 +0200)]
vdo: data percentage

Display percentage of used virtual size of vdo-pool volume.

6 years agodisplay: basic vdo segment lvdisplay and lvs support
Zdenek Kabelac [Sun, 1 Jul 2018 13:58:01 +0000 (15:58 +0200)]
display: basic vdo segment lvdisplay and lvs support

Print some basic info about vdo segment.

'lvdisplay -m' ATM shows the most.
lvs  shows usage percentage.

6 years agodev_manager: add dev_manager_vdo_pool_status
Zdenek Kabelac [Fri, 29 Jun 2018 09:15:54 +0000 (11:15 +0200)]
dev_manager: add dev_manager_vdo_pool_status

6 years agolv_manip: layout and role support for vdo segment
Zdenek Kabelac [Fri, 29 Jun 2018 09:18:44 +0000 (11:18 +0200)]
lv_manip: layout and role support for vdo segment

6 years agocheck_lv_segment: internal vdo segment validation
Zdenek Kabelac [Fri, 29 Jun 2018 09:13:43 +0000 (11:13 +0200)]
check_lv_segment: internal vdo segment validation

Check if settings for vdo segment are correct.

6 years agovdo_manip: parsing status of VDO device
Zdenek Kabelac [Mon, 2 Jul 2018 15:20:30 +0000 (17:20 +0200)]
vdo_manip: parsing status of VDO device

6 years agovdo: support functions to map enums to string names
Zdenek Kabelac [Mon, 2 Jul 2018 19:58:18 +0000 (21:58 +0200)]
vdo: support functions to map enums to string names

Translate VDO enums to printable strings.

6 years agovdo: component activation of VDO data LV
Zdenek Kabelac [Tue, 3 Jul 2018 09:05:50 +0000 (11:05 +0200)]
vdo: component activation of VDO data LV

Allow component activation of VDO data LV.

6 years agovdo: with created names use vpool
Zdenek Kabelac [Tue, 3 Jul 2018 18:14:48 +0000 (20:14 +0200)]
vdo: with created names use vpool

When user create vdo-pool - use different automatic name.
So unlike with traditional LVs using  lvol0, lvol1
use vpool0, vpool1...

TODO: apply similar for thin-pool  & cache-pool...

6 years agovdo: introduce segment types and manip functions
Zdenek Kabelac [Fri, 29 Jun 2018 09:11:14 +0000 (11:11 +0200)]
vdo: introduce segment types and manip functions

Core functionality introducing lvm VDO support.

6 years agobuild: install VDO small allocation profile
Zdenek Kabelac [Tue, 3 Jul 2018 09:10:57 +0000 (11:10 +0200)]
build: install VDO small allocation profile

Profile shows all VDO configurables.

Usable with: lvcreate --metadataprofile vdo-small ...

6 years agodevice_mapper: basic support for vdo dm target
Zdenek Kabelac [Fri, 29 Jun 2018 09:08:51 +0000 (11:08 +0200)]
device_mapper: basic support for vdo dm target

6 years agolib: new vdo segment configurable options
Zdenek Kabelac [Fri, 29 Jun 2018 09:09:03 +0000 (11:09 +0200)]
lib: new vdo segment configurable options

Configurable for vdo segment with their default values.
Also specify their ranges with minimal and maximal values.

6 years agobuild: add vdo configuration option --with-vdo=
Zdenek Kabelac [Fri, 29 Jun 2018 11:38:18 +0000 (13:38 +0200)]
build: add vdo configuration option --with-vdo=

Checks whether VDO support is enabled.
Detects presence of 'vdoformat' tool which is required for to format VDO pool.

ATM build of VDO is NOT automatically enabled (None is default).
To enable build of LVM with VDO support use:

configure --with-vdo=internal

TODO: Maybe future version may switch to link some small VDO library for formating
(would require linking and package dependency).

6 years agoactivate: kvdo modprobe workaround
Zdenek Kabelac [Fri, 29 Jun 2018 09:02:24 +0000 (11:02 +0200)]
activate: kvdo modprobe workaround

To support autoloading of VDO dm target driver loading of 'kvdo'
kernel module is needed - ATM it's not using 'dm-vdo' name.
So to support this strange name - add temporarily solution to
autoload  kvdo kernel module in this case.

6 years agodmeventd: base vdo plugin
Zdenek Kabelac [Mon, 9 Jul 2018 09:41:26 +0000 (11:41 +0200)]
dmeventd: base vdo plugin

Introduce VDO plugin for monitoring VDO devices.

This plugin can be used also by other users, as plugin checks
for UUID prefix 'LVM-' and run  lvm actions only on those
devices.

Non LVM- device are only monitored and log warnings
when usage threshold reaches 80%.

6 years agobuild: not yet merged
Zdenek Kabelac [Mon, 9 Jul 2018 08:37:39 +0000 (10:37 +0200)]
build: not yet merged

status.c will get linked with VDO support.

6 years agotests: update vdo unit test to dm prefix
Zdenek Kabelac [Mon, 9 Jul 2018 08:05:06 +0000 (10:05 +0200)]
tests: update vdo unit test to dm prefix

Update prefix and reindent.

6 years agodevice_mapper: convert vdo to use dm_ prefix
Zdenek Kabelac [Mon, 9 Jul 2018 08:04:51 +0000 (10:04 +0200)]
device_mapper: convert vdo to use dm_ prefix

Keep using DM_/dm_ prefixes for device_mapper code.

6 years agobuild: unit test Makefile update
Zdenek Kabelac [Mon, 9 Jul 2018 08:05:19 +0000 (10:05 +0200)]
build: unit test Makefile update

Update makefile to link with more libs since now whole liblvm-internal.a
is linked-in and  this library has futher dependencies.

Avoid including deps for run-unit-test.

Drop linking separate status.c as it's already linked via internal libs.

6 years agovdo: fix parsing vdo status
Zdenek Kabelac [Sun, 8 Jul 2018 22:54:16 +0000 (00:54 +0200)]
vdo: fix parsing vdo status

Recent updates relay on zerod status structure memory (device ptr is
NULL) and also dm_strncpy need to count with '\0'.

6 years agoallocation: add check for passing log allocation
Zdenek Kabelac [Sun, 8 Jul 2018 22:54:16 +0000 (00:54 +0200)]
allocation: add check for passing log allocation

Updates previous commit.

6 years agotests: check how thin-pool allocation works
Zdenek Kabelac [Sun, 8 Jul 2018 21:24:58 +0000 (23:24 +0200)]
tests: check how thin-pool allocation works

Check allocation of thin-pool works on 2PVs, when one is so full,
that even metadata do not fit there (as they need at least 2M,
while 99% of 63MB fills >62MB)

6 years agocleanup: use last_seg
Zdenek Kabelac [Sat, 7 Jul 2018 19:35:07 +0000 (21:35 +0200)]
cleanup: use last_seg

More readable code.

6 years agobuild: libdm preload dir is no longer needed
Zdenek Kabelac [Tue, 3 Jul 2018 09:12:04 +0000 (11:12 +0200)]
build: libdm preload dir is no longer needed

Since we do not build lvm code with libdm, drop preload.

6 years agodev_io: no discard in testmode
Zdenek Kabelac [Sun, 8 Jul 2018 19:11:01 +0000 (21:11 +0200)]
dev_io: no discard in testmode

When lvm2 command is executed in test mode, discard ioctl is skipped.
This may cause even data-loose in case, issuing discard for released
areas was enabled and user 'tested'  lvreduce.

6 years agoallocator: fix thin-pool allocation
Zdenek Kabelac [Sun, 8 Jul 2018 16:34:38 +0000 (18:34 +0200)]
allocator: fix thin-pool allocation

When allocating thin-pool with more then 1 device - try to
allocate 'metadataLV' with reuse of log-type allocation for mirror LV.
It should be naturally place on other device then 'dataLV'.

However due to somewhat hard to follow allocation logic code,
it's been rejected allocation in cases where there was not
enough space for data or metadata on single PV, thus to successed,
usage of segments was mandatory.

While user may use:

allocation/thin_pool_metadata_require_separate_pvs=1

to enforce separe meta and data LV - on default settings, this is not
enable thus segment allocation is meant to work.

NOTE:

As already said - the original intention of this whole  'if()' is unclear,
so try to split this test into multiple more simple tests that are more readable.

TODO: more validation.

6 years agovdo: enhance status parser
Zdenek Kabelac [Wed, 27 Jun 2018 14:18:53 +0000 (16:18 +0200)]
vdo: enhance status parser

Add support for using mempool for allocations inside status parser.
Convert some string pointers to arrays.
Reindent tabs.

6 years agodevice_mapper: relocate code for sending messages
Zdenek Kabelac [Sat, 23 Jun 2018 21:03:25 +0000 (23:03 +0200)]
device_mapper: relocate code for sending messages

To be able to send messages for recently resumed devices,
move code into inner loop.

6 years agodevice_mapper: deactive new nodes when load fails
Zdenek Kabelac [Fri, 29 Jun 2018 15:25:38 +0000 (17:25 +0200)]
device_mapper: deactive new nodes when load fails

When node loading fails, there is not much the caller can do,
since there is 'unknown' set of devices preloaded.

Only suspend during preload knows future precommitted 'metadata',
so it's non-trivial to drop 'preloaded' entries with any later call.

However dm tree tracks newly loaded entries - so in this case it
may simplify the recovery path by dropping preloaded entries so
they are not leaked in the DM table.

6 years agolv_manip: do not check extents for any virtual target
Zdenek Kabelac [Fri, 29 Jun 2018 09:25:08 +0000 (11:25 +0200)]
lv_manip: do not check extents for any virtual target

Allow creation of any virtual segment type with just --virtualsize
specified without any real extent size give.

TODO: likely --type error,zero might be later enhanced to use -V
(along with -L) - but since those targets do not allocate real
space, supporting -V makes sense with them.

6 years agolv_manip: add name of failing LV into error message
Zdenek Kabelac [Fri, 29 Jun 2018 15:26:01 +0000 (17:26 +0200)]
lv_manip: add name of failing LV into error message

6 years agomemlock: extend exception list
Zdenek Kabelac [Sat, 30 Jun 2018 09:05:14 +0000 (11:05 +0200)]
memlock: extend exception list

Amound of linked libraries grows.
Most of them we don't need to lock in, since we are not using
them in locked section, so skip locking them in memory.

6 years agolocking: memory locking ONLY with suspending reason
Zdenek Kabelac [Sat, 30 Jun 2018 08:35:08 +0000 (10:35 +0200)]
locking: memory locking ONLY with suspending reason

It's important to lock memory beforo running SUSPEND ioctl - but whole
lvm preload runs in memory unlocked environment - as in this phase
memory allocation is allowed and is meant to happen.

Once all targets are preload and ready (confirmed from all targets)
we start suspending tree - and here the memory allocation (or i.e.
opening files) is no longer allowed - as it may cause kernel deadlock.

6 years agobuild: drop some more old files
Zdenek Kabelac [Sun, 1 Jul 2018 13:01:41 +0000 (15:01 +0200)]
build: drop some more old files

6 years agobuild: avoid rebuild deps for top-level makefiles
Zdenek Kabelac [Sun, 1 Jul 2018 13:16:18 +0000 (15:16 +0200)]
build: avoid rebuild deps for top-level makefiles

6 years agodmsetup: fix error propagation in _display_info_cols()
Bryn M. Reeves [Thu, 28 Jun 2018 13:25:30 +0000 (14:25 +0100)]
dmsetup: fix error propagation in _display_info_cols()

Commit 3f35146 added a check on the value returned by the
_display_info_cols() function:

  1024         if (!_switches[COLS_ARG])
  1025                 _display_info_long(dmt, &info);
  1026         else
  1027                 r = _display_info_cols(dmt, &info);
  1028
  1029         return r;

This exposes a bug in the dmstats code in _display_info_cols:
the fact that a device has no regions is explicitly not an error
(and is documented as such in the code), but since the return
code is not changed before leaving the function it is now treated
as an error leading to:

  # dmstats list
  Command failed.

When no regions exist.

Set the return code to the correct value before returning.

6 years agoRevert "man: fix lvreduce example"
David Teigland [Wed, 27 Jun 2018 14:19:01 +0000 (09:19 -0500)]
Revert "man: fix lvreduce example"

 -l -3 is correct, meaning reduce by 3.

This reverts commit d5bcc56eefde8349ffee93d0411c6f9fd71ceb84.

6 years agoman: fix lvreduce example
David Teigland [Wed, 27 Jun 2018 13:58:22 +0000 (08:58 -0500)]
man: fix lvreduce example

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