]> sourceware.org Git - lvm2.git/log
lvm2.git
6 years agodocs: Add TESTING file
Marian Csontos [Thu, 14 Dec 2017 14:42:34 +0000 (15:42 +0100)]
docs: Add TESTING file

6 years agotest: fix trap adding proper teardown to previous, new raid tests
Heinz Mauelshagen [Wed, 13 Dec 2017 13:39:06 +0000 (14:39 +0100)]
test: fix trap adding proper teardown to previous, new raid tests

Also remove superfluous variable.

6 years agotest: new raid tests
Heinz Mauelshagen [Wed, 13 Dec 2017 01:55:06 +0000 (02:55 +0100)]
test: new raid tests

Add three new raid tests with io load and table
reloads during reshape for target 1.13.2.

Add a raid0 to raid10 conversion test.

Also add more signals to trap in lvconvert-raid-reshape-load.sh.

6 years agoformat_text: Round size written up to multiple of 4096.
Alasdair G Kergon [Tue, 12 Dec 2017 22:52:22 +0000 (22:52 +0000)]
format_text: Round size written up to multiple of 4096.

Zero-fill metadata up to the next 4096 boundary then write out a
multiple of 4096 bytes to avoid triggering a read-modify-write.

6 years agoformat_text: Change metadata alignment from 512 to 4096.
Alasdair G Kergon [Tue, 12 Dec 2017 20:57:36 +0000 (20:57 +0000)]
format_text: Change metadata alignment from 512 to 4096.

If there is sufficient space in the metadata area, align the next
metadata to a disk offset that is a multiple of 4096 bytes and
don't write it circularly.  If it doesn't all fit at the end
of the metadata area, go back to the start and write it all there
contiguously.

If there is insufficient space to use the new stricter rules, revert to
the original behaviour, aligning on 512-byte boundaries wrapping around
the circular buffer as required.

6 years agoformat_text: More refactoring of metadata offset calcs
Alasdair G Kergon [Tue, 12 Dec 2017 18:46:25 +0000 (18:46 +0000)]
format_text: More refactoring of metadata offset calcs

6 years agoformat_text: Refactor and document metadata offset calculation.
Alasdair G Kergon [Tue, 12 Dec 2017 18:36:54 +0000 (18:36 +0000)]
format_text: Refactor and document metadata offset calculation.

6 years agodevice: Fix an unpaired device close.
Alasdair G Kergon [Tue, 12 Dec 2017 17:56:58 +0000 (17:56 +0000)]
device: Fix an unpaired device close.

dev_open_flags contains an unpaired dev_close_immediate so increment
open_count before calling it.

6 years agometadata: Consistently skip metadata areas that failed.
Alasdair G Kergon [Tue, 12 Dec 2017 17:49:35 +0000 (17:49 +0000)]
metadata: Consistently skip metadata areas that failed.

Even after writing some metadata encountered problems, some commands
continue (rightly or wrongly) and attempt to make further changes.

Once an mda is marked MDA_FAILED, don't try to use it again.
This also applies when reverting, where one loop already skips
failed mdas but the other doesn't.

This fixes some device open_count warnings on relevant failure paths.

6 years agotest: Fix condition when detecting lvmdbusd
Marian Csontos [Tue, 12 Dec 2017 13:18:27 +0000 (14:18 +0100)]
test: Fix condition when detecting lvmdbusd

6 years agodevice: Internal error if writing 0 bytes to dev.
Alasdair G Kergon [Tue, 12 Dec 2017 12:57:25 +0000 (12:57 +0000)]
device: Internal error if writing 0 bytes to dev.

6 years agolvmdbusd: All tools use detected python3
Marian Csontos [Tue, 12 Dec 2017 12:10:51 +0000 (13:10 +0100)]
lvmdbusd: All tools use detected python3

- lvmdb.py and lvm_shell_proxy.py can be used as standalone tools, so
  should use detected value.
- clean executable bit on *.in files.

6 years agotest: lvmdbusd is used for process name
Marian Csontos [Tue, 12 Dec 2017 11:14:15 +0000 (12:14 +0100)]
test: lvmdbusd is used for process name

