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

3437 Commits

Author SHA1 Message Date
Zdenek Kabelac
8256170e6a thin: warn about too big chunks size
lvm2 warned about zeroing and too big chunksize (>=512KiB), but
only during lvconvert, so lvcreate was creating thin-pools
without any warning about possible slowness of thin provisioning
because of zeroing.
2017-08-01 11:52:27 +02:00
Alasdair G Kergon
54f5bc01b9 tools: Introduce exit code EINIT_FAILED.
Replace -1 (reported as 255) by 4.
2017-07-26 23:18:03 +01:00
Alasdair G Kergon
f9f75de3da dmsetup: Add minor number to concise table output format.
When using this new format for input, it'll sometimes help to
be able to specify the minor number.
2017-07-25 12:22:46 +01:00
Alasdair G Kergon
5fd7c0aa33 dmsetup: Add concise table output format.
Create a new table output format that concisely shows multiple devices
on one line.

dmsetup table --concise [device...]

<dev_name>,<uuid>,<flags>[,<table>]*[;<dev_name>,<uuid>,<flags>[,<table>]*]*

Table lines are separated by commas.
Devices are separated by semi-colons.
Flags is currently 'ro' or 'rw' (and might be extended in a
yet-to-be-defined way in future).
Any comma, semi-colon or backslash within a field is quoted by a
preceding backslash.

The format can later be supplied as input to dmsetup or even to the
booting kernel as an alternative way to set up devices.

Based on patches submitted by
Enric Balletbo i Serra <enric.balletbo@collabora.com>.
2017-07-25 01:13:14 +01:00
David Teigland
ca71ad0d50 commands: expand comment on configuring option vals 2017-07-24 14:12:08 -05:00
David Teigland
2938fa541a man: remove hyphen escapes from source
they are escaped by running sed in makefile
2017-07-24 14:12:08 -05:00
David Teigland
1460cac273 vgchange: split out code for systemid
Use the command definitions to separate the implementation
of vgchange systemid from the rest of vgchange.
2017-07-24 14:12:08 -05:00
David Teigland
07cd88dcfa vgchange: split out code for lockstart and lockstop
Use the command definitions to separate the implementation
of lockstop and lockstart from the rest of vgchange.
2017-07-24 14:12:08 -05:00
David Teigland
f611b68f3c vgchange: separate change locktype and allow recovery
Add an independent command definition for "vgchange --locktype",
and split the implementation out of the set of common metadata
changes.  It is unlike normal metadata changes, and can only
be run by itself.  (Changing the lock type is similar in
principle to changing the VG name or the VG system ID; it
effects the ability of any host to see or access the VG.)

At some point this command lost the ability to forcibly change
the lock type of a shared VG to "none" (making it a local VG).
This can be necessary to repair shared VGs (e.g. recovery steps
that occur in vg_read are disabled for shared VGs because
they are not locked properly, or recovering sanlock locks
when the PV holding them is lost.)

"vgchange --locktype none --lockopt force VG" is used as the
method of forcing the shared VG to become local so that it
can be repaired.
2017-07-24 14:12:08 -05:00
Zdenek Kabelac
48ce8c7a49 tidy: drop unneeded cast
Avoid casting to the same type.
2017-07-20 11:20:44 +02:00
Zdenek Kabelac
1fd8785ff3 tidy: drop unneeded return 2017-07-20 11:20:22 +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
Zdenek Kabelac
e769e3d3bf dmsetup: simplify check of parsed cookie value
Improving parsing error detection for strtoul.
2017-07-20 11:18:16 +02:00
Zdenek Kabelac
4fa739faf2 lvmcmdline: enhance locales check
Make check for 'radixchar' more readable and logical.
Also avoid reread of number of locale is already using '.' as radixchar.
2017-07-17 21:25:50 +02:00
Zdenek Kabelac
864017710c lvmcmdline: restore digit check
Commit 9b4b5d449e started to accept
rather way to wide set of strings we do not want to take for size.
i.e.  lvresize -t vg0/lvol0 -LNaNM

Restore check for 'digit ||  locales defined 'dot' |  '.'
(as we tend to take '.' even if locales uses ',')
2017-07-17 20:54:42 +02:00
Zdenek Kabelac
9b4b5d449e lvmcmdline: enhance acceptance of size numbers
Explictely detect duplicate sing symbols and leave the rest of
double number validation on 'strtod()' function. This way
we can also accept size like:

lvcreate -L.1M

We already accept -L0.1M - but it's common to accept numbers
starting with leading '.' - just as 'strtod()' accepts it).
2017-07-17 12:32:18 +02:00
Zdenek Kabelac
ba9820b142 numbers: strtod or strtoul need reset of errno
API for strtod() or strtoul() needs reset of errno, before it's being
called. So add missing resets in missing places and some also some
errno validation for out-of-range numbers.
2017-07-17 12:32:18 +02:00
Zdenek Kabelac
94838b4df0 lvmcmdline: validate size as double
Since we are reading size as (double) we can get way bigger
number then just plain int64. So to make this check actually
more valid and usable do a maxsize compare in 'double'.
2017-07-17 12:32:18 +02:00
David Teigland
e329da173f pvs: use dummy structs in duplicate processing
Use the same dummy struct approach from report.c
when a pv needs to be processed without a real vg.
2017-07-12 10:51:54 -05:00
Alasdair G Kergon
3cd492cd59 commands: fix lvm shell segfaults
Don't check for -h/--help if argc is 1.
2017-07-11 01:42:06 +01:00
David Teigland
56768ce36b lvm: report error if options are set before command
Previously, strange parsing errors were reported.
2017-07-10 11:02:11 -05:00
David Teigland
442d60842d lvm: run help from -h|--help 2017-07-10 11:02:11 -05:00
Eric Ren
7617e08c03 cleanup: fix some typos
form -> from
accomodate -> accommodate

