1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00
Commit Graph

3371 Commits

Author SHA1 Message Date
Heinz Mauelshagen
8333d5a969 lvconvert: preserve region size on raid1 image count changes
Unless a change of the regionsize is requested via "lvconvert -R N ...",
keep the region size when the number of images changes in a raid1 LV.

Resolves: rhbz1443705
2017-04-22 02:04:49 +02:00
Heinz Mauelshagen
83cdba75bd mirror/raid: display adjusted region size with units
Display adjusted region size in units (e.g. "4.00 MiB") rather than sectors.
2017-04-20 20:42:21 +02:00
David Teigland
b9d10857b2 man: quote the word no 2017-04-18 15:56:48 -05:00
Zdenek Kabelac
3503ef23e3 cmdline: ensure command struct is defined
Make it clear to Coverity cmd will be defined.
2017-04-12 21:33:47 +02:00
David Teigland
6c342abb7f commands: improve error message for option rules
When a cmd def RULE fails because of a disallowed
combination of options, improve the error message
to show the option combination, not just the options
that broke the rule.
2017-04-12 14:05:36 -05:00
David Teigland
61cfe2d55b commands: add rule for lvconvert commands that create pools
For an lvconvert command that creates a thin pool or cache pool,
--poolmetadata cannot be used with --readahead, --stripes or --stripesize.
2017-04-12 13:33:40 -05:00
David Teigland
04d7444afa lvconvert: require different LV for pool
When convering an LV to a cache or thin LV, require
that an LV being converted to cache pool or thin pool
at the same time be a different LV.
2017-04-11 12:17:14 -05:00
David Teigland
a96c8b46b6 lvconvert: prevent duplicate use of metadata lv
The LV being processed cannot be used as the
pool metadata LV.
2017-04-11 12:11:00 -05:00
David Teigland
2fd9ae0703 lvconvert: validate vg name prefix for pool metadata name 2017-04-11 10:40:08 -05:00
David Teigland
a4f07b701a commands: check required option value when matching command
A command def can include a specific constant option value,
but the value was not being checked for optional opts.

e.g. this is an incorrect command and does not match any
command defs:

lvconvert --type cache --cachepool vg/lv

However, it was mistakely being matched to this cmd def,
where the required options match, but the optional options
do not:

lonvert --cachepool LV_linear_striped_raid_cachepool
OO: --type cache-pool, ...

The optional options were mistakely considered matching
because 'cache' and 'cache-pool' were not being compared.
2017-04-10 13:41:47 -05:00
David Teigland
7ccb4825c7 lvchange/lvconvert: fix missing lvmlockd LV locks
lvchange/lvconvert operations that do not require the LV
to already be active need to acquire a transient LV lock
before changing/converting the LV to ensure the LV is not
active on another host.  If the LV is already active,
a persistent LV lock already exists on the host and the
transient LV lock request is a no-op.

Some lvmlockd locks in lvchange were lost in the cmd def
changes.  The lvmlockd locks in lvconvert seem to have
been missed from the start.
2017-04-05 16:46:38 -05:00
Heinz Mauelshagen
c9bc1c1c8c lvchange: tidy switch code in _lvchange_properties_single() 2017-04-05 17:29:31 +02:00
David Teigland
6fdc391bae lvchange: fix missing return value
A return value from lvchange_persistent_cmd() was missed
in commit 1c41898c07
2017-04-05 10:08:01 -05:00
David Teigland
afa844817a commands: fix misspelling of option value
(The cmd def parser really needs to catch mistakes
like this as it did when it was external.)
2017-04-04 17:09:35 -05:00
David Teigland
a7d4156a9a lvchange: fix --poll value when set from option
The actual value specified by the --poll y|n option was not
being used.  The way the --poll value is used is hidden
through an indirection where the value is stored in a
global variable at the start of the command, and then the
value is read from there later.  Setting the global
variable early in the command had been lost with the
cmd def changes.
2017-04-04 17:04:45 -05:00
David Teigland
1c41898c07 vgchange/lvchange: fix poll and monitor use
Fill in some gaps where old versions of lvm allowed
--poll and --monitor in combination with other operations,
but those combinations had been lost since the cmd def work.
(The new cmd def code also added some combinations that
had been missed by the old code.)