lvmdbusd was started, but the process was not recognized by pgrep.

- configure does not make the script executable - set the flag
  explicitly when running make check,
- process name changed to lvmdbusd. The previous python3 value
  originated from the use of /usr/bin/env.

6 years agoformat_text: Adjust metadata alignment calculation.
Alasdair G Kergon [Mon, 11 Dec 2017 20:25:03 +0000 (20:25 +0000)]
format_text: Adjust metadata alignment calculation.

Use new ALIGN_ABSOLUTE macro when calculating the start location
of new metadata and adjust the end of buffer detection so that
there is no longer an imposed gap between old and new metadata.

6 years agoformat_text: Use absolute alignment to calculate metadata usage
Alasdair G Kergon [Mon, 11 Dec 2017 17:14:38 +0000 (17:14 +0000)]
format_text: Use absolute alignment to calculate metadata usage

Currently both start and offset should always be divisible by alignment,
so this should have no effect, but a later patch will increase alignment
so these variables can no longer be optimised out.

6 years agoformat_text: Move metadata size checking into separate fn.
Alasdair G Kergon [Mon, 11 Dec 2017 17:08:29 +0000 (17:08 +0000)]
format_text: Move metadata size checking into separate fn.

Move checks into _metadata_fits_into_buffer() and add macro for alignment.

6 years agoformat_text: Log additional circular buffer information.
Alasdair G Kergon [Mon, 11 Dec 2017 15:59:40 +0000 (15:59 +0000)]
format_text: Log additional circular buffer information.

6 years agoformat_text: Replace PRI with FMT.
Alasdair G Kergon [Mon, 11 Dec 2017 15:32:53 +0000 (15:32 +0000)]
format_text: Replace PRI with FMT.

6 years agoconfigure: Fix deprecation warning for lvmapp
Marian Csontos [Mon, 11 Dec 2017 14:20:48 +0000 (15:20 +0100)]
configure: Fix deprecation warning for lvmapp

* and properly regenerate configure script

6 years agolvmdbusd: Fix path to python3
Marian Csontos [Mon, 11 Dec 2017 11:36:54 +0000 (12:36 +0100)]
lvmdbusd: Fix path to python3

lvmdbusd executable script must use python3 interpreter detected by
configure script, as site-packages directory used for library is only
used by that interpreter.

6 years agoconfigure: applib is not required by dbusd
Marian Csontos [Mon, 11 Dec 2017 11:12:42 +0000 (12:12 +0100)]
configure: applib is not required by dbusd

6 years agocleanup: debug message
Zdenek Kabelac [Fri, 8 Dec 2017 12:17:15 +0000 (13:17 +0100)]
cleanup: debug message

6 years agocleanup: switch to standard query
Zdenek Kabelac [Fri, 8 Dec 2017 12:15:21 +0000 (13:15 +0100)]
cleanup: switch to standard query

In /tools part we should mostly use standard functions
lv_is_active*  unless there is good reason to not use it.

6 years agothin: regression fix for metadata checking
Zdenek Kabelac [Fri, 8 Dec 2017 12:09:45 +0000 (13:09 +0100)]
thin: regression fix for metadata checking

Fix regression from commit f173274fe4888cc73eb573cf2c6913f54641c1aa
and restore support for 'disabled' checking via lvm.conf.

6 years agoactivation: keep priority till memlock_unlock
Zdenek Kabelac [Fri, 8 Dec 2017 12:11:35 +0000 (13:11 +0100)]
activation: keep priority till memlock_unlock

Although it doesn't look like it can be a measurable problem
and costs some time to flip priorities outside of activation window.

So just like with memory locking preserve priority until call
memlock_unlock() appears.

(addition to commit c086dfadc389551b9a2d7b4c26931e5e74ada8d6).

6 years agovgchange: drop extra counting
Zdenek Kabelac [Fri, 8 Dec 2017 12:17:34 +0000 (13:17 +0100)]
vgchange: drop extra counting

