]> sourceware.org Git - lvm2.git/log
lvm2.git
7 years agoparser: enable --metadataprofile for pool lvconvert
Zdenek Kabelac [Fri, 10 Mar 2017 12:02:55 +0000 (13:02 +0100)]
parser: enable --metadataprofile for pool lvconvert

Lvconvert can use values from profile when caching.

7 years agoparser: allow --zero for pool conversion
Zdenek Kabelac [Fri, 3 Mar 2017 10:31:31 +0000 (11:31 +0100)]
parser: allow --zero for pool conversion

7 years agolvconvert: share function for cache params
Zdenek Kabelac [Mon, 27 Feb 2017 13:54:08 +0000 (14:54 +0100)]
lvconvert: share function for cache params

Reuse same code for getting/setting cache parameters with lvcreate.

So there is single one place how to get vars from profiles and configs.

Variables declarations are moved to start of function and
there is no need to initialize them as they are always
defined by functions get_cache_params() and get_pool_params().

7 years agolvcreate: do not round cache volumes on cache chunks
Zdenek Kabelac [Thu, 9 Mar 2017 16:15:56 +0000 (17:15 +0100)]
lvcreate: do not round cache volumes on cache chunks

Since cache chunk might be huge and there is no technical need
to enforce rounding and there is actually more 'real' VG space
used then necessary - keep rounding on 'chunk' bounrary only
for thin volumes - where it's the space used anyway.

NB: we support conversion of any-size 'existing' LV into cached LV.

7 years agolvcreate: respecting profile settings
Zdenek Kabelac [Fri, 10 Mar 2017 12:04:30 +0000 (13:04 +0100)]
lvcreate: respecting profile settings

7 years agocache: extend usability of cache_set_params
Zdenek Kabelac [Mon, 27 Feb 2017 13:53:45 +0000 (14:53 +0100)]
cache: extend usability of cache_set_params

Fix missing reset of '*settings' pointer when no args were given.

Handle cache_chunk settings like all other settings, so it is properly
updated only with non-zero settings and the existing cache-pool
chunk_size is not being reconfigured.

7 years agocache: improve support for profile for cache settings
Zdenek Kabelac [Sun, 5 Mar 2017 16:42:15 +0000 (17:42 +0100)]
cache: improve support for profile for cache settings

User can specify metadata profile which stores important cache
geometry data for easy configuration.

Fix missing support for getting chunk_size, cache_mode, cache_policy
for a cache/cache pools volumes from configuration or metadata profile.

7 years agocache: get and set cache params
Zdenek Kabelac [Thu, 9 Mar 2017 15:20:44 +0000 (16:20 +0100)]
cache: get and set cache params

7 years agolvconvert: replacing with goto
Zdenek Kabelac [Thu, 9 Mar 2017 17:10:35 +0000 (18:10 +0100)]
lvconvert: replacing with goto

Split-off patch that just replaces returns with 'goto bad'
so there is single place to release  policy_settings.

In the next patch we will start to use some shared
function call between lvconvert and lvcreate
(effectively restoring previous logic which has got lost).

7 years agocache: set chunk_size as first param
Zdenek Kabelac [Thu, 9 Mar 2017 14:54:30 +0000 (15:54 +0100)]
cache: set chunk_size as first param

7 years agocache: use UNSELECTED enum
Zdenek Kabelac [Fri, 3 Mar 2017 13:52:32 +0000 (14:52 +0100)]
cache: use UNSELECTED enum

Switch from _UNDEFINED to _UNSELECTED which is more describing
its value 0, while value -1 is better match for UNDEFINED.

7 years agothin: add new ZERO/DISCARDS_UNSELECTED
Zdenek Kabelac [Fri, 3 Mar 2017 19:46:13 +0000 (20:46 +0100)]
thin: add new ZERO/DISCARDS_UNSELECTED

To more easily recognize unselected state from select '0' state
add new 'THIN_ZERO_UNSELECTED' enum.
Same applies to THIN_DISCARDS_UNSELECTED.

