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

379 Commits

Author SHA1 Message Date
Heinz Mauelshagen
ebd0fed0ce raid: correct raid6_n_6 -> raid5 convenience type
Fix "lvconvert --type raid5 RaidLV" on a "raid6_n_6" LV offering
false "raid6_ls_6" instead of "raid5_n".
2017-11-14 14:41:06 +00:00
Heinz Mauelshagen
9958c41927 raid: reject message for 2-legged raid4/5 -> striped
Commit 763db8aab0 rejects 2-legged
conversions to striped/raid0 but different messages are displayed
for raid0 or striped. This commit provides the same rejection messages.
2017-11-08 18:17:26 +01:00
Heinz Mauelshagen
763db8aab0 raid: reject conversion request to striped/raid0 on 2-legged raid4/5
raid4/5 LVs may only be converted to striped or raid0/raid0_meta
in case they have at least 3 legs. 2-legged raid4/5 are a result
of either converting a raid1 to raid4/5 (takeover) or converting
a raid4/5 with more than 2 legs to raid1 with 2 legs (reshape).

The raid4/5 personalities map those as raid1,
thus reject conversion to striped/raid0.

Resolves: rhbz1511047
2017-11-08 17:49:04 +01:00
Zdenek Kabelac
2354fb3fe4 coverity: avoid overflow_before_widen
TODO: it likely should be checked value is >0...
2017-11-07 21:26:11 +01:00
Heinz Mauelshagen
4a3884245d raid: ignore --stripes/--stripesize on takeover
Converting from one raid level to another, no changes
of stripes or stripesize can be requested because those
are subject to reshaping.  I.e. the process requires to
takeover first and secondly request raid algorithm,
stripe or stripesize changes.

Ignore any related changes display warninngs
and proceed with the takeover.

Without this patch, a takeover requesting
stripesize change causes data corruption!
2017-10-26 17:16:23 +02:00
Alasdair G Kergon
f1cc5b12fd tidy: Add missing underscores to statics. 2017-10-18 15:58:13 +01:00
Heinz Mauelshagen
554a761db2 raid: return previous reshape space allocation properly
Fix returning previous allocation of reshape space.
2017-10-09 13:55:01 +02:00
Heinz Mauelshagen
a95f656d0d raid: enhance conversion rejection message
Related: rhbz1439399
2017-10-04 17:05:59 +02:00
David Teigland
3071837e21 lvmlockd: always disallow mirror splitting
lv_raid_split() was correctly prevented in a shared VG,
but lv_raid_split_and_track() was missing that check.
2017-09-05 10:28:33 -05:00
Zdenek Kabelac
39ebacdb5a raid: reshape synchronization point
Give udev time to get in sync and give md-core time to wake up
after table reload.
2017-07-20 19:16:39 +02:00
Alasdair G Kergon
7ba0017468 raid: avoid lv_size compiler warning
warning: declaration of ‘lv_size’ shadows a global declaration
2017-07-20 16:16:51 +01:00
Zdenek Kabelac
c78316b7a5 raid: move syncing with udev into function
Since _deactivate_and_remove_lvs() is used in more then one place,
move the needed udev synchronization into this function so other
users automatically get correct fs state before next dm manipulation.

Assumption here is that this udev synchronization 'delay' may also
prevent to 'early' table reloads which might cause kernel problems
for md-core - but we may need more generic time-limited reload
frequency for raid devices.

Note: on udev-less system there will be almost no delay.
2017-07-20 13:52:18 +02:00
Zdenek Kabelac
48ce8c7a49 tidy: drop unneeded cast
Avoid casting to the same type.
2017-07-20 11:20:44 +02:00
Zdenek Kabelac
0bf836aa14 tidy: prefer not using else after return
clang-tidy: avoid using  'else' after return - give more readable code,
and also saves indention level.
2017-07-20 11:18:29 +02:00
Zdenek Kabelac
0d0a3397c2 cleanup: add braces in macro 2017-07-20 11:18:29 +02:00
Heinz Mauelshagen
34504855a7 raid: add data_offset incompatibility segment type flag
In order to reject out of place reshaping with segment data_offset
field on old runtime, add a respective segment type incompatibility
flag causing "+RESHAPE_DATA_OFFSET" to be suffixed to the segment
type name.
2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
1d69fc7c5e raid: use return_0 for better backtracking 2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
6685460f5a lvconvert: allow reshaping in the cluster and on open devices
The previous commit fixed allocation/activation of reshape space.