As the loop for background polling _poll_lvs_in_vg checks for active LVs,
avoid doing unnecessary extra check before.

6 years agoformat_text: Use explicit alignment in wrapping calc.
Alasdair G Kergon [Fri, 8 Dec 2017 01:11:34 +0000 (01:11 +0000)]
format_text: Use explicit alignment in wrapping calc.

Expand out the metadata wrapping calculations to prepare
to support a larger alignment.

The current alignment is 512 bytes so
(mdac_area_start + rlocn->offset) % alignment is zero.

6 years agodebug: update debug msg
Zdenek Kabelac [Thu, 7 Dec 2017 16:54:41 +0000 (17:54 +0100)]
debug: update debug msg

Use _node_name.

6 years agocleanup: use log_warn
Zdenek Kabelac [Thu, 7 Dec 2017 09:42:30 +0000 (10:42 +0100)]
cleanup: use log_warn

6 years agocleanup: reorder calling of pool checking tools
Zdenek Kabelac [Thu, 7 Dec 2017 16:49:15 +0000 (17:49 +0100)]
cleanup: reorder calling of pool checking tools

Test for zero header before even starting to create argument list for
execution of thin/cache_check tool.

6 years agolibdm: drop extra structure copy
Zdenek Kabelac [Thu, 7 Dec 2017 16:47:06 +0000 (17:47 +0100)]
libdm: drop extra structure copy

When doing resume, directly pass location where new updated info
needs to be stored.

_resume_node() ensures the info is ONLY updated when the function
is successful and never changes it on error path.

6 years agolibdm: use delay_resume_if_extended
Zdenek Kabelac [Thu, 7 Dec 2017 19:28:03 +0000 (20:28 +0100)]
libdm: use delay_resume_if_extended

Update the logic towards more explicit logic.

Preload tree normally does not want to resume, only
in certain cases of extension or new loaded nodes can be
resumed. So introduce new internal variable delay_resume_if_extended
controlable by target.

Patch itself is not changing current existing behaviour,
and rather documents existing problem in more readable way.

lvm2 needs to introduce explicit mechanism how to support more
fain-grained (and safe) logic to i.e. resize thin-pool which
can be sitting on cached raid volume.

6 years agolibdm: avoid checking status on activation
Zdenek Kabelac [Thu, 7 Dec 2017 16:52:01 +0000 (17:52 +0100)]
libdm: avoid checking status on activation

Variable props.send_messages has 3 states and was not used properly
here.  Activation in this moment does not need to verify thin-pool status
as that has been already checked on preload.
So only if there are some real messages (value 2) call function
for sending them.

6 years agolibdm: add help func _get_last_load_segment
Zdenek Kabelac [Wed, 6 Dec 2017 12:23:37 +0000 (13:23 +0100)]
libdm: add help func _get_last_load_segment

Share code for same functionality.

6 years agothin: missing type is error
Zdenek Kabelac [Wed, 6 Dec 2017 12:21:01 +0000 (13:21 +0100)]
thin: missing type is error

6 years agothin: always clear memory before parsing status
Zdenek Kabelac [Wed, 6 Dec 2017 12:24:41 +0000 (13:24 +0100)]
thin: always clear memory before parsing status

Ensure there cannot be 'reused' any data from some previous call.

6 years agolvmetad: drop stray underscore
Alasdair G Kergon [Thu, 7 Dec 2017 16:24:14 +0000 (16:24 +0000)]
lvmetad: drop stray underscore

6 years agodevice: Tag I/O for each mda on a device separately in log messages.
Alasdair G Kergon [Thu, 7 Dec 2017 03:34:59 +0000 (03:34 +0000)]
device: Tag I/O for each mda on a device separately in log messages.

Mark the first metadata area on each text format PV as MDA_PRIMARY.
Pass this information down to the device layer so that when
there are two metadata areas on a block device, we can easily
distinguish two independent streams of I/O.

6 years agolvmlockd: clear coverity complaint
David Teigland [Wed, 6 Dec 2017 16:48:32 +0000 (10:48 -0600)]
lvmlockd: clear coverity complaint