For those we no longer need to use PASS_ARG_ZERO or PASS_ARG_DISCARDS.

7 years agopool: drop duplicated sign test
Zdenek Kabelac [Thu, 9 Mar 2017 16:09:31 +0000 (17:09 +0100)]
pool: drop duplicated sign test

Avoid duplicate testing of '-' sign.
Already checked with arg_from_list_is_negative().

7 years agopool: split chunk size validation
Zdenek Kabelac [Sun, 5 Mar 2017 16:41:16 +0000 (17:41 +0100)]
pool: split chunk size validation

Move cache and thin bits into their respective manipulation files.
When possible directly call respective chunk_size validator.

7 years agothin: getting default chunk_size from single place
Zdenek Kabelac [Wed, 1 Mar 2017 10:23:26 +0000 (11:23 +0100)]
thin: getting default chunk_size from single place

Basically code moving operation to have a single place resolving
thin_pool_chunk_size_policy.

Supported are generic & performance profiles.

Function is now shared between thin manipulation code and configuration
_CFG logic to obtain defaults and handle correct reporting upward coding
stack.

7 years agocache: properly translate DM_THIN_DISCARDS
Zdenek Kabelac [Tue, 7 Mar 2017 22:55:08 +0000 (23:55 +0100)]
cache: properly translate DM_THIN_DISCARDS

DM status uses DM defines which need to be translated to LVM enum.

7 years agolvcreate: avoid rejecting --metadataprofile
Zdenek Kabelac [Thu, 2 Mar 2017 22:02:28 +0000 (23:02 +0100)]
lvcreate: avoid rejecting  --metadataprofile

Likely user normaly have used 'shortcut' --profile option which
is (for lvcreate) decoded as metadataprofile.

However full option was rejected.

7 years agolvconvert: validate name before prompt
Zdenek Kabelac [Fri, 24 Feb 2017 11:56:40 +0000 (12:56 +0100)]
lvconvert: validate name before prompt

Before prompting make sure name fits.

7 years agolvconvert: indent and code simplification
Zdenek Kabelac [Fri, 24 Feb 2017 11:52:19 +0000 (12:52 +0100)]
lvconvert: indent and code simplification

Simple modifications to existing  _lvconvert_to_pool().

7 years agoraid: enhance lv_raid_convert() header relative to reshaping
Heinz Mauelshagen [Fri, 10 Mar 2017 18:26:02 +0000 (19:26 +0100)]
raid: enhance lv_raid_convert() header relative to reshaping

7 years agolvcreate: fix "striped" limit
Heinz Mauelshagen [Fri, 10 Mar 2017 17:57:06 +0000 (18:57 +0100)]
lvcreate: fix "striped" limit

Fix regression limiting number of stripes to 8.
Raise back to 128 as before.

Resolves: rhbz1389546

7 years agocommands: fix missing skip condition in coverity fixes
David Teigland [Fri, 10 Mar 2017 17:49:24 +0000 (11:49 -0600)]
commands: fix missing skip condition in coverity fixes

Fix for commit 5e6ea4b7

7 years agodaemons: use DEFAULT_PROC_DIR in dmfilemapd
Bryn M. Reeves [Fri, 10 Mar 2017 17:25:11 +0000 (17:25 +0000)]
daemons: use DEFAULT_PROC_DIR in dmfilemapd

Include defaults.h and use it to obtain the default procfs mount
point in dmfilemapd.

7 years agodaemons: cleanup dmeventd references from dmfilemapd/Makefile.in
Bryn M. Reeves [Fri, 10 Mar 2017 17:12:04 +0000 (17:12 +0000)]
daemons: cleanup dmeventd references from dmfilemapd/Makefile.in

7 years agocommands: coverity fixes
David Teigland [Fri, 10 Mar 2017 16:19:21 +0000 (10:19 -0600)]
commands: coverity fixes

