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

14592 Commits

Author SHA1 Message Date
Zdenek Kabelac
918e867abe makefiles: use gcc warns with gcc only
Avoid passing  'gcc' warning options to non-gcc compiler
2017-08-01 11:53:13 +02:00
Zdenek Kabelac
57727bb4eb makefiles: RT_LIB
Link -lrt directly only with  libdevmapper.
All other users get dependency transiently.
2017-08-01 11:53:13 +02:00
Zdenek Kabelac
2593777f65 libdm: log_warn
No real effect anyway - function returs '1' in all paths,
but just make sure we do not have 'log_error()' on non-error path.
2017-08-01 11:53:12 +02:00
Zdenek Kabelac
c1b5f38bbe man: fix generated paths
Use user configured paths instead of some developers paths ;)
2017-08-01 11:53:11 +02:00
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
3654f478e1 toolcontext: Improve invalid units error message. 2017-07-27 00:51:50 +01: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
a1dbefe9c8 make generate 2017-07-25 01:26:58 +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
876c4a1b3b tidy: declaration names match implementation
Put in sync some naming used for function declaration and
actual in-code implementation.
2017-07-20 19:16:41 +02:00
Zdenek Kabelac
39ebacdb5a raid: reshape synchronization point
Give udev time to get in sync and give md-core time to wake up
after table reload.
2017-07-20 19:16:39 +02:00
Alasdair G Kergon
8e0c5d0cb6 post-release 2017-07-20 17:19:09 +01:00
Alasdair G Kergon
88f1565937 pre-release 2017-07-20 16:57:27 +01:00
Alasdair G Kergon
7ba0017468 raid: avoid lv_size compiler warning
warning: declaration of ‘lv_size’ shadows a global declaration
2017-07-20 16:16:51 +01:00
Zdenek Kabelac
c78316b7a5 raid: move syncing with udev into function
Since _deactivate_and_remove_lvs() is used in more then one place,
move the needed udev synchronization into this function so other
users automatically get correct fs state before next dm manipulation.

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

Note: on udev-less system there will be almost no delay.
2017-07-20 13:52:18 +02:00
Zdenek Kabelac
7b048f6b43 tests: aus.sh fix md teardown
Commit 8a912d6dbc missed the wrong logic,
we use 2 vars 'dev' & 'mddev' and their usage can't be mixed.

So correctly separate them so mddev keeps name of MD device.
2017-07-20 12:16:27 +02:00
Zdenek Kabelac
48ce8c7a49 tidy: drop unneeded cast
Avoid casting to the same type.
2017-07-20 11:20:44 +02:00
Zdenek Kabelac
4a2994b7b1 tidy: name all parameters 2017-07-20 11:20:26 +02:00
Zdenek Kabelac
1fd8785ff3 tidy: drop unneeded return 2017-07-20 11:20:22 +02:00
Zdenek Kabelac
4ef6cfc882 tidy: else after continue
Similar as with 'else' after 'return'  unindent whole block
for better readability of code.
2017-07-20 11:18:29 +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
b37e4e3f90 cleanup: constify used parameter 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
86d7adc2a5 tests: aux.sh fix wait_pvmove_lv_ready
Ignore error if the 'queried' LV is still not available
(since 'get' now properly returns failure when LV is missing)
2017-07-19 12:15:39 +02:00
Zdenek Kabelac
43dbfee32a tests: aus.sh better defaults 2017-07-18 21:25:03 +02:00
Zdenek Kabelac
466da710e0 tests: avoid endless loops
If there is some problem with device removal avoid generating very long
error logs...
2017-07-18 21:17:51 +02:00
Zdenek Kabelac
9599645bb6 tests: aux.sh limit device
During test do a more close selection of visible devices.
If some test leaks a device with LVMTEST prefix, next
test should not be influnced (or parallel running one).

If the test is running in non-/dev  dir - it's already protected
by full path with $PREFIX in it - however it test is running
in real /dev dir - there was no such protection and test
were confused when they have seen such leaked device.
2017-07-18 13:14:02 +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
fde23f7ce1 tests: better support for unbound vars for older shell 2017-07-17 20:32:48 +02:00
Zdenek Kabelac
5a5553bcec tests: aux.sh some backward compatible updates
Older bash does not take empty array as bounded variable
(except for $@)
2017-07-17 15:01:44 +02:00
Zdenek Kabelac
3c32883cec test: repeat rediscovery few times
Avoid using 'aux' shell when setting dmsetup cookie.
Do not user '--force' when using external cookie.
2017-07-17 13:38:31 +02:00
Zdenek Kabelac
f293d46946 tests: aux.sh correcting bounder values
grep for defined PREFIX.
use 'dev' instead of undefined mddev.
2017-07-17 12:33:42 +02:00
Zdenek Kabelac
84b56872fb tests: aux.sh also uses increseed hardening protection
Also use similar incresed hardeing of script correctness
for standalone aux scripts - so there is one common
logic for pipe failures.
2017-07-17 12:33:42 +02:00
Zdenek Kabelac
bd2a0fe2ec tests: utils.sh look for more coredump places
Quoting helps to anyone storing coredumps inside dir with spaces....
Also add default dir for coredumps with systemd coredumpctl.
2017-07-17 12:33:42 +02:00
Zdenek Kabelac
d15b9ac510 tests: extend lvcreate size validation 2017-07-17 12:33:42 +02:00
Zdenek Kabelac
567aa60fa1 lvmetad: cleanup
Avoid hashing insertion when object with same content is already there.
2017-07-17 12:33:17 +02:00
Zdenek Kabelac
767a5e1281 dev-cache: avoid hashing same data again
Before hashing device again with path, check if it's not already hashed.

TODO: maybe bigger chunk of executed code might be actually skipped.
2017-07-17 12:33:17 +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
f7e62bc55c cleanup: drop extra compare
dm_free() already validates for NULL itself.
2017-07-17 12:32:18 +02:00
Zdenek Kabelac
55f9e2f399 cleanup: shorten dump output code
Save couple lines on code with simpler code.
2017-07-17 12:32:18 +02:00
Zdenek Kabelac
f6c2ee57fa cleanup: drop const from allocated value
Avoid using const for casting to non-const.
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