]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agocommands: clean up and unify signed option value handling
David Teigland [Tue, 7 Mar 2017 22:55:07 +0000 (16:55 -0600)]
commands: clean up and unify signed option value handling

Add new values for different sign variations, resulting in:

size_VAL      no sign accepted
ssize_VAL     accepts + or -
psize_VAL     accepts +
nsize_VAL     accpets -

extents_VAL   no sign accepted
sextents_VAL  accepts + or -
pextents_VAL  accepts +
nextents_VAL  accepts -

Depending on the command being run, change the option
values for --size, --extents, --poolmetadatasize to
use the appropriate value from above.

lvcreate uses no sign (but accepts + and ignores it).
lvresize accepts +|- for a relative change.
lvextend accepts + for a relative change.
lvreduce accepts - for a relative change.

7 years agoreport: fix segfault
Heinz Mauelshagen [Wed, 8 Mar 2017 17:31:20 +0000 (18:31 +0100)]
report: fix segfault

Commit f4b30b0daef3 which was about displaying visible
LV size when reshape space is allocated did not account
for undefined first lv segment.

7 years agocommands: combine duplicate arrays for lv types and props
David Teigland [Tue, 7 Mar 2017 18:08:23 +0000 (12:08 -0600)]
commands: combine duplicate arrays for lv types and props

Like opt and val arrays in previous commit, combine duplicate
arrays for lv types and props in command.c and lvmcmdline.c.
Also move the command_names array to be defined in command.c
so it's consistent with the others.

7 years agocommands: combine duplicate arrays for opt and val
David Teigland [Tue, 7 Mar 2017 17:47:44 +0000 (11:47 -0600)]
commands: combine duplicate arrays for opt and val

command.c and lvmcmdline.c each had a full array defining
all options and values.  This duplication was not removed
when the command.c code was merged into the run time.

7 years agohelp: avoid end notes repetition in lvm help all
David Teigland [Tue, 7 Mar 2017 18:01:06 +0000 (12:01 -0600)]
help: avoid end notes repetition in lvm help all

7 years agometadata: comments
Heinz Mauelshagen [Wed, 8 Mar 2017 14:13:59 +0000 (15:13 +0100)]
metadata: comments

log_count,nosync,stripes,stripe_size,,...  are also used for raid.

7 years agoraid: define seg->extents_copied
Heinz Mauelshagen [Tue, 7 Mar 2017 22:28:09 +0000 (23:28 +0100)]
raid: define seg->extents_copied

seg->extents_copied has to be defined properly on reducing
the size of a raid LV or conversion from raid5 with 1 stripe
to raid1 will fail.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agoreport: correct lv_size for 2-legged raid5
Heinz Mauelshagen [Tue, 7 Mar 2017 21:36:50 +0000 (22:36 +0100)]
report: correct lv_size for 2-legged raid5

Reshaping a raid5 LV to one stripe aiming to convert it to
raid1 (and optionally to linear) reports the wrong LV size
when still having reshape space allocated.

7 years agoraid: fix raid LV resizing
Heinz Mauelshagen [Tue, 7 Mar 2017 21:05:23 +0000 (22:05 +0100)]
raid: fix raid LV resizing

The lv_extend/_lv_reduce API doesn't cope with resizing RaidLVs
with allocated reshape space and ongoing conversions.  Prohibit
resizing during conversions and remove the reshape space before
processing resize.  Add missing seg->data_copies initialisation.

Fix typo/comment.

7 years agoraid: cleanup _lv_set_image_lvs_start_les()
Heinz Mauelshagen [Tue, 7 Mar 2017 20:55:19 +0000 (21:55 +0100)]
raid: cleanup _lv_set_image_lvs_start_les()

Avoid second loop.

7 years agolvconvert: adjust --stripes on raid10 convert
Heinz Mauelshagen [Tue, 7 Mar 2017 20:36:03 +0000 (21:36 +0100)]
lvconvert: adjust --stripes on raid10 convert

For the time being raid10 is limited to even number of total stripes
as is and 2 data copies.  The number of stripes provided on creation
of a raid10(_near) LV with -i/--stripes gets doubled to define
that even total number of stripes (i.e. images).

Apply the same on disk adding conversions (reshapes) with
"lvconvert --stripes RaidLV" (e.g. 2 stripes = 4 images
total converted to 3 stripes = 6 images total).

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agoreport: display proper LV size for reshapable RaidLVs
Heinz Mauelshagen [Tue, 7 Mar 2017 17:47:20 +0000 (18:47 +0100)]
report: display proper LV size for reshapable RaidLVs