Changes:

lvchange --activate: add poll and monitor options, and
                     add calls to them in implementation.

lvchange --refresh: add monitor option (poll already there),
                    and call to monitor in implementation.

lvchange <metadata ops>: add poll and monitor options, and
                         add calls to them in implementation.

vgchange <metadata ops>: add poll option (call to poll
                         already in implementation).

vgchange --refresh: remove monitor option (not used by code)

lvchange --persistent y: add poll and monitor options, and
                         add calls to them, and to activate
                         in the implementation. (Making it
                         match the main lvchange metadata
                         command.)

Summary of current usage:

lvchange --activate: monitor, poll
vgchange --activate: monitor, poll

lvchange --refresh: monitor, poll
vgchange --refresh: poll

lvchange --monitor: ok
lvchange --poll: ok
lvchange --monitor --poll: ok
vgchange --monitor: ok
vgchange --poll: ok
vgchange --monitor --poll: ok

lvchange <metadata ops>: monitor, poll
vgchange <metadata ops>: poll
2017-04-04 17:04:45 -05:00
Heinz Mauelshagen
a12b3af033 lvchange: enhance avoiding multiple metadata updates/reloads/backups
Enhance commit 25b5915c9b
to process options requiring immediate metadata commits
and reloads after those we can group together doing just
one commit and an optional reload for the whole group.

Backup metadata after processing options successfully.

Related: rhbz1437611
2017-04-04 23:53:55 +02:00
David Teigland
76b70d5058 lvconvert: fix converting hidden lv to pool
A hidden LV can not be converted to a thin pool or cache pool.
2017-04-04 16:47:47 -05:00
David Teigland
b951d04337 help: print all options in abbreviated help output
Don't abbreviate the --help output quite as much
when there are many command defs.  Print all the
options in the cmd defs that are shown.  --longhelp
output is unchanged and includes everything.
2017-04-03 16:36:04 -05:00
David Teigland
29161a145e commands: missing comma in cmd def option list
Does not affect parsing, but keep it consistent.
2017-04-03 16:20:55 -05:00
David Teigland
db579b9e93 help: include cmd def info in verbose output
It can sometimes be important to correlate a
command with its cmd def entry, so include
the cross reference info in help -vv output.
2017-04-03 16:17:37 -05:00
David Teigland
dece723dc7 commands: recognize ignored options 2017-04-03 15:49:24 -05:00
David Teigland
162272e5a5 commands: ignore partial option in most cases
These days --partial is only used with activation in
lvchange/vgchange.  It probably had another meaning
at some point in history which is no longer used,
so ignore it in those cases.

When included in the OO list, the option is advertised in
help/man output, implying it is meaningful to the command,
when in fact the command never uses it.
The IO list means the option won't cause an error if it's
used, but is not displayed as an valid option for the command.
If the option is not included in either OO or IO lists,
using the option would cause a command error, which would cause
problems for anyone is using the option for historical reasons.
2017-04-03 15:43:04 -05:00
David Teigland
51ff707ac8 man: fix description of --partial option 2017-04-03 14:15:29 -05:00
David Teigland
e0f284d372 lvchange: refresh command missing activationmode option 2017-04-03 13:44:35 -05:00
Heinz Mauelshagen
25b5915c9b lvchange: avoid multiple metadata updates/reloads/backups
_lvchange_properties_single() processes multiple command
line arguments in a loop causing metadata updates and/or
backups per argument.

Optimize to only perform one update and/or backup
(but necessary interim ones; e.g. for --resync)
per command run.

Related: rhbz1437611
2017-04-01 02:38:48 +02:00
Heinz Mauelshagen
13ca11cc14 lvchange: persistent major/minor processing regression
Optimized change.

Resolves: rhbz1437611
2017-03-31 17:09:33 +02:00
Heinz Mauelshagen
d6ddacf6a1 lvchange: persistent major/minor processing regression
Fix a regression introduced by new command line processing
(see starting commit 1e2420bca8)
causing activation to be rejected in combination with setting
persistent minor device numbers.

