1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

14893 Commits

Author SHA1 Message Date
Zdenek Kabelac
297d5915c3 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.
2017-12-07 21:00:36 +01:00
Zdenek Kabelac
4a4ea47f70 libdm: add help func _get_last_load_segment
Share code for same functionality.
2017-12-07 20:59:37 +01:00
Zdenek Kabelac
c3e224ad0e thin: missing type is error 2017-12-07 20:59:37 +01:00
Zdenek Kabelac
2208ebfe16 thin: always clear memory before parsing status
Ensure there cannot be 'reused' any data from some previous call.
2017-12-07 20:59:28 +01:00
Alasdair G Kergon
2166d7be72 lvmetad: drop stray underscore 2017-12-07 16:24:14 +00:00
Alasdair G Kergon
d591d04103 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.
2017-12-07 03:48:11 +00:00
David Teigland
54154dc6f1 lvmlockd: clear coverity complaint 2017-12-06 10:49:31 -06:00
David Teigland
0f0f6978e7 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.
2017-12-06 10:49:31 -06:00
Marian Csontos
9e4dc83241 Update WHATS_NEW 2017-12-06 10:41:14 +01:00
David Teigland
b910c34f09 lvmlockd: use pool lock for tmeta access
When a command is run on a named tmeta LV, use
the lock on the pool.
2017-12-05 14:31:03 -06:00
David Teigland
b9e4198500 lvmlockd: fix log print
from previous commit
2017-12-05 13:48:30 -06:00
David Teigland
5d5807b238 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.
2017-12-05 11:53:03 -06:00
David Teigland
46d6f7a639 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.
2017-12-05 11:53:03 -06:00
David Teigland
bd893348b4 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.
2017-12-05 11:53:03 -06:00
Heinz Mauelshagen
94632eb155 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.
2017-12-05 18:48:06 +01:00
Alasdair G Kergon
7195df5aca device: Skip read-modify-write if replacing whole block. 2017-12-05 01:00:38 +00:00
Alasdair G Kergon
e4805e4883 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 */
2017-12-04 23:45:26 +00:00
Zdenek Kabelac
698483b5a1 activation: also lock memory for clustered locking
Commit  c086dfadc3 missed to lock memory
for clustering suspend part since it's using differnt locking reason.
2017-12-04 23:33:02 +01:00
Zdenek Kabelac
406b566cfc 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).
2017-12-04 15:45:49 +01:00
Zdenek Kabelac
5abf6b7c21 cleanup: messsage cleanup 2017-12-04 15:38:50 +01:00
Zdenek Kabelac
76954884c7 cleanup: drop unused define 2017-12-04 15:38:50 +01:00
Zdenek Kabelac
110dac870c cleanup: use existing define with prefix 2017-12-04 15:38:50 +01:00
Zdenek Kabelac
1f73cadd2d cleanup: use log_warn
Fucntion is not failing execution -> log_warn.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
76322d3b3e clenaup: use log_warn
Avoid logging error when function is not failing.
Technically can't really happen ATM anyway.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
2a01e3d4ca cleanup: use _node_name
Use existing internal method for create 'name (major:minor)' string
for debug messages and reduce some messages.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
925fec6ecb cleanup: stack tracing 2017-12-04 15:38:50 +01:00
Zdenek Kabelac
e3366787b6 cleanup: mark success at the end
Simplify setting 'success' return value and use common use-pattern
for handling return code.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
10f37345eb cleanup: drop impossible test case
This test can never be true since info is embeded struct.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
1f6d79ab48 cleanup: simplier error message
Use single 'error' message just with different reason.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
7379a2624b 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.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
2a22576b2d cleanup: drop unused header
DM_UUID_LEN is no longer needed.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
e447d7ca5e 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.
2017-12-04 15:38:50 +01:00
Zdenek Kabelac
63368a5064 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.
2017-12-04 15:38:50 +01:00
Heinz Mauelshagen
b74e7f6a78 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.
2017-12-01 18:59:55 +01:00
Heinz Mauelshagen
053314f295 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.
2017-12-01 18:50:55 +01:00
Heinz Mauelshagen
7aef59c6c3 test: reduce pv sizes, fix comment and stripe size 2017-12-01 18:42:37 +01:00
Heinz Mauelshagen
16fa9d9ed5 test: cleanup command 2017-12-01 18:39:38 +01:00
Heinz Mauelshagen
4daad1cf11 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.
2017-12-01 18:38:18 +01:00
Heinz Mauelshagen
3688eeeea0 test: disable new reshape test until target version 1.13.1 2017-12-01 18:33:11 +01:00
Heinz Mauelshagen
9681d98cc4 test: new reshape test under io load 2017-12-01 18:31:12 +01:00
Heinz Mauelshagen
d3d18e637c 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.
2017-12-01 15:00:09 +01:00
Zdenek Kabelac
a42c3a0e90 cleanup: remove debug code 2017-12-01 12:19:09 +01:00
Zdenek Kabelac
0e177cc7c9 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.
2017-12-01 12:19:09 +01:00
Zdenek Kabelac
4dc8184803 suspend: optimize generated list
Avoid adding same LV multiple times into the list.
Just saves couple extra calls and ioctls and makes log shorter.
2017-12-01 12:19:09 +01:00
Zdenek Kabelac
7e794b7748 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.
2017-12-01 12:19:09 +01:00
Zdenek Kabelac
e4db42e476 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.
2017-12-01 12:19:09 +01:00
Zdenek Kabelac
c086dfadc3 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.
2017-12-01 12:19:09 +01:00
Zdenek Kabelac
c489dd2e17 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.
2017-12-01 12:19:09 +01:00
Zdenek Kabelac
fbd8b456db pvmove: move code from tools to lib
Move code manipulating with locking flags into /lib part of lvm.
2017-12-01 12:18:32 +01:00
Marian Csontos
94d3878efb Update WHATS_NEW 2017-11-30 13:30:28 +01:00