Subtract reshape space when reporting visible lv_size on RaidLV.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agotest: add delay to lvchange-raid1-writemostly.sh
Heinz Mauelshagen [Tue, 7 Mar 2017 14:18:13 +0000 (15:18 +0100)]
test: add delay to lvchange-raid1-writemostly.sh

Commit 8ab072507706 introduced this new test.

Add a read delay to the PVs to avoid a race
in the script causing the test to fail.

Correct comment.

7 years agoman lvs: describe new 'R' volume health character
Heinz Mauelshagen [Mon, 6 Mar 2017 18:33:10 +0000 (19:33 +0100)]
man lvs: describe new 'R' volume health character

7 years agoman/help: improve stripes option wording
David Teigland [Mon, 6 Mar 2017 18:01:11 +0000 (12:01 -0600)]
man/help: improve stripes option wording

7 years agoman lvextend: mention segment type
David Teigland [Mon, 6 Mar 2017 17:27:56 +0000 (11:27 -0600)]
man lvextend: mention segment type

7 years agotest: fix typo
Heinz Mauelshagen [Fri, 3 Mar 2017 22:22:29 +0000 (23:22 +0100)]
test: fix typo

7 years agoman: move the full UNIT description
David Teigland [Fri, 3 Mar 2017 22:10:40 +0000 (16:10 -0600)]
man: move the full UNIT description

Part of the UNIT description was still living in the
--size description.  Move it to the Size[UNIT] description
since it is used by other options, not just --size.

7 years agoman/help: poolmetadatasize option can take relative value
David Teigland [Fri, 3 Mar 2017 21:57:51 +0000 (15:57 -0600)]
man/help: poolmetadatasize option can take relative value

In lvcreate/lvconvert, --poolmetdatasize can only be an
absolute value, but in lvresize/lvextend, --poolmetadatasize
can be given a + relative value.

The val types only currently support relative values that
go in both directions +|-.  Further work is needed to add
val types that can be relative in only one direction, and
switching various option values to one those depending on
the command name.  Then poolmetdatasize will not appear
with a +|- option in lvcreate/lvconvert, and will
appear with only the + option in lvresize/lvextend.

7 years agoreport: raid enhancements for --select
Heinz Mauelshagen [Fri, 3 Mar 2017 21:29:50 +0000 (22:29 +0100)]
report: raid enhancements for --select

Enhance the raid report functions for the recently added LV fields
reshape_len, reshape_len_le, data_offset, new_data_offset, data_copies,
data_stripes and parity_chunks to cope with "lvs --select".

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agoman: fix term in lvmraid(7)
Heinz Mauelshagen [Fri, 3 Mar 2017 21:24:13 +0000 (22:24 +0100)]
man: fix term in lvmraid(7)

Adjust commit af7c8e710663 to use "image/leg".

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agohelp: show short opt with long opt
David Teigland [Fri, 3 Mar 2017 21:12:46 +0000 (15:12 -0600)]
help: show short opt with long opt

e.g. show -n|--name instead of just --name

7 years agodev_manager: remove reshape message
Heinz Mauelshagen [Fri, 3 Mar 2017 21:10:21 +0000 (22:10 +0100)]
dev_manager: remove reshape message

The dm-raid target doesn't support a "reshape" message.

7 years agoman/help: rework extents and size output
David Teigland [Fri, 3 Mar 2017 20:21:36 +0000 (14:21 -0600)]
man/help: rework extents and size output

Clean up and correct the details around --extents and --size.

lvcreate/lvresize/lvreduce/lvextend all now display the
extents option in usages.

The Size and Number value variables for --size and --extents
are now displayed without the [+|-] prefix for lvcreate.

7 years agoman/help: improve the PV range description
David Teigland [Fri, 3 Mar 2017 17:07:49 +0000 (11:07 -0600)]
man/help: improve the PV range description

7 years agoargs: in cachemode option fix passthrough value
David Teigland [Fri, 3 Mar 2017 16:53:18 +0000 (10:53 -0600)]
args: in cachemode option fix passthrough value

7 years agoargs: update select description
David Teigland [Fri, 3 Mar 2017 15:53:11 +0000 (09:53 -0600)]
args: update select description

mention --select help and --options help.

7 years agoman lvcreate: show extents option
David Teigland [Thu, 2 Mar 2017 22:56:32 +0000 (16:56 -0600)]
man lvcreate: show extents option

Display --extents as an option in each cmd def,
in addition to the special notes about how
--size and --extents are alternatives.

7 years agoman lvcreate: remove the extents prefix
David Teigland [Thu, 2 Mar 2017 22:42:46 +0000 (16:42 -0600)]
man lvcreate: remove the extents prefix

This applies the same hack to --extents (dropping
the [+|-] prefix), as commit b7831fc14a did for --size.