Remove conditionals prohibiting reshaping in these cases.

Related: rhbz1447812
Related: rhbz1448116
Related: rhbz1461562
2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
f1b78665ef raid: fix allocation/activation of reshape space
When reshape space is allocated anew, an update and reload is needed to
promote the new size to the cluster node with the exclusively active RaidLV
or reloading the RaidLV will fail with a size related error.  Additionally,
store "data_offset <sectors>" with the RaidLV in the lvm2 metadata so that
it can be retrieved on cluster nodes.

Process allocation of reshape space on a 2-legged raid4/5 (interim layout
to convert from/to linear via raid1) properly in the cluster.

Resolves: rhbz1461562
Resolves: rhbz1448116
2017-07-14 15:53:23 +02:00
Zdenek Kabelac
2ceb5a0abb coverity: just make impossible division by zero
Visible for analyzer  code will not try to use 0 for division.
2017-06-30 20:39:23 +02:00
Zdenek Kabelac
ad286a3227 raid: ensure enum is defined
Just making sure enum is always defined.

TODO: code path using this enum needs closer inspection.
2017-06-30 20:39:02 +02:00
Zdenek Kabelac
d444accdbf debug: fail in backup is not traced nor error 2017-06-27 00:27:36 +02:00
Zdenek Kabelac
3e331c8e68 cleanup: remove unused code 2017-06-27 00:27:25 +02:00
Zdenek Kabelac
b1e21cf9ed raid: fix write_commit_backup
With commit 41c10034aa we actually
do require LV to be used with _vg_write_lv_suspend_commit_backup().

So write a proper separte single wrapper for write && commit && backup.
2017-06-27 00:27:25 +02:00
Zdenek Kabelac
c465ca6a3a raid: allow more sync action for extraction
Since we discovered status reporting from 'md' goes from large set
of weird states we can't just decided based on this word.
So let it pass for rebuild and idle as well
and check for health devices afterwards.
2017-06-24 22:28:25 +02:00
Zdenek Kabelac
2b18be87aa raid: recognize transient failed raid leg
When raid leg rimage device is marked as 'D'ead by mdcore,
lvm2 was not able to replace such device with allocate policy,
as device has not appared as missing.

Add detection of transiently failing devices.
2017-06-23 23:27:07 +02:00
Zdenek Kabelac
cc03a872c0 cleanup: update messages 2017-06-23 18:44:01 +02:00
Zdenek Kabelac
a7c7d53543 debug: add missing internal error message
Do not just 'return_0'  log error would need to be shown.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
63ecbcd1b7 raid: switch message to verbose
As this is not 'error' resulting query, decrease reported level.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
6d30350dd1 raid: improving messages for regionsize change
Handle change of 'region size' better and follow also standard rule
if the command can't success (i.e. size is already same) we return
error for all such cases.

Also log_pring more info about adjusted value (just like we
do for rounding)

Also avoid keep pointers on 'display_*' values - they are in
ringbuffer for immediate use - not to be kept across multiple calls
(as they could be already overwritten by later calls) - so dropped
seg_region_size_str
2017-06-23 18:44:00 +02:00
Zdenek Kabelac
41c10034aa debug: show message only when origin_only was set 2017-06-22 20:17:20 +02:00
Heinz Mauelshagen
64fac77e8a raid: fix segfault
Add missing else clause
(already missing in initial commit fe18e5e77a).

Resolves: rhbz1463794
2017-06-22 00:49:00 +02:00
Zdenek Kabelac
48f06005ab raid: update path for repair
Updating path from commit 61980bcf06.