7 years agolibdm: use correct value for NR_FILEMAPD_ARGS
Bryn M. Reeves [Fri, 10 Mar 2017 16:52:27 +0000 (16:52 +0000)]
libdm: use correct value for NR_FILEMAPD_ARGS

The argument count for the file mapping daemon needs to account
for the program's name in argv[0] to avoid indexing off the end
of the argument array.

7 years agodmsetup: always initialise 'dms' in _stats_update_file()
Bryn M. Reeves [Fri, 10 Mar 2017 16:44:08 +0000 (16:44 +0000)]
dmsetup: always initialise 'dms' in _stats_update_file()

7 years agolibdm: make dm_stats_destroy(NULL) a no-op
Bryn M. Reeves [Fri, 10 Mar 2017 16:41:28 +0000 (16:41 +0000)]
libdm: make dm_stats_destroy(NULL) a no-op

Test for NULL in dm_stats_destroy() and return immediately if
the struct dm_stats pointer is NULL (similar to free(NULL)).

This simplifies cleanup code which otherwise needs to:

  out:
    if (dms)
        dm_stats_destroy(dms);
    return;

7 years agolibdm: dm_stats_start_filemapd() mode can never be < 0
Bryn M. Reeves [Fri, 10 Mar 2017 14:42:23 +0000 (14:42 +0000)]
libdm: dm_stats_start_filemapd() mode can never be < 0

7 years agoraid: fix compile time warning
Heinz Mauelshagen [Fri, 10 Mar 2017 13:43:37 +0000 (14:43 +0100)]
raid: fix compile time warning

7 years agoman: add man-generator and build artefacts to .gitignore
Bryn M. Reeves [Fri, 10 Mar 2017 13:14:02 +0000 (13:14 +0000)]
man: add man-generator and build artefacts to .gitignore

7 years agotools: add generated headers to .gitignore
Bryn M. Reeves [Fri, 10 Mar 2017 13:13:41 +0000 (13:13 +0000)]
tools: add generated headers to .gitignore

7 years agodmsetup: always initialise 'mode' in filemap create functions
Bryn M. Reeves [Fri, 10 Mar 2017 12:04:02 +0000 (12:04 +0000)]
dmsetup: always initialise 'mode' in filemap create functions

Older compilers cannot tell that the 'mode' variable is only
used in branches in which it is assigned:

dmsetup.c:5651: warning: "mode" may be used uninitialized in this function
dmsetup.c:5023: warning: "mode" may be used uninitialized in this function

Avoid this by always assigning the variable a value.

7 years agolibdm: move initialisation of group_id in _aggregate_histogram()
Bryn M. Reeves [Fri, 10 Mar 2017 11:45:08 +0000 (11:45 +0000)]
libdm: move initialisation of group_id in _aggregate_histogram()

Older compilers are not able to determine that although group_id
is only assigned in one branch of a conditional, it is never used
used when the other branch is taken:

  libdm-stats.c:3319: warning: "group_id" may be used uninitialized in this function

Avoid this by always initialising the variable when it is
declared.

7 years agolvmdbustest.py: Correct debug & assert order
Tony Asleson [Thu, 9 Mar 2017 22:07:14 +0000 (16:07 -0600)]
lvmdbustest.py: Correct debug & assert order

If we do the assert first we won't get to the print statement.

7 years agolvmdbustest.py: Correct call_lvm doc
Tony Asleson [Thu, 9 Mar 2017 22:06:24 +0000 (16:06 -0600)]
lvmdbustest.py: Correct call_lvm doc

7 years agolvmdbusd: Simplify add_no_notify for loop
Tony Asleson [Thu, 9 Mar 2017 22:06:00 +0000 (16:06 -0600)]
lvmdbusd: Simplify add_no_notify for loop

7 years agolvmdbusd: Correct utils.add_no_notify doc
Tony Asleson [Thu, 9 Mar 2017 22:04:24 +0000 (16:04 -0600)]
lvmdbusd: Correct utils.add_no_notify doc