6 years agolvmlock: return an error if lvb cannot be written
David Teigland [Wed, 6 Dec 2017 16:42:43 +0000 (10:42 -0600)]
lvmlock: return an error if lvb cannot be written

It doesn't make much difference, because if this happens,
it means there are other more significant problems.

6 years agoUpdate WHATS_NEW
Marian Csontos [Wed, 6 Dec 2017 09:41:14 +0000 (10:41 +0100)]
Update WHATS_NEW

6 years agolvmlockd: use pool lock for tmeta access
David Teigland [Tue, 5 Dec 2017 20:31:03 +0000 (14:31 -0600)]
lvmlockd: use pool lock for tmeta access

When a command is run on a named tmeta LV, use
the lock on the pool.

6 years agolvmlockd: fix log print
David Teigland [Tue, 5 Dec 2017 19:48:30 +0000 (13:48 -0600)]
lvmlockd: fix log print

from previous commit

6 years agolvmlockd: improve error message for VG lock conflict
David Teigland [Wed, 29 Nov 2017 21:54:44 +0000 (15:54 -0600)]
lvmlockd: improve error message for VG lock conflict

When there is significant VG lock contention which retries
have not been able to mask, print a better error message.

6 years agolvmlockd: recognize normal errors from sanlock_convert
David Teigland [Wed, 29 Nov 2017 21:17:25 +0000 (15:17 -0600)]
lvmlockd: recognize normal errors from sanlock_convert

Don't log an error message for error values returned
by sanlock_convert for expected conditions like lock
contention or io timeouts.

6 years agolvmlockd: avoid blocking in sanlock_convert
David Teigland [Wed, 29 Nov 2017 20:59:11 +0000 (14:59 -0600)]
lvmlockd: avoid blocking in sanlock_convert

Use the same flag as sanlock_acquire() for the
same purpose.  sanlock_convert can block like
acquire when doing a sh to ex conversion.

6 years agodeactivate_lvs: deactivate any missing RaidLV legs
Heinz Mauelshagen [Tue, 5 Dec 2017 17:48:06 +0000 (18:48 +0100)]
deactivate_lvs: deactivate any missing RaidLV legs

In case of failed legs, raid replaces those with
e.g. "vg-lv_rimage_0-missing_0_0" mapped to an error target.

Those errouneously remain on deactivation.

Fix by removing them on deactivation/removal of the RaidLV.

6 years agodevice: Skip read-modify-write if replacing whole block.
Alasdair G Kergon [Tue, 5 Dec 2017 01:00:38 +0000 (01:00 +0000)]
device: Skip read-modify-write if replacing whole block.

6 years agodevice: categorise block i/o
Alasdair G Kergon [Mon, 4 Dec 2017 23:18:56 +0000 (23:18 +0000)]
device: categorise block i/o

Introduce enum dev_io_reason to categorise block device I/O
in debug messages so it's obvious what it is for.

DEV_IO_SIGNATURES   /* Scanning device signatures */
DEV_IO_LABEL        /* LVM PV disk label */
DEV_IO_MDA_HEADER   /* Text format metadata area header */
DEV_IO_MDA_CONTENT  /* Text format metadata area content */
DEV_IO_FMT1         /* Original LVM1 metadata format */
DEV_IO_POOL         /* Pool metadata format */
DEV_IO_LV           /* Content written to an LV */
DEV_IO_LOG          /* Logging messages */

6 years agoactivation: also lock memory for clustered locking
Zdenek Kabelac [Mon, 4 Dec 2017 17:40:37 +0000 (18:40 +0100)]
activation: also lock memory for clustered locking

Commit  c086dfadc389551b9a2d7b4c26931e5e74ada8d6 missed to lock memory
for clustering suspend part since it's using differnt locking reason.

6 years agocleanup: drop unneeded check
Zdenek Kabelac [Mon, 4 Dec 2017 14:45:49 +0000 (15:45 +0100)]
cleanup: drop unneeded check