When repair is running, no removing PVS are given so it shall return
success in such case.
2017-06-21 14:00:50 +02:00
Zdenek Kabelac
5f4cfa7c4a debug: missing traces 2017-06-21 12:36:01 +02:00
Zdenek Kabelac
07fe64b473 raid: use log_error on error path
Converting log_warn to log_error since error must be logged
when tool returns error.
2017-06-21 12:35:17 +02:00
Zdenek Kabelac
61980bcf06 raid: report error when specified devices are not contained
lvm2 always return non-zero error code when action cannot happen.
2017-06-21 12:35:17 +02:00
Zdenek Kabelac
31d153ced0 raid: drop debug code 2017-06-21 12:35:16 +02:00
Zdenek Kabelac
49fa2bea1c raid: more origin_only updates
Seems the code is multiplied - so keep it consistent for now.

TODO:  drop all uneeded code
2017-06-21 12:35:16 +02:00
Heinz Mauelshagen
1766eaec4b lvconvert: provide better reshape reject message for open RaidLV
On commits
5e611c700b and
601ad1c73f.

Related: rhbz1447812
2017-06-20 19:06:18 +02:00
Heinz Mauelshagen
76314183e2 raid: avoid explicit activation of SubLVs on reshape/takeover
Remove explicit activation of SubLVs and let lv_update_and_reload()
perform the proper (pre-)loading sequencing of tables.
This avoids related callback functions which are removed.

Related: rhbz1448116
Related: rhbz1461526
Related: rhbz1448123
2017-06-20 18:56:45 +02:00
Heinz Mauelshagen
0dfe1bc29d raid: provide clickable URL BZ references 2017-06-20 18:43:26 +02:00
Zdenek Kabelac
1ea41b6d48 activation: fix usage of origin_only
When lock-holding LV differs from actually request locked LV,
we drop  origin_only flag as it has no use - it'd be applied
on completely different LV.

Example of problem:

Raid is  thin-pool _tdata LV.
Raid run  origin_only locking on stacked device.
As lock holder is discovered thinLV.
Whole origin_only operation is then applied only on thinLV
changing the meaning of whole operation.

NOTE: this patch does not change anything for LV that are
already top-level lock holding LVs (i.e. thinLVs, snahoshots/origins).
2017-06-20 18:23:24 +02:00
Heinz Mauelshagen
5e611c700b lvconvert: check open count to disable reshaping of open RAID LV
Also check LV open count in addition to opening the RaidLV
exclusively as of commit 601ad1c73f.

Related: rhbz1447812
2017-06-20 17:59:10 +02:00
Heinz Mauelshagen
601ad1c73f lvconvert: enhance disable reshaping of open RAID LV
Enhance commit 9e9163618a
to use dev_open_flags/dev_close API.

Related: rhbz1447812
2017-06-20 17:27:58 +02:00
Zdenek Kabelac
19cc03fa52 thin: restore conversion to raid
Since commit  1bc546269a we've disabled
coversion of raid. This however already got fixed, so reenable
commands like:  'lvconvert --type raid1 vg/pool_tdata'.
2017-06-19 23:30:08 +02:00
Heinz Mauelshagen
9e9163618a lvconvert: disable reshaping of open RAID LV
Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation.

Related: rhbz1447812
2017-06-19 22:25:54 +02:00
Heinz Mauelshagen
e1a1c20e95 lvconvert: enhance message
Enhance message introduced by last
commit f342e803ba.

Related: rhbz1439399
2017-06-19 21:40:38 +02:00
Heinz Mauelshagen
f342e803ba lvconvert: disable conversion of RAID LV under snapshot
Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation.

Related: rhbz1439399
2017-06-19 21:08:52 +02:00
Heinz Mauelshagen
fb46175ce7 lvconvert: disable reshaping of RAID LVs in the cluster
Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation in the cluster.