7 years agolvmdbusd: Add debug message to lvm ID lookup
Tony Asleson [Thu, 9 Mar 2017 22:03:20 +0000 (16:03 -0600)]
lvmdbusd: Add debug message to lvm ID lookup

7 years agolvmdbustest.py: Add unit test for external PV create
Tony Asleson [Wed, 8 Mar 2017 21:52:48 +0000 (15:52 -0600)]
lvmdbustest.py: Add unit test for external PV create

Ensure a PV created outside of the dbus service is immediately found by
service user.

7 years agolvmdbustest.py: Add unit test for external LV create
Tony Asleson [Wed, 8 Mar 2017 21:52:30 +0000 (15:52 -0600)]
lvmdbustest.py: Add unit test for external LV create

Ensure a LV created outside of the dbus service is immediately found by
service user.

7 years agolvmdbustest.py: Add unit test for external VG create
Tony Asleson [Wed, 8 Mar 2017 21:50:46 +0000 (15:50 -0600)]
lvmdbustest.py: Add unit test for external VG create

Ensure a VG created outside of the dbus service is immediately found by
service user.

7 years agolvmdbustest.py: Remove un-used `import time`
Tony Asleson [Wed, 8 Mar 2017 21:49:40 +0000 (15:49 -0600)]
lvmdbustest.py: Remove un-used `import time`

7 years agolvmdbusd: Correct src doc for Manager.UseLvmShell
Tony Asleson [Wed, 8 Mar 2017 21:37:08 +0000 (15:37 -0600)]
lvmdbusd: Correct src doc for Manager.UseLvmShell

It returns a boolean.

7 years agolvmdbusd: Disable notify_dbus for service command use
Tony Asleson [Wed, 8 Mar 2017 21:35:53 +0000 (15:35 -0600)]
lvmdbusd: Disable notify_dbus for service command use

Utilizing the --config option  we will utilize global/notify_dbus=0 so
that the service itself doesn't generate change events which it then needs to
process.

7 years agolvmdbusd: Use work queue for queries too
Tony Asleson [Wed, 8 Mar 2017 21:31:45 +0000 (15:31 -0600)]
lvmdbusd: Use work queue for queries too

We need to place query operations in the queue to prevent the case where
a client knows of something before the service does.  For example if a
client creates a PV/VG/LV outside of the dbus API and then immediately
tries to lookup and use that resource in the lvm dbus service it should
be present.  By placing the queries in the work queue any previous
refresh operation will complete before we process the query.

7 years agolvmdbusd: Add FlightRecorderDump
Tony Asleson [Wed, 8 Mar 2017 19:32:20 +0000 (13:32 -0600)]
lvmdbusd: Add FlightRecorderDump

Diagnostic method for dumping flight recorder to syslog.

7 years agolvconvert: add raid1 <-> raid4 conversion
Heinz Mauelshagen [Thu, 9 Mar 2017 22:17:13 +0000 (23:17 +0100)]
lvconvert: add raid1 <-> raid4 conversion

In addition to the already supported conversion between 2-legged
raid1 and raid5, raid1 and raid4 can be also converted into each
other with 2 legs (raid4/5 are limited to map a 2-legged raid1).

This patch supports the missing raid4 conversion in the sequence
linear -> 2-legged raid1 -> raid4/5, then restripe to more than one
data stripes for performance and resilience reasons and optionally
convert to striped/raid0.

The other conversion sequence is also possible by converting N-way
striped/raid0 to raid4/5, then restripe to 2 legs followed by a
conversion to raid1 and optionally to linear (loosing all resilience).

7 years agoman: add more examples to lvmraid(7)
Heinz Mauelshagen [Thu, 9 Mar 2017 21:26:22 +0000 (22:26 +0100)]
man: add more examples to lvmraid(7)

Add examples for reshaping number of stripes
and converting from raid6 to striped to raid10.

Remove trailing spaces.

Related: rhbz834579
Related: rhbz1191935
Related: rhbz1191978