7 years agohelp: show extents option for lvcreate
David Teigland [Thu, 2 Mar 2017 22:33:14 +0000 (16:33 -0600)]
help: show extents option for lvcreate

A special case is needed to display
--extents for lvcreate since the cmd defs
treat --extents as an automatic alternative
to --size (to avoid duplicating every cmd def).

7 years agohelp: print info about special options and variables
David Teigland [Thu, 2 Mar 2017 22:10:40 +0000 (16:10 -0600)]
help: print info about special options and variables

when --longhelp is used

7 years agolvcreate: munge size value in help output
David Teigland [Thu, 2 Mar 2017 20:33:50 +0000 (14:33 -0600)]
lvcreate: munge size value in help output

Add hack to omit the [+|-] from the --size
value.  Same hack exists in man generator.

7 years agoman: cover reshaping
Heinz Mauelshagen [Thu, 2 Mar 2017 21:24:19 +0000 (22:24 +0100)]
man: cover reshaping

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvs: enhance stripes and region size field descriptions
Heinz Mauelshagen [Thu, 2 Mar 2017 21:21:23 +0000 (22:21 +0100)]
lvs: enhance stripes and region size field descriptions

Now that we got the "data_stripes" field key, adjust the "stripes" field description.
Enhance the "regionsize" field description to cover raids as well.

7 years agoman: change the synopsis option style
David Teigland [Thu, 2 Mar 2017 20:08:59 +0000 (14:08 -0600)]
man: change the synopsis option style

Remove the required/optional words because it
should already be evident from the use of [ ].

7 years agolvcreate: allow chunksize option when creating cache
David Teigland [Thu, 2 Mar 2017 19:58:27 +0000 (13:58 -0600)]
lvcreate: allow chunksize option when creating cache

7 years agocommands: handle including an optional opt multiple times
David Teigland [Thu, 2 Mar 2017 19:52:06 +0000 (13:52 -0600)]
commands: handle including an optional opt multiple times

When a cmd def includes multiple sets of options (OO_FOO),
allow multiple OO_FOO sets to contain the same option and
avoid repeating it in the cmd def.

7 years agolvcreate/lvresize: the --size option accepts signed values
David Teigland [Thu, 2 Mar 2017 18:53:01 +0000 (12:53 -0600)]
lvcreate/lvresize: the --size option accepts signed values

There was confusion in the code about whether or not the
--size option accepted a sign.  Make it consistent and clear
that it does.

This exposes a new problem in that an option can only
accept one value type, e.g. --size can only accept a
signed number, it cannot accept a positive or negative
number for some commands and reject negative numbers for
others.

In practice, lvcreate accepts only positive --size
values and lvresize accepts positive or negative --size
values.  There is currently no way to encode this
difference.  Until that is fixed, the man page output
is hacked to avoid printing the [+|-] prefix for sizes
in lvcreate.

7 years agotools: Fix overriding of current_settings.
Alasdair G Kergon [Thu, 2 Mar 2017 16:41:41 +0000 (16:41 +0000)]
tools: Fix overriding of current_settings.

Settings specified in other command line args take precedence over
profiles and --config, which takes precedence over settings in actual
config files.