Code already has dereferenced UUID before this point,
and its already given we require name & uuid when ading new node
(although uuid could be empty string).

6 years agocleanup: messsage cleanup
Zdenek Kabelac [Mon, 4 Dec 2017 13:37:01 +0000 (14:37 +0100)]
cleanup: messsage cleanup

6 years agocleanup: drop unused define
Zdenek Kabelac [Mon, 4 Dec 2017 13:26:56 +0000 (14:26 +0100)]
cleanup: drop unused define

6 years agocleanup: use existing define with prefix
Zdenek Kabelac [Mon, 4 Dec 2017 13:26:37 +0000 (14:26 +0100)]
cleanup: use existing define with prefix

6 years agocleanup: use log_warn
Zdenek Kabelac [Mon, 4 Dec 2017 14:16:08 +0000 (15:16 +0100)]
cleanup: use log_warn

Fucntion is not failing execution -> log_warn.

6 years agoclenaup: use log_warn
Zdenek Kabelac [Mon, 4 Dec 2017 12:34:10 +0000 (13:34 +0100)]
clenaup: use log_warn

Avoid logging error when function is not failing.
Technically can't really happen ATM anyway.

6 years agocleanup: use _node_name
Zdenek Kabelac [Mon, 4 Dec 2017 12:33:05 +0000 (13:33 +0100)]
cleanup: use _node_name

Use existing internal method for create 'name (major:minor)' string
for debug messages and reduce some messages.

6 years agocleanup: stack tracing
Zdenek Kabelac [Mon, 4 Dec 2017 12:31:40 +0000 (13:31 +0100)]
cleanup: stack tracing

6 years agocleanup: mark success at the end
Zdenek Kabelac [Mon, 4 Dec 2017 11:49:57 +0000 (12:49 +0100)]
cleanup: mark success at the end

Simplify setting 'success' return value and use common use-pattern
for handling return code.

6 years agocleanup: drop impossible test case
Zdenek Kabelac [Mon, 4 Dec 2017 10:28:31 +0000 (11:28 +0100)]
cleanup: drop impossible test case

This test can never be true since info is embeded struct.

6 years agocleanup: simplier error message
Zdenek Kabelac [Mon, 4 Dec 2017 10:25:01 +0000 (11:25 +0100)]
cleanup: simplier error message

Use single 'error' message just with different reason.

6 years agocleanup: futher code reduction
Zdenek Kabelac [Mon, 4 Dec 2017 09:38:39 +0000 (10:38 +0100)]
cleanup: futher code reduction