7 years agodmfilemapd: always set the program_id after listing regions
Bryn M. Reeves [Thu, 9 Mar 2017 21:14:50 +0000 (21:14 +0000)]
dmfilemapd: always set the program_id after listing regions

The filemap daemon takes its program_id from the regions it is
managing: use DM_STATS_ALL_PROGRAMS when retrieving an initial
listing and then obtain the correct program_id from the group
leader.

7 years agolibdm: don't nest FIEMAP and DMFILEMAPD ifdefs
Bryn M. Reeves [Thu, 9 Mar 2017 21:13:51 +0000 (21:13 +0000)]
libdm: don't nest FIEMAP and DMFILEMAPD ifdefs

7 years agoconfigure: make --enable-dmfilemapd require fiemap.h
Bryn M. Reeves [Thu, 9 Mar 2017 21:12:53 +0000 (21:12 +0000)]
configure: make --enable-dmfilemapd require fiemap.h

7 years agoraid: add missing lv_merge_segments() call
Heinz Mauelshagen [Thu, 9 Mar 2017 21:18:34 +0000 (22:18 +0100)]
raid: add missing lv_merge_segments() call

On conversion from striped to raid0, data LVs are created
and all segments and their respective areas of the striped
LV are moved across to new segments allocated for the raid0
image LVs.  This can cause non-canonical segments to be added
to the image LVs.

Add a call to lv_merge_segments() once all segments have been
added to an image LV to compensate for that.  This avoids
unsafe table loads on activation.

Fix comments.

7 years agodmeventd: (workaround) fix mirror DSO to work with lvmetad
Heinz Mauelshagen [Thu, 9 Mar 2017 19:41:07 +0000 (20:41 +0100)]
dmeventd: (workaround) fix mirror DSO to work with lvmetad

Automatic dmeventd repair of mirrors with active lvmetad configured
(mirror_image_fault_policy = "allocate") fails because the lvscan
run before the repair in the mirror DSO does not update the
lvmetad cache properly thus "lvconvert --repair ..." fails.

Need to scan the mirror LV before and after the repair
to have proper cache content after the repair finished.
The cache can't be relied on or the repair will fail.

Resolves: rhbz1380521

7 years agoman: add FILE MAPPING section to dmstats.8.in
Bryn M. Reeves [Sun, 18 Dec 2016 18:14:04 +0000 (18:14 +0000)]
man: add FILE MAPPING section to dmstats.8.in

Add a section to explain file mapping, outside of the individual
command descriptions, and to describe the limitations of the
current update strategy.

7 years agoman: add dmfilemapd options to dmstats.8.in
Bryn M. Reeves [Sat, 17 Dec 2016 16:41:00 +0000 (16:41 +0000)]
man: add dmfilemapd options to dmstats.8.in

Add descriptions of --follow and --nomonitor, and the behaviour
of create and update_filemap when starting dmfilemapd.

7 years agodmstats: start dmfilemapd when creating or updating file maps
Bryn M. Reeves [Fri, 16 Dec 2016 13:42:08 +0000 (13:42 +0000)]
dmstats: start dmfilemapd when creating or updating file maps

Launch an instance of the filemap monitoring daemon when creating,
or updating, a file mapped group, unless the --nomonitor switch is
given.

Unless --foreground is given the daemon will detach from the
terminal and run in the background until it is signaled or the
daemon termination conditions are met.

The --follow={inode|path} switch is added to control the daemon
behaviour when files are moved, unlinked, or renamed while they
are being monitored.

The daemon runs with the same verbosity as the dmstats command
that starts it.

7 years agoman: add dmfilemapd.8
Bryn M. Reeves [Sat, 17 Dec 2016 16:24:35 +0000 (16:24 +0000)]
man: add dmfilemapd.8

7 years agodaemons: add dmfilemapd
Bryn M. Reeves [Thu, 15 Dec 2016 20:10:27 +0000 (20:10 +0000)]
daemons: add dmfilemapd