Since commit 1e2420bca85da9a37570871cd70192e9ae831786 ('commands: new
method for defining commands') commands like this:
  lvchange --config 'global/test=1' -ay vg
have been printing the 'TEST MODE' message, but nevertheless making
real changes.

7 years agocommands: adjust syntax error message
David Teigland [Thu, 2 Mar 2017 15:37:54 +0000 (09:37 -0600)]
commands: adjust syntax error message

7 years agoman lvchange: mention special activation vals
David Teigland [Thu, 2 Mar 2017 15:30:27 +0000 (09:30 -0600)]
man lvchange: mention special activation vals

used by lvmlockd and clvmd.

7 years agolvmdbustest.py: Remove un-used variable
Tony Asleson [Wed, 1 Mar 2017 23:29:40 +0000 (17:29 -0600)]
lvmdbustest.py:  Remove un-used variable

Not needed with new validation function.

7 years agolvmdbustest.py: Validate LV lookups
Tony Asleson [Wed, 1 Mar 2017 23:26:23 +0000 (17:26 -0600)]
lvmdbustest.py: Validate LV lookups

Ensure that the LV lookups work as expected for newly created LVs.

7 years agolvmdbustest.py: Validate PV device
Tony Asleson [Wed, 1 Mar 2017 23:24:08 +0000 (17:24 -0600)]
lvmdbustest.py: Validate PV device

Validate device lookup after PV creation.

7 years agolvmdbustest.py: Re-name validation function
Tony Asleson [Wed, 1 Mar 2017 23:22:32 +0000 (17:22 -0600)]
lvmdbustest.py: Re-name validation function

Make this name generic as we can use for different types.

7 years agolvmdbustest.py: Verify lookups work immediately after vg create
Tony Asleson [Wed, 1 Mar 2017 17:09:51 +0000 (11:09 -0600)]
lvmdbustest.py: Verify lookups work immediately after vg create

7 years agolvmdbustest.py: Use _lookup function
Tony Asleson [Wed, 1 Mar 2017 15:35:01 +0000 (09:35 -0600)]
lvmdbustest.py: Use _lookup function

Be consistent in using this helper function for dbus object lookups.

7 years agoman: fix typo
David Teigland [Wed, 1 Mar 2017 22:59:17 +0000 (16:59 -0600)]
man: fix typo

7 years agocommands: tweak some descriptions
David Teigland [Wed, 1 Mar 2017 22:50:27 +0000 (16:50 -0600)]
commands: tweak some descriptions

7 years agolvconvert: add new reporting fields for reshaping
Heinz Mauelshagen [Wed, 1 Mar 2017 18:30:52 +0000 (19:30 +0100)]
lvconvert: add new reporting fields for reshaping

Commit 48778bc5038f introduced new RAID reshaping related report fields.

The inclusioon of segtype.h in properties.c isn't mandatory, remove it.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: libdm RAID API compatibility versioning; remove new function
Heinz Mauelshagen [Wed, 1 Mar 2017 17:58:48 +0000 (18:58 +0100)]
lvconvert: libdm RAID API compatibility versioning; remove new function

Commit 80a6de616a19 versioned the dm_tree_node_add_raid_target_with_params()
and dm_tree_node_add_raid_target() APIs for compatibility reasons.

There's no user of the latter function, remove it.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add new reporting fields for reshaping
Heinz Mauelshagen [Wed, 1 Mar 2017 17:50:35 +0000 (18:50 +0100)]
lvconvert: add new reporting fields for reshaping

During an ongoing reshape, the MD kernel runtime reads stripes relative
to data_offset and starts storing the reshaped stripes (with new raid
layout and/or new stripesize  and/or new number of stripes) relative
to new_data_offset.  This is to avoid writing over any data in place
which is non-atomic by nature and thus be recoverable without data loss
in the transition.  MD uses the term out-of-place reshaping for it.

There's 2 other areas we don't have report capability for:
- number of data stripes vs. total stripes
  (e.g. raid6 with 7 stripes toal has 5 data stripes)
- number of (rotating) parity/syndrome chunks
  (e.g. raid6 with 7 stripes toal has 2 parity chunks; one
   per stripe for P-Syndrome and another one for Q-Syndrome)

Thus, add the following reportable keys:

- reshape_len      (in current units)
- reshape_len_le   (in logical extents)
- data_offset      (in sectors)
- new_data_offset  (     "    )
- data_stripes
- parity_chunks

Enhance lvchange-raid.sh, lvconvert-raid-reshape-linear_to_striped.sh,
lvconvert-raid-reshape-striped_to_linear.sh, lvconvert-raid-reshape.sh
and lvconvert-raid-takeover.sh to make use of new keys.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agoman: put some commands into advanced usage section
David Teigland [Tue, 28 Feb 2017 23:04:46 +0000 (17:04 -0600)]
man: put some commands into advanced usage section

and separate commands with --

7 years agocommands: SECONDARY flag changes in cmd defs
David Teigland [Tue, 28 Feb 2017 22:15:11 +0000 (16:15 -0600)]
commands: SECONDARY flag changes in cmd defs

Add/remove the SECONDARY_SYNTAX flag to cmd defs.
cmd defs with this flag will be listed under the
ADVANCED USAGE man page section, so that the main
USAGE section contains the most common commands
without distraction.

- When multiple cmd defs do the same thing, one variant
  can be displayed in the first list.
- Very advanced, unusual or uncommon commands should be
  in the second list.

7 years agoraid: rework _raid_target_present()
Heinz Mauelshagen [Wed, 1 Mar 2017 13:52:23 +0000 (14:52 +0100)]
raid: rework _raid_target_present()

Recently added check for reshaping in this function called for
a cleanup to avoid proliferating it with more explicit conditionals.

Base the reshaping check on the given _features array.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add missing reshape_len initialization
Heinz Mauelshagen [Tue, 28 Feb 2017 22:29:03 +0000 (23:29 +0100)]
lvconvert: add missing reshape_len initialization

An initialization was missing when converting striped to raid0(_meta)
causing unitialized reshape_len in the new component LVs first segment.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: adjust mininum region size check
Heinz Mauelshagen [Tue, 28 Feb 2017 22:09:30 +0000 (23:09 +0100)]
lvconvert: adjust mininum region size check

The imposed minimum region size can cause rejection on
disk removing reshapes.  Lower it to avoid that.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agohelp: print full usage for lvm help all
David Teigland [Tue, 28 Feb 2017 21:57:30 +0000 (15:57 -0600)]
help: print full usage for lvm help all

7 years agolvconvert: adjust reshaping check to target version
Heinz Mauelshagen [Tue, 28 Feb 2017 21:46:25 +0000 (22:46 +0100)]
lvconvert: adjust reshaping check to target version

https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-4.11&id=b08c6076782
sets the dm-raid target version to 1.10.1.

Adjust the condition to set RAID_RESHAPE_FEATURE to it.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: libdm RAID API compatibility versioning
Heinz Mauelshagen [Tue, 28 Feb 2017 21:34:00 +0000 (22:34 +0100)]
lvconvert: libdm RAID API compatibility versioning

Commit 27384c52cf6a lowered the maximum number of devices
back to 64 for compatibility.

Because more members have been added to the API in
'struct dm_tree_node_raid_params *', we have to version
the public libdm RAID API to not break any existing users.

Changes:

- keep the previous 'struct dm_tree_node_raid_params' and
  dm_tree_node_add_raid_target_with_params()/dm_tree_node_add_raid_target()
  in order to expose the already released public RAID API

- introduce 'struct dm_tree_node_raid_params_v2' and additional functions
  dm_tree_node_add_raid_target_with_params_v2()/dm_tree_node_add_raid_target_v2()
  to be used by the new lvm2 lib reshape extentions

With this new API, the bitfields for rebuild/writemostly legs in
'struct dm_tree_node_raid_params_v2' can be raised to 256 bits
again (253 legs maximum supported in MD kernel).

Mind that we can limit the maximum usable number via the
DEFAULT_RAID{1}_MAX_IMAGES definition in defaults.h.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agocommands: include lvconvert cache options as group
David Teigland [Tue, 28 Feb 2017 19:47:46 +0000 (13:47 -0600)]
commands: include lvconvert cache options as group

7 years agoman: fix syntax for PV ranges
David Teigland [Tue, 28 Feb 2017 18:22:12 +0000 (12:22 -0600)]
man: fix syntax for PV ranges

7 years agocommands: remove lvconvert raid rule
David Teigland [Mon, 27 Feb 2017 23:06:08 +0000 (17:06 -0600)]
commands: remove lvconvert raid rule

A raid0 LV also needs to be converted to other
raid levels, so this rule should be removed entirely.

7 years agoman: mention regionsize default is in lvm.conf
David Teigland [Mon, 27 Feb 2017 23:05:20 +0000 (17:05 -0600)]
man: mention regionsize default is in lvm.conf

7 years agocommands: fix lvconvert raid rule
David Teigland [Mon, 27 Feb 2017 22:33:38 +0000 (16:33 -0600)]
commands: fix lvconvert raid rule

Recent rule change was incorrect.
We want to allow 'lvconvert --type raid' on raid1 LVs.

7 years agocommands: fixes for recent raid changes
David Teigland [Fri, 24 Feb 2017 22:43:05 +0000 (16:43 -0600)]
commands: fixes for recent raid changes

- Combine the equivalent lvconvert --type raid defs.
  (Two cmd defs must be different without relying
  on LV type, which are not known at the time the
  cmd def is matched.)

- Remove unused optional options from lvconvert --stripes,
  and lvconvert --stripesize.

- Use Number for --stripes_long val type.

- Combine the cmd def for raid reshape cleanup into the
  existing start_poll cmd def (they were duplicate defs).
  Calls into the raid code from a poll opertion will be
  added.

7 years agolvconvert: limit libdm to maximum of 64 RAID devices
Heinz Mauelshagen [Mon, 27 Feb 2017 20:42:15 +0000 (21:42 +0100)]
lvconvert: limit libdm to maximum of 64 RAID devices

Commit 64a2fad5d6c6 raised the maximum number of RAID devices to 64.

Commit e2354ea344c2 introduced RAID_BITMAP_SIZE as 4 to have
256 bits (4 * 64 bit array members), thus changing the libdm API
unnecessarilly for the time being.

To not change the API, reduce RAID_BITMAP_SIZE to 1.
Remove an unneeded definition of it from libdm-common.h.

If we ever decide to raise past 64, we'll version the API.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agogit: Upstream repository moved to sourceware.org
Alasdair G Kergon [Mon, 27 Feb 2017 13:52:51 +0000 (13:52 +0000)]
git: Upstream repository moved to sourceware.org

The fedorahosted git repository shuts down tomorrow:
  https://communityblog.fedoraproject.org/fedorahosted-sunset-2017-02-28/

Our upstream git repository has moved back to sourceware.org.
Mailing list hosting is not changing.

Gitweb:
  https://www.sourceware.org/git/?p=lvm2

Git:
  git://sourceware.org/git/lvm2.git
  ssh://sourceware.org/git/lvm2.git
  http://sourceware.org/git/lvm2.git

Example command to change the origin of a repository clone:
  Public:
    git remote set-url origin git://sourceware.org/git/lvm2.git
  Committers:
    git remote set-url origin git+ssh://sourceware.org/git/lvm2.git

7 years agoman: change option sorting in synopsis
David Teigland [Fri, 24 Feb 2017 21:11:18 +0000 (15:11 -0600)]
man: change option sorting in synopsis

The options list was sorted as:
- options with both long and short forms, alphabetically
- options with only long form, alphabetically

This was done only for the visual effect.  Change to
sort alphabetically by long opt, without regard to
short forms.

7 years agoman: add ENVIRONMENT VARIABLES section
David Teigland [Fri, 24 Feb 2017 21:05:17 +0000 (15:05 -0600)]
man: add ENVIRONMENT VARIABLES section

7 years agolvconvert: fix handling args in combining snapshots
David Teigland [Fri, 24 Feb 2017 20:17:58 +0000 (14:17 -0600)]
lvconvert: fix handling args in combining snapshots

Fixes commit 286d39ee3c433, which was correct except
for a reversed strstr.  Now uses strchr, and modifies
a copy of the name so the original argv is preserved.

7 years agoman: use Size variable for a number with unit
David Teigland [Fri, 24 Feb 2017 19:44:05 +0000 (13:44 -0600)]
man: use Size variable for a number with unit

Define a separate variable type Size to represent
a number that takes an optional UNIT.

7 years agolvconvert: impose region size constraints
Heinz Mauelshagen [Fri, 24 Feb 2017 06:27:43 +0000 (07:27 +0100)]
lvconvert: impose region size constraints

When requesting a regionsize change during conversions, check
for constraints or the command may fail in the kernel n case
the region size is too smalle or too large thus leaving any
new SubLVs behind.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: fix 2 issues identified in intesting
Heinz Mauelshagen [Fri, 24 Feb 2017 04:58:45 +0000 (05:58 +0100)]
lvconvert: fix 2 issues identified in intesting

Allow regionsize on upconvert from linear:
fix related commit 2574d3257ad41 to actually work

Related: rhbz1394427

Remove setting raid5_n on conversions from raid1
as of commit 932db3db5357 because any raid5 mapping
may be requested.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agoWHATS_NEW: add entry
Heinz Mauelshagen [Fri, 24 Feb 2017 04:24:59 +0000 (05:24 +0100)]
WHATS_NEW: add entry

7 years agolvconvert: add missed new test scripts for reshaping
Heinz Mauelshagen [Fri, 24 Feb 2017 04:16:21 +0000 (05:16 +0100)]
lvconvert: add missed new test scripts for reshaping

Add aforementioned but forgotten new test scripts
lvconvert-raid-reshape-linear_to_striped.sh,
lvconvert-raid-reshape-striped_to_linear.sh and
lvconvert-raid-reshape.sh

Those presume dm-raid target version 1.10.2
provided by a following kernel patch.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: allow regionsize on upconvert from linear
Heinz Mauelshagen [Fri, 24 Feb 2017 04:00:55 +0000 (05:00 +0100)]
lvconvert: allow regionsize on upconvert from linear

Allow to provide regionsize with "lvconvert -m1 -R N " on
upconverts from linear and on N -> M raid1 leg conversions.

Resolves: rhbz1394427

7 years agolvconvert/lvcreate: raise maximum number of raid images
Heinz Mauelshagen [Fri, 24 Feb 2017 03:41:46 +0000 (04:41 +0100)]
lvconvert/lvcreate: raise maximum number of raid images

Because of contraints in renaming shifted rimage/rmeta LV names
the current RaidLV limit is a maximum of 10 SubLV pairs.

With the previous introduction of reshaping infratructure that
constriant got removed.

Kernel supports 253 since dm-raid target 1.9.0, older kernels 64.

Raise the maximum number of RaidLV rimage/rmeta pairs to 64.
If we want to raise past 64, we have to introdce a check for
the kernel supporting it in lvcreate/lvconvert.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 03:36:03 +0000 (04:36 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces the changes to call the reshaping infratructure
from lv_raid_convert().

Changes:
- add reshaping calls from lv_raid_convert()
- add command definitons for reshaping to tools/command-lines.in
- fix raid_rimage_extents()
- add 2 new test scripts lvconvert-raid-reshape-linear_to_striped.sh
  and lvconvert-raid-reshape-striped_to_linear.sh to test
  the linear <-> striped multi-step conversions
- add lvconvert-raid-reshape.sh reshaping tests
- enhance lvconvert-raid-takeover.sh with new raid10 tests

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 03:00:17 +0000 (04:00 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Change:
- allow raid_rimage_extents() to calculate raid10
- remove an __unused__ attribute

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 02:56:10 +0000 (03:56 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Change:
- add missing raid1 <-> raid5 conversions to support
  linear <-> raid5 <-> raid0(_meta)/striped conversions
- rename related new takeover functions to
  _takeover_from_raid1_to_raid5 and _takeover_from_raid5_to_raid1,
  because a reshape to > 2 legs is only possible with
  raid5 layout

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 02:46:14 +0000 (03:46 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Change:
- enhance _clear_meta_lvs() to support raid0 allowing
  raid0_meta -> raid10 conversions to succeed by clearing
  the raid0 rmeta images or the kernel will fail because
  of discovering reordered raid devices

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 02:37:12 +0000 (03:37 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Changes:
- enhance _raid45610_to_raid0_or_striped_wrapper() to support
  raid5_n with 2 areas to raid1 conversion to allow for
  striped/raid0(_meta)/raid4/5/6 -> raid1/linear conversions;
  rename it to _takeover_downconvert_wrapper to discontinue the
  illegible function name
- enhance _striped_or_raid0_to_raid45610_wrapper()  to support
  raid1 with 2 areas to raid5* conversions to allow for
  linear/raid1 -> striped/raid0(_meta)/raid4/5/6 conversions;
  rename it to _takeover_upconvert_wrapper for the same reason

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 02:11:41 +0000 (03:11 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Changes:
- add missing possible reshape conversions and conversion options
  to allow/prohibit changing stripesize or number fo stripes
- enhance setting convenient riad types in reshape conversions
  (e.g. raid1 with 2 legs -> radi5_n)

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 01:53:18 +0000 (02:53 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Changes:
- add _raid_reshape() using the pre/post callbacks and
  the stripes add/remove reshape functions introduced before
- and _reshape_requested function checking if a reshape
  was requested

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 01:39:04 +0000 (02:39 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Changes:
- add vg metadata update functions
- add pre and post activation callback functions for
  proper sequencing of sub lv activations during reshaping
- move and enhance _lv_update_reload_fns_reset_eliminate_lvs()
  to support pre and post activation callbacks
- add _reset_flags_passed_to_kernel() which resets anyxi
  rebuild/reshape flags after they have been passed into the kernel
  and sets the SubLV remove after reshape flags on legs to be removed

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 01:12:30 +0000 (02:12 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Changes:
- add function to support disk adding reshapes
- add function to support disk removing reshapes
- add function to support layout (e.g. raid5ls -> raid5_rs)
  or stripesize reshaping

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 01:05:36 +0000 (02:05 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Changes:
- add function providing state of a reshaped RaidLV
- add function to adjust the size of a RaidLV was
  reshaped to add/remove stripes

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 00:57:04 +0000 (01:57 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces more local infrastructure to raid_manip.c
used by followup patches.

Changes:
- add lv_raid_data_copies returning raid type specific number;
  needed for raid10 with more than 2 data copies
- remove _shift_and_rename_image_components() constraint
  to support more than 10 raid legs
- add function to calculate total rimage length used by out-of-place
  reshape space allocation
- add out-of-place reshape space alloc/relocate/free functions
- move _data_rimages_count() used by reshape space alloc/realocate functions

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agoraid: typo
Heinz Mauelshagen [Fri, 24 Feb 2017 00:29:37 +0000 (01:29 +0100)]
raid: typo

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Fri, 24 Feb 2017 00:18:38 +0000 (01:18 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces local infrastructure to raid_manip.c
used by followup patches.

Add functions:
- to check reshaping is supported in target attibute
- to return device health string needed to check
  the raid device is ready to reshape

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agolvconvert: add infrastructure for RaidLV reshaping support
Heinz Mauelshagen [Thu, 23 Feb 2017 23:50:00 +0000 (00:50 +0100)]
lvconvert: add infrastructure for RaidLV reshaping support

In order to support striped raid5/6/10 LV reshaping (change
of LV type, stripesize or number of legs), this patch
introduces infrastructure prerequisites to be used
by raid_manip.c extensions in followup patches.

This base is needed for allocation of out-of-place
reshape space required by the MD raid personalities to
avoid writing over data in-place when reading off the
current RAID layout or number of legs and writing out
the new layout or to a different number of legs
(i.e. restripe)

Changes:
- add members reshape_len to 'struct lv_segment' to store
  out-of-place reshape length per component rimage
- add member data_copies to struct lv_segment
  to support more than 2 raid10 data copies
- make alloc_lv_segment() aware of both reshape_len and data_copies
- adjust all alloc_lv_segment() callers to the new API
- add functions to retrieve the current data offset (needed for
  out-of-place reshaping space allocation) and the devices count
  from the kernel
- make libdm deptree code aware of reshape_len
- add LV flags for disk add/remove reshaping
- support import/export of the new 'struct lv_segment' members
- enhance lv_extend/_lv_reduce to cope with reshape_len
- add seg_is_*/segtype_is_* macros related to reshaping
- add target version check for reshaping
- grow rebuilds/writemostly bitmaps to 246 bit to support kernel maximal
- enhance libdm deptree code to support data_offset (out-of-place reshaping)
  and delta_disk (legs add/remove reshaping) target arguments

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agoman: improve line breaks
David Teigland [Thu, 23 Feb 2017 23:06:42 +0000 (17:06 -0600)]
man: improve line breaks

Borrow tricks from dmsetup man page to improve
the line break and indentation using .ad l, .ad b,
and soft break \%.

7 years agoman/help: change syntax to UNIT
David Teigland [Thu, 23 Feb 2017 20:24:28 +0000 (14:24 -0600)]
man/help: change syntax to UNIT

(Change to recent commit 3f4ecaf8c2.)

Use --foo Number[k|UNIT] to indicate that
the default units of the number is k, but other
units listed below are also accepted.

Previously, underlined/italic Unit was used,
like other of variables, but this UNIT is more
like a shortcut than an actual variable.

7 years agolvchange: reject writemostly/writebehind on raid1 during resync sourceware_master
Heinz Mauelshagen [Thu, 23 Feb 2017 14:09:29 +0000 (15:09 +0100)]
lvchange: reject writemostly/writebehind on raid1 during resync

The MD kernel raid1 personality does no use any writemostly leg as the primary.

In case a previous linear LV holding data gets upconverted to
raid1 it becomes the primary leg of the new raid1 LV and a full
resynchronization is started to update the new legs.

No writemostly and/or writebehind setting may be allowed during
this initial, full synchronization period of this new raid1 LV
(using the lvchange(8) command), because that would change the
primary (i.e the previous linear LV) thus causing data loss.

lvchange has a bug not preventing this scenario.

Fix rejects setting writemostly and/or writebehind on resychronizing raid1 LVs.

Once we have status in the lvm2 metadata about the linear -> raid upconversion,
we may relax this constraint for other types of resynchronization
(e.g. for user requested "lvchange --resync ").

New lvchange-raid1-writemostly.sh test is added to the test suite.

Resolves: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855895

7 years agoman/help: improve the style of units indicator
David Teigland [Wed, 22 Feb 2017 22:50:30 +0000 (16:50 -0600)]
man/help: improve the style of units indicator

We use --foo Number[k|Units] to indicate that
the default units of the number is k, but other
units listed below are also accepted.

Capitalize and underline Units so it is consistent
with other variables, and reference it at the end.

Technically, the k should be bold, but this
tends to make the text visually hard to read
because of the excessive highlights scattered
everywhere.  So it's left normal text for now
(it's unlikely to confuse anyone.)

7 years agoman: indicate repeatable options
David Teigland [Wed, 22 Feb 2017 22:38:54 +0000 (16:38 -0600)]
man: indicate repeatable options

Print ... after a repeatable option in the OPTIONS section.
An alternative would be to just mention in the text description
that the option is repeatable.

7 years agoman: improve writemostly PV arg
David Teigland [Wed, 22 Feb 2017 21:20:44 +0000 (15:20 -0600)]
man: improve writemostly PV arg

7 years agotests: support zero_dev
Zdenek Kabelac [Wed, 22 Feb 2017 14:16:20 +0000 (15:16 +0100)]
tests: support zero_dev

When the test would need to try to write some large amount of data
we can give it 'zero' segments - for obvious reason such written data
can't be verified but in some test cases it doesn't really matter.

Usage follows  'error_dev' style.

For now test suite is not supporting any combination of
error/delay/zero segments so only 1 type could be used per PV.

7 years agotests: not slowing work with metadata
Zdenek Kabelac [Tue, 21 Feb 2017 12:06:00 +0000 (13:06 +0100)]
tests: not slowing work with metadata

Slows only data extents on a PV.

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