Related: rhbz1448116
Related: rhbz1461526
Related: rhbz1448123
2017-06-19 21:06:53 +02:00
Zdenek Kabelac
9e96f96a41 cleanup: drop unused parameter 2017-06-16 17:04:02 +02:00
Zdenek Kabelac
cdb55c19cd cleanup: show what happens when passed prompt
When we show prompt and user passes --yes - we still
do tell user which action is going to happen.
2017-06-16 17:04:02 +02:00
Zdenek Kabelac
14816222a1 cleanup: improve debug tracing 2017-06-16 17:04:02 +02:00
Heinz Mauelshagen
ddf2a1d656 Revert "lvconvert: reject changing number of stripes on single core
This reverts commit 3719f4bc54
to allow for single core testing on kernels with deadlock
fixes relative to rhbz1443999."
2017-06-16 15:43:23 +02:00
Jonathan Brassow
6c4b2a6aa1 clean-up: Very picky update to comment - hopefully making it clearer 2017-06-14 15:22:04 -05:00
Jonathan Brassow
1f57a5263e clean-ups: remove unused var, add 'static' for local fn, adjust test
For the test clean-up, I was providing too many devices to the first
command - possibly allowing it to allocate in the wrong place.  I was
also not providing a device for the second command - virtually ensuring
the test was not performing correctly at times.
2017-06-14 14:49:42 -05:00
Jonathan Brassow
ddb14b6b05 lvconvert: Disallow removal of primary when up-converting (recovering)
This patch ensures that under normal conditions (i.e. not during repair
operations) that users are prevented from removing devices that would
cause data loss.

When a RAID1 is undergoing its initial sync, it is ok to remove all but
one of the images because they have all existed since creation and
contain all the data written since the array was created.  OTOH, if the
RAID1 was created as a result of an up-convert from linear, it is very
important not to let the user remove the primary image (the source of
all the data).  They should be allowed to remove any devices they want
and as many as they want as long as one original (primary) device is left
during a "recover" (aka up-convert).

This fixes bug 1461187 and includes the necessary regression tests.
2017-06-14 08:41:05 -05:00
Jonathan Brassow
4c0e908b0a RAID (lvconvert/dmeventd): Cleanly handle primary failure during 'recover' op
Add the checks necessary to distiguish the state of a RAID when the primary
source for syncing fails during the "recover" process.

It has been possible to hit this condition before (like when converting from
2-way RAID1 to 3-way and having the first two devices die during the "recover"
process).  However, this condition is now more likely since we treat linear ->
RAID1 conversions as "recover" now - so it is especially important we cleanly
handle this condition.
2017-06-14 08:39:50 -05:00
Jonathan Brassow
d34d2068dd lvconvert: Don't require a 'force' option during RAID repair.
Previously, we were treating non-RAID to RAID up-converts as a "resync"
operation.  (The most common example being 'linear -> RAID1'.)  RAID to
RAID up-converts or rebuilds of specific RAID images are properly treated
as a "recover" operation.

Since we were treating some up-convert operations as "resync", it was
possible to have scenarios where data corruption or data loss were
possibilities if the RAID hadn't been able to sync completely before a
loss of the primary source devices.  In order to ensure that the user took
the proper precautions in such scenarios, we required a '--force' option
to be present.  Unfortuneately, the force option was rendered useless
because there was no way to distiguish the failure state of a potentially
destructive repair from a nominal one - making the '--force' option a
requirement for any RAID1 repair!

We now treat non-RAID to RAID up-converts properly as "recover" operations.
This eliminates the scenarios that can potentially cause data loss or
data corruption; and this eliminates the need for the '--force' requirement.
This patch removes the requirement to specify '--force' for RAID repairs.
2017-06-14 08:39:07 -05:00
Jonathan Brassow
c87907dcd5 lvconvert: linear -> raid1 upconvert should cause "recover" not "resync"
Two of the sync actions performed by the kernel (aka MD runtime) are
"resync" and "recover".  The "resync" refers to when an entirely new array
is going through the process of initializing (or resynchronizing after an
unexpected shutdown).  The "recover" is the process of initializing a new
member device to the array.  So, a brand new array with all new devices
will undergo "resync".  An array with replaced or added sub-LVs will undergo
"recover".