Add a daemon that can be launched to monitor a group of regions
corresponding to the extents of a file, and to update the regions as the
file's allocation changes.

The daemon is intended to be started from a library interface, but can
also be run from the command line:

  dmfilemapd <fd> <group_id> <path> <mode> [<foreground>[<log_level>]]

Where fd is a file descriptor open on the mapped file, group_id is the
group identifier of the mapped group and mode is either "inode" or
"path". E.g.:

  # dmfilemapd 3 0 vm.img inode 1 3 3<vm.img
  ...

If foreground is non-zero, the daemon will not fork to run in the
background. If verbose is non-zero, libdm and daemon log messages will
be printed.

It is possible for the group identifier to change when regions are
re-mapped: this occurs when the group leader is deleted (regroup=1 in
dm_stats_update_regions_from_fd()), and another region is created before
the daemon has a chance to recreate the leader region.

The operation is inherently racey since there is currently no way to
atomically move or resize a dm_stats region while retaining its
region_id.

Detect this condition and update the group_id value stored in the
filemap monitor.

A function is also provided in the the stats API to launch the filemap
monitoring daemon:

  int dm_stats_start_filemapd(int fd, uint64_t group_id, const char *path,
                              dm_filemapd_mode_t mode, unsigned foreground,
                              unsigned verbose);

This carries out the first fork and execs dmfilemapd with the arguments
specified.

A dm_filemapd_mode_t value is specified by the mode argument: either
DM_FILEMAPD_FOLLOW_INODE, or DM_FILEMAPD_FOLLOW_PATH. A helper function,
dm_filemapd_mode_from_string(), is provided to parse a string containing
a valid mode name into the appropriate dm_filemapd_mode_t value.

7 years agolibdm: remove unnecessary backtrace in _stats_group_id_present()
Bryn M. Reeves [Thu, 9 Mar 2017 17:33:02 +0000 (17:33 +0000)]
libdm: remove unnecessary backtrace in _stats_group_id_present()

It's not an error to call dm_stats_group_present() on a handle
that contains no regions.

This causes dmfilemap to log a false backtrace during shutdown
if all regions are removed from the corresponding device:

  exiting _filemap_monitor_get_events() with deleted=0, check=0
  waiting for FILEMAPD_WAIT
  dm message   (253:1) [ opencount flush ]  @stats_list dmstats [32768] (*1)
  <backtrace>
  Filemap group removed: exiting.

Change this to only emit a backtrace if the handle is NULL.

7 years agoman lvmraid: remove fixmes, use consistent example name
David Teigland [Thu, 9 Mar 2017 17:48:30 +0000 (11:48 -0600)]
man lvmraid: remove fixmes, use consistent example name

7 years agotests relative-sign-options: only skip thin part
David Teigland [Thu, 9 Mar 2017 17:29:54 +0000 (11:29 -0600)]
tests relative-sign-options: only skip thin part

7 years agotests relative-sign-options.sh: skip without thin
David Teigland [Thu, 9 Mar 2017 16:43:41 +0000 (10:43 -0600)]
tests relative-sign-options.sh: skip without thin

7 years agolvresize: poolmetadatasize cannot use minus
David Teigland [Thu, 9 Mar 2017 15:49:33 +0000 (09:49 -0600)]
lvresize: poolmetadatasize cannot use minus

7 years agolvconvert: prompt when splitting off LV of a 2-legged raid1 LV
Heinz Mauelshagen [Thu, 9 Mar 2017 12:59:47 +0000 (13:59 +0100)]
lvconvert: prompt when splitting off LV of a 2-legged raid1 LV

Splitting off an image LV of a 2-legged
raid1 LV causes loss of resilience.

Ask user to avoid uninformed loss of all resilience.

Don't ask for N > 2 legged raid1 LVs.

Adjust tests.

7 years agotest: raid1 down convert to linear
Heinz Mauelshagen [Thu, 9 Mar 2017 12:21:21 +0000 (13:21 +0100)]
test: raid1 down convert to linear