Signed-off-by: Eric Ren <zren@suse.com>
2017-07-10 14:58:33 +02:00
David Teigland
cf3a6bbbe8 commands: fix handing of ENO_SUCH_CMD in script
Fix the error messages when an unrecognized command is
run from a script.  We shouldn't attempt to parse options
for an unrecognized command name, which causes misleading
errors about bad options, but rather exit right when we
know the command name is not valid.  Also don't complain
about exiting without an error message when running a
script if no command didn't exist.
2017-07-07 15:34:27 -05:00
David Teigland
85f1814e9d commands: centralize shell vs script vs command decision
This clarifies the point where lvm decides if it is
running an lvm shell, command or a script.
2017-07-07 15:33:44 -05:00
Zdenek Kabelac
3d08b0971f man_generator: release buffer after use
Although ATM this code has no memory management at all,
it will not make any harm to release some memory,
when it's not needed anymore.
2017-06-30 20:39:02 +02:00
Zdenek Kabelac
7ba6896962 command: we don't have all standard macros
So just quite warning
2017-06-28 15:05:16 +02:00
Zdenek Kabelac
a533892cd3 coverity: checked_return of close
Check (or make quiet) close() ret code.
NOTE: there is another duplicated code of daemonize function which
should be converted to libdaemon.
2017-06-28 14:42:11 +02:00
Zdenek Kabelac
0349b6d889 coverity: drop unneeded assigns 2017-06-27 12:15:42 +02:00
Zdenek Kabelac
8e790702f1 coverity: check malloc results 2017-06-27 12:15:42 +02:00
Zdenek Kabelac
b939ddf80c debug: more display_lvname usage 2017-06-27 08:28:36 +02:00
Zdenek Kabelac
664e947726 coverity: add some error path for failed allocs
Coverity reports some unchecked allocations.
2017-06-27 00:27:36 +02:00
Zdenek Kabelac
72c5598658 debug: use display_lvname 2017-06-27 00:27:36 +02:00
Zdenek Kabelac
a567ec65a9 debug: fix error path
Coverity:
log_error may have dereference NULL pointer - use directly
segtype string name.
2017-06-27 00:27:36 +02:00
Zdenek Kabelac
c3e0ef1a5e debug: tracing error path 2017-06-27 00:27:36 +02:00
Zdenek Kabelac
52f4042f1a cmdline: fix missing NULL at end of array of args
lvm_run needs to place NULL as the last element into argv[].
Otherwise we get:

Conditional jump or move depends on uninitialised value(s)
 _command_required_pos_matches (lvmcmdline.c:1443)
 _find_command (lvmcmdline.c:1610)
 lvm_run_command (lvmcmdline.c:2770)
 lvm2_run (lvmcmdlib.c:91)
2017-06-26 20:07:21 +02:00
Zdenek Kabelac
1bd4b0059b cleanup: use display_percent
Replace occurence of %.2f with call of display_percent function.
2017-06-24 17:44:42 +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
e3f63693a4 lvresize: support passing --yes to fsadm
Since fsadm now needs --yes to pass prompting operations,
we need to pass --yes from  lvresize to fsadm.
2017-06-21 14:03:29 +02:00
Zdenek Kabelac
3055131784 indent: properly indent goto 2017-06-09 21:49:19 +02:00
Zdenek Kabelac
5e7db7d85d snapshot: fix reporting for merged old snapshot
When old snapshot is merged, lvm2 still can report some data about
merged 'snapshot' - i.e. it occupied space in VG.

This patch fixes regression from commit:
6fd20be629

and resolved RHBZ: 1460161
2017-06-09 21:03:20 +02:00
Zdenek Kabelac
b3ef051e06 cache: lvcreate --cachepool checks for cache pool
Code path missed validation of lvcreate --cachepool argument.
If the non cache-pool LV was passed in, code has still continued
further work and failed later on internal error.  Validate this
condition at right place now.
2017-06-09 10:59:37 +02:00
David Teigland
5406191cb9 lvchange: allow changing properties on thin pool data lv
Add an exception to not allowing lvchange to change properties
on hidden LVs.  When a thin pool data LV is a cache LV, we
need to allow changing cache properties on the tdata sublv of
the thin pool.
2017-05-15 10:59:48 -05:00
Alasdair G Kergon
2583732165 lvcreate: Fix last commit for virtual sizes.
Don't stop when extents is 0 if a virtual size parameter was supplied
instead.
2017-05-12 13:16:10 +01:00
Alasdair G Kergon
cf73f6cf61 lvcreate: Fix mirror percentage size calculations.
Trap cases where the percentage calculation currently leads to an empty
LV and the message:

  Internal error: Unable to create new logical volume with no extents

Additionally convert the calculated number of extents from physical to
logical when creating a mirror using a percentage that is based on
Physical Extents.  Otherwise a command like 'lvcreate -m3 -l80%FREE'
can never leave any free space.

This brings the behaviour closer to that of lvresize.
(A further patch is needed to cover all the raid types.)
2017-05-12 02:31:35 +01:00
David Teigland
df5fd5ae88 lvcreate: cachemode writeback and cachepolicy cleaner is invalid
Return an error if lvconvert is used to create a cache pool
with that combination.
2017-05-05 09:59:12 -05:00
David Teigland
c56d8535a7 man lvmconfig: add descriptions for typeconfig and ignorelocal 2017-05-04 14:04:10 -05:00
David Teigland
a7a28bd998 man: reference other man pages with bold
There were a handful of references to other man
pages using the standard command(N) form which were
not in bold, so they were not turned into links
in html formats.
2017-05-03 16:21:01 -05:00