These two states are treated very differently when failures happen.  If any
device is lost or replaced while "resync", there are no worries.  This is
because any writes created from the inception of the array have occurred to
all the devices and can be safely recovered.  Even though non-initialized
portions will still be resync'ed with uninitialized data, it is ok.  However,
if a pre-existing device is lost (aka, the original linear device in a
linear -> raid1 convert) during a "recover", data loss can be the result.
Thus, writes are errored by the kernel and recovery is halted.  The failed
device must be restored or removed.  This is the correct behavior.

Unfortunately, we were treating an up-convert from linear as a "resync"
when we should have been treating it as a "recover".  This patch
removes the special case for linear upconvert.  It allows each new image
sub-LV to be marked with a rebuild flag and treats the array as 'in-sync'.
This has the correct effect of causing the upconvert to be treated as a
"recover" rather than a "resync".  There is no need to flag these two states
differently in LVM metadata, because they are already considered differently
by the kernel RAID metadata.  (Any activation/deactivation will properly
resume the "recover" process and not a "resync" process.)

We make this behavior change based on the presense of dm-raid target
version 1.9.0+.
2017-06-14 08:35:22 -05:00
Heinz Mauelshagen
08079ec420 lvconvert: fix detached SubLV deactivation in cluster
On conversion from raid10 to raid0 (takeover), all rmeta
devices and the rimage devices of mirrored stripes are
detached from the raid10 LV. The remaining rimage areas
are being shifted down into the slots of the detached
ones hence requiring renames to show proper _N suffix
sequences (e.g. 0,1,2,3 instead of 0,2,4,6).  Only the
top-level raid10 LV has a cluster lock, not the detached
SubLVs thus their deactivation is impossible and e.g the
rename from *_rimage_6 to *_rimage_3 will fail.  Fix by
activating exclusively before deactivating and removing.

Resolves: rhbz1448123
2017-06-13 23:15:51 +02:00
Heinz Mauelshagen
1c916ec5ff raid: add reshape segtype flag support
Prohibit activation of reshaping RaidLVs on incompatible
lvm2 runtime by storing e.g. 'raid5+RESHAPE' segment type
strings in the lvm2 metadata.  Incompatible runtime not
supporting reshaping won't be able to activate those thus
avoiding potential data corruption.

Any new non-reshaping lvconvert command will reset the
segment type string from 'raid5+RESHAPE' to 'raid5'.

See commits
0299a7af1e and
4141409eb0
for segtype flag support.
2017-06-09 22:23:04 +02:00
Heinz Mauelshagen
39703cb485 lvconvert: reject RAID conversions on inactive LVs
Only support RAID conversions on active LVs.

If we'd accept e.g. upconverting linear -> raid1 on inactive
linear LVs, any LV flags passed to the kernel aren't properly
cleared thus errouneously passing them on every activation.

Add respective check to lv_raid_change_image_count() and
move existing one in lv_raid_convert() for better messages.
2017-06-07 18:37:04 +02:00
Heinz Mauelshagen
3217e0cfea lvconvert: choose direct path to desired raid level
Remove superfluous raid5_n interim LV type from raid4 -> raid10 conversion.

Resolves: rhbz1458006
2017-06-02 14:30:57 +02:00
Heinz Mauelshagen
3719f4bc54 lvconvert: reject changing number of stripes on single core
Reject any stripe adding/removing reshape on raid4/5/6/10 because
of related MD kernel deadlock on single core systems until
we get a proper fix in MD.

Related: rhbz1443999
2017-05-30 19:14:32 +02:00
Heinz Mauelshagen
65b10281f8 Proper dm_snprintf return checks 2017-05-24 14:00:44 +02:00
Alasdair G Kergon
57492a6094 raid: Drop unnecessary/incorrect use of dm_pool_free 2017-05-23 01:51:04 +01:00
Heinz Mauelshagen
2bf01c2f37 lvconvert: fix logic in automatic settings of possible (raid) LV types
Commit 5fe07d3574 failed to set raid5 types
properly on conversions from raid6.  It always enforced raid6_ls_6
for types raid6/raid6_zr/raid6_nr/raid6_nc, thus requiring 3 conversions
instead of 2 when asking for raid5_{la,rs,ra,n}.