Just like everywhere else - use single if() for major:minor setup
(it basically can't fail as of today anyway)

Always leave funtion with correctly set pointers even on error path.

6 years agocleanup: drop unused header
Zdenek Kabelac [Fri, 1 Dec 2017 21:58:47 +0000 (22:58 +0100)]
cleanup: drop unused header

DM_UUID_LEN is no longer needed.

6 years agolibdm: support for replicator target is dropped
Zdenek Kabelac [Mon, 4 Dec 2017 14:27:05 +0000 (15:27 +0100)]
libdm: support for replicator target is dropped

Replicator never really existed in upstream kernel and its support
got deprecated.

Also its support never got finished so no code is supposed to be
using it anyway.

Libdm symbols are remaining, just the implementation will always
return failure - so any user of:

dm_tree_node_add_replicator_dev_target()
dm_tree_node_add_replicator_target().

will now always recieve error message.

6 years agolibdm: watch for failing _info_by_dev
Zdenek Kabelac [Mon, 4 Dec 2017 14:05:44 +0000 (15:05 +0100)]
libdm: watch for failing _info_by_dev

Separate handling of error code from _info_by_dev.
This error can only happeng when we are running out of memory.
In such case there is urgent need to stop any futher proceeding
of command and run to error ASAP.

6 years agotest: allow to succeed in the cluster
Heinz Mauelshagen [Fri, 1 Dec 2017 17:59:55 +0000 (18:59 +0100)]
test: allow to succeed in the cluster

Avoiding "$(get first_extent_sector "$d")" in the loop
allows the test to succeed in the cluster.  Further cluster
analysis needed to get to the core reason.

6 years agotest: add large tests skip option
Heinz Mauelshagen [Fri, 1 Dec 2017 17:50:55 +0000 (18:50 +0100)]
test: add large tests skip option

The lvm2 test suite aims at small test resource footprints
(few PVs, small PV sizes) to run on tmpfs backed loop device.

OTOH, lvconvert-reshape-raid.sh aims to test the maxima of
supported total stripes of 64.  This patch adds a prerequisite
conditional to skip tests using more than 14 stripes.

It requires the target version 1.13.1 to avoid deadlocks.

6 years agotest: reduce pv sizes, fix comment and stripe size
Heinz Mauelshagen [Fri, 1 Dec 2017 17:42:37 +0000 (18:42 +0100)]
test: reduce pv sizes, fix comment and stripe size

6 years agotest: cleanup command
Heinz Mauelshagen [Fri, 1 Dec 2017 17:39:38 +0000 (18:39 +0100)]
test: cleanup command

6 years agolv_manip: allow extension on --nosync raid lv
Heinz Mauelshagen [Fri, 1 Dec 2017 17:38:18 +0000 (18:38 +0100)]
lv_manip: allow extension on --nosync raid lv

If the recovery of the repleced leg(s) of a RaidLV created without
initial resynchronization (i.e. "lvcreate --nosync ...") got
interrupted, it can't be extended because of the < 100% sync rate.

6 years agotest: disable new reshape test until target version 1.13.1
Heinz Mauelshagen [Fri, 1 Dec 2017 17:33:11 +0000 (18:33 +0100)]
test: disable new reshape test until target version 1.13.1

6 years agotest: new reshape test under io load
Heinz Mauelshagen [Fri, 1 Dec 2017 17:31:12 +0000 (18:31 +0100)]
test: new reshape test under io load

6 years agoraid: ignore --stripesize on raid4/5 conversion to 1 stripe
Heinz Mauelshagen [Fri, 1 Dec 2017 14:00:09 +0000 (15:00 +0100)]
raid: ignore --stripesize on raid4/5 conversion to 1 stripe

In case caller passes in changed stripe size when reshaping raid4/5
to 1 stripe aiming to convert to raid1 and optionally to linear,
ignore it to prevent data corruption.

6 years agocleanup: remove debug code
Zdenek Kabelac [Mon, 27 Nov 2017 15:52:38 +0000 (16:52 +0100)]
cleanup: remove debug code

6 years agocleanup: simplify _deps code
Zdenek Kabelac [Thu, 30 Nov 2017 11:53:34 +0000 (12:53 +0100)]
cleanup: simplify _deps code

Make _deps to always return name & uuid,
and postpone duplication of name and uuid into _create_dm_tree_node().
Saves some duplicated code.

6 years agosuspend: optimize generated list
Zdenek Kabelac [Thu, 30 Nov 2017 12:24:41 +0000 (13:24 +0100)]
suspend: optimize generated list

Avoid adding same LV multiple times into the list.
Just saves couple extra calls and ioctls and makes log shorter.

6 years agoactivation: avoid rechecking pvmove node
Zdenek Kabelac [Thu, 30 Nov 2017 12:26:44 +0000 (13:26 +0100)]
activation: avoid rechecking pvmove node

Use new 3rd. state of trace_pvmove_deps == 2.
In this state we know, we have already seen the node and can skip futher
testing.   Remainging value 1 signals we want to track, and value 0
is for ignoring tracking, but node is still checking in this case.

Reduces large amount of duplicate ioctl queries.

6 years agoactivation: extend resume validation
Zdenek Kabelac [Tue, 28 Nov 2017 22:11:20 +0000 (23:11 +0100)]
activation: extend resume validation

Check also all snapshosts when resume is requested,
the origin volume is already resume, but possibly
some subLV or snapshot LV could be suspended if
we are still in critical_section.

6 years agoactivation: split priority from memory locking
Zdenek Kabelac [Fri, 1 Dec 2017 10:50:14 +0000 (11:50 +0100)]
activation: split priority from memory locking

When entering any critical section, lvm2 used to lock process memory
and raised task priority to avoid problem with page swapping and minimize
time of having non-resumed devices in table.

With this patch, memory locking which which is expensive is only used when
entering  'suspending' section as only in this section there is risk
lvm could be suspending a device which later can be needed for paging.

Raised priority is still kept for all section entrances as this is
low-cost operation and may accelerate table resumes - although the real
impact can be still considered later.

6 years agopvmove: add missing segment merging
Zdenek Kabelac [Wed, 29 Nov 2017 21:19:46 +0000 (22:19 +0100)]
pvmove: add missing segment merging

When pvmove is finished and metadata are updated, the code missed
to merge possible mergable segments - so add explicit merging
call after pvmoved volumes are unlocked.

This avoids weird results where i.e. lvs could have been reporting
non-matching segments as lvs upon metadata read is doing silent segment
merging while dm table left after pvmove was still preserving
non-merged segments.

6 years agopvmove: move code from tools to lib
Zdenek Kabelac [Wed, 29 Nov 2017 21:19:05 +0000 (22:19 +0100)]
pvmove: move code from tools to lib

Move code manipulating with locking flags into /lib part of lvm.

6 years agoUpdate WHATS_NEW
Marian Csontos [Thu, 30 Nov 2017 12:30:28 +0000 (13:30 +0100)]
Update WHATS_NEW

6 years agotests: Fix common_dev_ argument handling
Marian Csontos [Tue, 28 Nov 2017 11:03:35 +0000 (12:03 +0100)]
tests: Fix common_dev_ argument handling

from[:[len]] arguments with missing colon assigned from to len, instead
of till_the_end_of_device.

6 years agolabel: Remove unused verify functions.
Alasdair G Kergon [Tue, 28 Nov 2017 01:36:55 +0000 (01:36 +0000)]
label: Remove unused verify functions.

label_verify has never been used so remove it.

6 years agocleanup: reuse existing macro
Zdenek Kabelac [Mon, 27 Nov 2017 09:20:24 +0000 (10:20 +0100)]
cleanup: reuse existing macro

Use existing macro to detect striped raid segment.

6 years agocmdline: avoid overrun on very large numbers.
Zdenek Kabelac [Mon, 27 Nov 2017 09:21:21 +0000 (10:21 +0100)]
cmdline: avoid overrun on very large numbers.

When large size number (>2^31) is given on command line it could be
misdetected and in certain cases lead to wrongly casted number.

So make sure all cases always do set _MAX number in case the value would
not fit within the supported range instead of getting some random value
within the range.

In most cases this was not a problem to detect, but i.e. stripesize
parameter might have been fooled by certain large numbers.

6 years agotoollib: improve stripes args reading
Zdenek Kabelac [Mon, 27 Nov 2017 09:26:35 +0000 (10:26 +0100)]
toollib: improve stripes args reading

Rewrite validation of stripes and stripe_size args into more readable
sequential code.

Extend reading of stripes & stripes_size args so it better knows
defaults for types like striped raid.

TODO: this should really be a value obtained for segtype structure and
all the weird conditions and modification of stripes and stripe_size
around lvm2 code should be dropped.

6 years agopvmove: enhance delayed_resume logic
Zdenek Kabelac [Sat, 25 Nov 2017 23:28:33 +0000 (00:28 +0100)]
pvmove: enhance delayed_resume logic

ATM we want to support delayed resume purely in pvmove case.
So have libdm logic internal to recognize difference beween
pvmove and other targets that do use delayed resume.

This fixes problem introduced with commit aa68b898ff9c51dcb
for mirror-on-mirror or snapshot-on-mirror problem.

TODO: likely added new API call and let libdm user select
delayed nodes explicitely.

6 years agoactivation: enhance holders detection
Zdenek Kabelac [Fri, 24 Nov 2017 19:59:38 +0000 (20:59 +0100)]
activation: enhance holders detection

Use code which detectes handlers in a way, which is more
backward-compatible friendly.

Replace read of 'sysfs' uuid entry with dm ioctl call.

Use /sys/block/dm-X/holders path instead of
new path  /sys/dev/block/major:minor/holders.

TODO:
There are few more occurencies of this logic around the code
so some abstract interface should be considered.

6 years agotests: more places where missing should not appear
Zdenek Kabelac [Tue, 21 Nov 2017 16:34:41 +0000 (17:34 +0100)]
tests: more places where missing should not appear

6 years agotests: typo
Zdenek Kabelac [Tue, 21 Nov 2017 14:34:02 +0000 (15:34 +0100)]
tests: typo

6 years agocleanup: update error messages
Zdenek Kabelac [Tue, 21 Nov 2017 14:33:29 +0000 (15:33 +0100)]
cleanup: update error messages

Correct printed lv names in error messages
and add missing trace for return.

6 years agocleanup: using max args consistently
Zdenek Kabelac [Tue, 21 Nov 2017 16:36:09 +0000 (17:36 +0100)]
cleanup: using max args consistently

Define and use MAX_PDATA_ARGS for thin_repair and cache_repair consistently.

6 years agocleanup: reduce couple debug lines
Zdenek Kabelac [Thu, 16 Nov 2017 23:01:45 +0000 (00:01 +0100)]
cleanup: reduce couple debug lines

6 years agocache: use conditional in warning message
Zdenek Kabelac [Mon, 20 Nov 2017 15:33:43 +0000 (16:33 +0100)]
cache: use conditional in warning message

In some cases the message could be slightly misleading so use
here rather conditional.

TODO:

In future we may possibly further tune the message in case we are
certain the level of redundancy protection has not been reduced.

6 years agotoollib: avoid printing default stripe size
Zdenek Kabelac [Fri, 17 Nov 2017 22:02:44 +0000 (23:02 +0100)]
toollib: avoid printing default stripe size

When user is not creating striped LV, do not print
rather confusing info about default stripe size.

6 years agopvmove: finish no longer needs explicit resumed
Zdenek Kabelac [Fri, 24 Nov 2017 13:00:22 +0000 (14:00 +0100)]
pvmove: finish no longer needs explicit resumed

Activation code can see from holders needed LVs for resume.

6 years agoactivation: automaticaly discover pvmove holders
Zdenek Kabelac [Fri, 24 Nov 2017 12:55:42 +0000 (13:55 +0100)]
activation: automaticaly discover pvmove holders

When pvmove is finished and does 'suspend/resume' on PVMOVE LV,
on resume path committed metadata are already showing 'standalone'
pvmove LV prepared just for removal.

However code should be able to 'resume' preloaded LV there were
participating in pvmove operation.

Previously this was all done in the 'tools' part of lvm2 code.
So the lvconvert upon pvmove finish had to explicitely call 'resume' on every such LV.
Now 'smarted' activation code is able to deduce and combine all information from
the active dm table and committed metadata so single  call resolves
it all in one go.

Internally holders are detected by reading sysfs directory to capture
all needed UUID which are then looked in lvm2 metadata and all such
LVs are automatically collected into dmtree.

6 years agomirror: use lv_update_and_reload_origin
Zdenek Kabelac [Fri, 24 Nov 2017 12:58:23 +0000 (13:58 +0100)]
mirror: use lv_update_and_reload_origin

Replace complex code with standard lv_update_and_reload_origin().
Extra suspend should not be necessary.
(If they would be - dependency tree would have bug for fixing).

6 years agolibdm: preload propagates delayed resume
Zdenek Kabelac [Fri, 24 Nov 2017 12:57:22 +0000 (13:57 +0100)]
libdm: preload propagates delayed resume

Propagate delayed resume at least for preload case in a simple way.
Currently  PVMOVE depends on internal logic where 'mirror' with
corelog is 'possible' PVMOVE. In such case resume of 'created'
node is 'delayed'.

This is mostly an ugly internal hack - but for the moment being when we
add propagation for preload - it does work reasonable.

TODO: provide standard API and avoid this internal 'guessing'.

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