Resolves: rhbz1437611
2017-03-31 13:51:39 +02:00
Heinz Mauelshagen
92ac1da16a man-generator: shutdown stdout buffer
Flush stdout and switch it back to line buffering before exit.
2017-03-30 20:40:44 +02:00
Heinz Mauelshagen
2c4e8254de man-generator: enhance performance
Set block buffering on stdout to
save ~30% time generating manuals.
2017-03-30 19:55:50 +02:00
Heinz Mauelshagen
0da040b1eb man-generator: don't ignore description file errors
In case we provide a description file it has to
succeed opening and reading.  Dynamically allocate
buffer space for it whilst on it.
2017-03-30 19:51:35 +02:00
Heinz Mauelshagen
b3854155d9 man-generator: add '.' to all messages 2017-03-30 17:54:36 +02:00
Bryn M. Reeves
2b46fe5843 dmsetup: replace (f)printf("\n") with putchar/putc 2017-03-30 16:30:50 +01:00
Nir Soffer
b8b2b1efd8 dmsetup: Flush ouptut when using --interval 2017-03-30 10:17:32 +01:00
Bryn M. Reeves
fe0922b8a6 dmsetup: simplify branching in _stats_update_file()
The fallback branch in _stats_update_file() is redundant (since the
branch taken when the daemon starts successfully must jump to the
'out' label anyway): remove it and re-order the conditions to
improve readability.
2017-03-30 09:57:58 +01:00
Heinz Mauelshagen
2f1fd1584e man-generator: catch missing command name 2017-03-30 00:44:34 +02:00
Zdenek Kabelac
dfdd6ccf3b vgrename: use long enough buffer for path
Use PATH_MAX when creating buffers for rename.
2017-03-30 00:38:41 +02:00
Bryn M. Reeves
5994ed9df2 dmsetup: always close fd when leaving _stats_update_file() (coverity) 2017-03-29 18:34:57 +01:00
Bryn M. Reeves
11749e7adb dmsetup: do not start dmfilemapd if region creation fails (coverity) 2017-03-29 18:34:51 +01:00
Marian Csontos
5dfd35f2f8 dmstats: Fix path to static dmstats 2017-03-29 09:04:56 +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
19a72e601f man: fix / typo 2017-03-28 00:27:04 +02:00
Zdenek Kabelac
e3a3cf01eb cleanup: use more common FMTd64 type
We use 'd' for plain singed integers.
2017-03-27 20:50:19 +02:00
Heinz Mauelshagen
36cac41115 man-generator/man/help: simplify hyphen escaping
Commits a29bb6a14b
    ... 5c199d99f4
narrowed down on addressing the escaping of hyphens
in the dynamic creation of manuals whilst avoiding
them in creating help texts.  This lead to a sequence
of slipping through hyphens adrressed by additional
patches in aforementioned commit series.

On the other hand, postprocessing dynamically man-generator
created and statically provided manuals catches all hyphens
in need of escaping.

Changes:
- revert the above commits whilst keeping man-generator
  streamlining and the detection of any '\' when generating
  help texts in order to avoid escapes to slip in

- Dynamically escape hyphens in manaual pages using sed(1)
  in the respective Makefile targets

- remove any manually added escaping on hyphens from any
  static manual sources or headers
2017-03-27 16:49:39 +02:00
Heinz Mauelshagen
6165e09221 lvchange: reject setting all raid1 images to writemostly
raid1 doesn't allow to set all images to writemostly because at
least one image is required to receive any written data immediately.

The dm-raid target will detect such invalid request and
fail it iwith a kernel error message.

Reject such request in uspace displaying a respective error message.
2017-03-26 20:28:04 +02:00
Heinz Mauelshagen
5c199d99f4 man: a few more missed '-' to escape 2017-03-25 03:40:02 +01:00
Heinz Mauelshagen
66b2084b96 man-generator: more escaped '-' 2017-03-24 18:57:45 +01:00
Heinz Mauelshagen
d823c65d50 man-generator: fix buffer length calculation 2017-03-24 18:33:03 +01:00
Heinz Mauelshagen
4046f9bd95 man/help: avoid escaping of '-' with --help 2017-03-24 15:14:21 +01:00
Heinz Mauelshagen
9354ce6045 man-generator: cleanup escape '-' 2017-03-24 14:27:59 +01:00