Related: rhbz1439403
2017-05-18 16:20:39 +02:00
Heinz Mauelshagen
9c651b146e lvconvert: fix indent and typo in last commit 2017-05-18 00:43:20 +02:00
Heinz Mauelshagen
5fe07d3574 lvconvert: enhance automatic settings of possible (raid) LV types
Offer possible interim LV types and display their aliases
(e.g. raid5 and raid5_ls) for all conversions between
striped and any raid LVs in case user requests a type
not suitable to direct conversion.

E.g. running "lvconvert --type raid5 LV" on a striped
LV will replace raid5 aka raid5_ls (rotating parity)
with raid5_n (dedicated parity on last image).
User is asked to repeat the lvconvert command to get to the
requested LV type (raid5 aka raid5_ls in this example)
when such replacement occurs.

Resolves: rhbz1439403
2017-05-18 00:18:15 +02:00
Heinz Mauelshagen
8f305f025e raid: handle insufficent PVs on takeover to/from raid4
Commit 7bc85177b0
felt short relative to striped/raid0* -> raid4
and raid4 -> raid6.

Related: rhbz1438013
2017-04-22 01:19:44 +02:00
Heinz Mauelshagen
97a5fa4b87 raid: avoid superfluous variable 2017-04-22 00:50:36 +02:00
Heinz Mauelshagen
0c2fd133d7 raid: remove double minimum area check on takeover 2017-04-20 21:35:06 +02:00
Heinz Mauelshagen
d8a63f446e raid: define return value on error paths 2017-04-20 21:32:40 +02:00
Heinz Mauelshagen
5fb5717402 raid: avoid superfluous reload on takeover
Allow any reset rebuild flags to trigger the second update on takeover.
Use descriptive callback names.
Fix typo and add comments.
2017-04-20 21:18:27 +02:00
Heinz Mauelshagen
15c3ad9641 lvconvert: typo in message 2017-04-13 22:19:29 +02:00
Zdenek Kabelac
1e64386dc6 raid: use log_error
Turn log_print into log_error for error path.
2017-04-12 23:05:50 +02:00
Heinz Mauelshagen
1f715ab3b2 lvconvert: return error without conversion
lvconvert parameters not causing a conversion (i.e. no type,
number of stripes, stripesize or regionsize changes) will
remove any allocated reshape space in which case the command
returns success.  If reshape space does not exist though,
return error.
2017-04-12 22:11:30 +02:00
Heinz Mauelshagen
51a31dbd79 lvconvert: better message on --regionsize
Enhance message on "lvconvert --regionsize size RaidLV".
in case the regionsize does not change and return error.
2017-04-12 19:34:18 +02:00
Jonathan Brassow
ba12a2e81a Typo: change loose to lose
loose (v): set free; release
lose (v) : be deprived of or cease to have or retain

We 'lose' redundancy or 'lose' meaning.
2017-04-12 10:28:19 -05:00
Heinz Mauelshagen
532388fad5 lvconvert: fix failing valid regionsize change
Reshape check failed when regionsize changed and current raid type
was provided with no other change requested (stripes or stripesize).

E.g. "lvconvert --type raid6 --regionsize 256K" on a raid6 LV
with != 256K regionsize.

Enable --type in test script.
2017-04-12 14:38:49 +02:00
Heinz Mauelshagen
01b5820d03 lvconvert: add segment type raid10_near
Introducing this alias for "raid10", avoid allocating
reshape space when converting between them.

Resolves: rhbz1441347
2017-04-12 01:28:22 +02:00
Heinz Mauelshagen
7bc85177b0 raid: handle insufficent PVs on takeover from striped/raid0
Remove any newly allocated sub LV (pair) remnants in case
allocation fails due to lag of (parallel) free PV space
and keep initial raid type.