Missed one test in last commit.

7 years agotest: raid1 down convert to linear
Heinz Mauelshagen [Thu, 9 Mar 2017 12:16:08 +0000 (13:16 +0100)]
test: raid1 down convert to linear

Add/adjust more tests for commit 7fbe6ef16bfb.

7 years agolvconvert: remove superfluous compile time conditonal code
Heinz Mauelshagen [Thu, 9 Mar 2017 11:16:11 +0000 (12:16 +0100)]
lvconvert: remove superfluous compile time conditonal code

7 years agotest: raid1 down convert to linear / split and track tests
Heinz Mauelshagen [Thu, 9 Mar 2017 03:01:47 +0000 (04:01 +0100)]
test: raid1 down convert to linear / split and track tests

Add/adjust tests for commits d250aa7208a6 and 7fbe6ef16bfb.

7 years agolvconvert: prompt when splitting off a tracked LV of a 2-legged raid1 LV
Heinz Mauelshagen [Thu, 9 Mar 2017 02:22:55 +0000 (03:22 +0100)]
lvconvert: prompt when splitting off a tracked LV of a 2-legged raid1 LV

Splitting off an image LV of a 2-legged raid1 LV tracking changes
causes loosing partial resilience for any newly written data set.
Full resilience will be provided again after the split off image LV
got merged back in and the new data set got fully synchronized.
Reason being that the data is only stored on the remaining single
writable image during the split.

Ask user to avoid uninformed loss of such partial resilience.

Don't ask for N > 2 legged raid1 LVs.

7 years agolvconvert: prompt when converting raid1 to linear
Heinz Mauelshagen [Thu, 9 Mar 2017 01:39:49 +0000 (02:39 +0100)]
lvconvert: prompt when converting raid1 to linear

Ask user when converting raid1 to linear to avoid
uninformed loss of all resilience.

7 years agotest: "lvconvert --repair" after vgreduce
Heinz Mauelshagen [Thu, 9 Mar 2017 01:35:57 +0000 (02:35 +0100)]
test: "lvconvert --repair" after vgreduce

Add test for commit 921b496fff51.

7 years agoraid: fix function description
Heinz Mauelshagen [Thu, 9 Mar 2017 01:16:03 +0000 (02:16 +0100)]
raid: fix function description

7 years agolvconvert: fix --repair after vgreduce
Heinz Mauelshagen [Thu, 9 Mar 2017 01:11:52 +0000 (02:11 +0100)]
lvconvert: fix --repair after vgreduce

In case N images fail (N <= parity chunks) _and_
a "vgreduce --removemissing --force VG" was applied
a following repair of the RaidLV fails:

  Unable to remove N images:  Only 0 devices given.
  Failed to remove the specified images from tb/r.
  Failed to replace faulty devices in tb/r.

Fix as of this commit results in correct repair:

  Faulty devices in tb/r successfully replaced.

7 years agotest: Copyright
Heinz Mauelshagen [Wed, 8 Mar 2017 23:10:55 +0000 (00:10 +0100)]
test: Copyright

7 years agohelp: fix missing required option
David Teigland [Wed, 8 Mar 2017 21:00:27 +0000 (15:00 -0600)]
help: fix missing required option

Fix for previous commit 4d0172ff15c.

7 years agoman/help: use order of required options from cmd def
David Teigland [Wed, 8 Mar 2017 20:51:08 +0000 (14:51 -0600)]
man/help: use order of required options from cmd def

Follow the same as written in command-lines.in

7 years agoman: add more references to topical man pages
David Teigland [Wed, 8 Mar 2017 20:43:30 +0000 (14:43 -0600)]
man: add more references to topical man pages

7 years agotests: add test for relative option values
David Teigland [Wed, 8 Mar 2017 19:51:33 +0000 (13:51 -0600)]
tests: add test for relative option values

Combinations of: lvcreate/lvresize/lvextend/lvreduce,
--size/--extents/--poolmetadatasize, +/-/nosign.

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

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