Resolves: rhbz1438013
2017-04-12 00:27:59 +02:00
David Teigland
69c3543855 raid_manip: fix typo warning message 2017-04-11 14:18:57 -05:00
Heinz Mauelshagen
ef3e1013aa lvconvert: cleanup prompting 2017-04-06 19:59:57 +02:00
Heinz Mauelshagen
eb6302c8cb lvconvert: fixe conversion message
When selecting a convenience RAID type only display
the selected type when it changed.  Display proper
current raid type when prompting.
2017-04-06 19:28:32 +02:00
Heinz Mauelshagen
653bca6811 lvconvert: raid1 -> linear prompt
Avoid 2 prompts when downconverting raid1 to linear
(related commit 0f65d7ec3a).
2017-04-06 19:24:11 +02:00
Heinz Mauelshagen
3b1a96b9b3 lvconvert: avoid error message on raid1 -> raid4 conversion
Avoid error message
"Logical Volume *_rimage_0 already exists in volume group,,,"
on takeover conversion from a 2-legged raid1 to raid4
(aiming to reshape it adding images).

Resolves: rhbz1439398
2017-04-06 19:09:05 +02:00
Heinz Mauelshagen
0f65d7ec3a lvconvert: prompt on raid1 image changes
Don't change resilience of raid1 LVs without --yes.

Adjust respective tests.
2017-04-06 18:47:41 +02:00
Heinz Mauelshagen
e350b83d50 raid: reload on removing images
Requesting _raid_remove_images() to commit the
metadata missed to reload the origin causing a
kernel takeover error converting a 2-legged raid1
(with previously removed images) to raid5.
2017-04-06 00:47:34 +02:00
Heinz Mauelshagen
d23cad16c9 raid: tidying 2017-04-06 00:06:52 +02:00
Heinz Mauelshagen
1ef1bdab27 lvconvert: allow --type with --regionsize
Allow the combination of both arguments keeping
the raid level but changing the regionssize
(e.g. "lvconvert --type raid1 --regionsize 1M RaidLV"
 on an existing raid1 LV).

Resolves: rhbz1438396
2017-04-06 00:03:16 +02:00
Heinz Mauelshagen
980e4f673e raid: more coverity issues 2017-03-30 18:39:04 +02:00
Heinz Mauelshagen
c34ab29ec6 raid: favour dm_list_first() 2017-03-30 18:13:27 +02:00
Heinz Mauelshagen
2d75ef3b05 raid: address coverity issues 2017-03-30 18:09:06 +02:00
Alasdair G Kergon
396377bc03 pre-release
Removing some unused new lines and changing some incorrect "can't
release until this is fixed" comments.  Rename license.txt to make
it clear its merely an included file, not itself a licence.
2017-03-28 16:11:35 +01:00
Heinz Mauelshagen
17a8f3d6f0 raid: conditionally reject convert to striped/raid; fix
Fix a logic flaw introduced in commit 17bee733d1
preventing e.g. striped -> raid5 conversions.

Related: rhbz1191935
Related: rhbz1366296
2017-03-17 16:03:35 +01:00
Heinz Mauelshagen
76709aaf39 raid: cleanup; remove unused function
Remove unused function (lv_has_constant_stripes() is used instead).
2017-03-17 14:24:44 +01:00
Heinz Mauelshagen
e0ea569045 raid: cleanup
Move function _raid45_to_raid54_wrapper() to avoid superfluous declaration.
2017-03-17 14:14:42 +01:00
Heinz Mauelshagen
1520fec3e8 raid: name variables consistently
Related: rhbz1191935
Related: rhbz1366296
2017-03-17 14:04:03 +01:00
Heinz Mauelshagen
17bee733d1 raid: conditionally reject convert to striped/raid0*
If SubLVs to be removed still exist after an image removing
conversion (i.e. "lvconvert --yes --force --stripes N "
with N < total stripes) any request to convert to a different
striped/raid* level has to be rejected until after those freed
SubLVs got removed by running the aforementioned lvconvert again.

Add tests to check conversion to striped/raid* gets rejected.
Enhance a test comment.

Related: rhbz1191935
Related: rhbz1366296
2017-03-17 13:58:54 +01:00