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

5676 Commits

Author SHA1 Message Date
Zdenek Kabelac
f7e62bc55c cleanup: drop extra compare
dm_free() already validates for NULL itself.
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
ea96a9d68e devcache: correct logging severity for connection
Switch from warn to log_error since this generated
failing return code for command so printing log_error()
is mandatory.

Happens with i.e. pvscan --cache meets crashing lvmetad.
2017-07-17 12:28:51 +02:00
Heinz Mauelshagen
fb641c3423 raid: add validation checks for segment data_offset member
Commit 34504855a7 introduced
flag LV_RESHAPE_DATA_OFFSET and used it to avoid incompatible
activation on older runtime.

Enhance vg_validate() raid checking functions with checks for it.
2017-07-15 00:51:43 +02:00
Heinz Mauelshagen
34504855a7 raid: add data_offset incompatibility segment type flag
In order to reject out of place reshaping with segment data_offset
field on old runtime, add a respective segment type incompatibility
flag causing "+RESHAPE_DATA_OFFSET" to be suffixed to the segment
type name.
2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
1d69fc7c5e raid: use return_0 for better backtracking 2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
1c4b7a3c2d report: fix data_offset/new_data_offset reporting 2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
6685460f5a lvconvert: allow reshaping in the cluster and on open devices
The previous commit fixed allocation/activation of reshape space.

Remove conditionals prohibiting reshaping in these cases.

Related: rhbz1447812
Related: rhbz1448116
Related: rhbz1461562
2017-07-14 15:53:23 +02:00
Heinz Mauelshagen
f1b78665ef raid: fix allocation/activation of reshape space
When reshape space is allocated anew, an update and reload is needed to
promote the new size to the cluster node with the exclusively active RaidLV
or reloading the RaidLV will fail with a size related error.  Additionally,
store "data_offset <sectors>" with the RaidLV in the lvm2 metadata so that
it can be retrieved on cluster nodes.

Process allocation of reshape space on a 2-legged raid4/5 (interim layout
to convert from/to linear via raid1) properly in the cluster.

Resolves: rhbz1461562
Resolves: rhbz1448116
2017-07-14 15:53:23 +02:00
Alasdair G Kergon
5027c3c7ee format_text: Extend FIXME to reduce label scans
It's unnecessarily scanning all invalid labels even when nothing changed
instead of first just scanning the ones under the lock.
2017-07-13 17:05:49 +01:00
Zdenek Kabelac
2c3d9a07cb cleanup: whitespace 2017-07-11 16:26:12 +02:00
Eric Ren
4c94371005 comment: update
Use 'is' for both forms.
2017-07-10 14:58:01 +02:00
David Teigland
3797f47ecf lvmlockd: fix revert in lvcreate
If the activation step in lvcreate fails (e.g. the specified
minor number is already used), then the lvcreate is reverted,
but the LV lock in lvmlockd was not being unlocked or properly
freed.
2017-07-07 14:42:25 -05:00
David Teigland
a0f6135e5c lvmlockd: use lock on thin pool when command names tdata
Some lvconvert commands can be used directly on the data sublv:
lvconvert ... vg/pool_tdata

The correct LV lock to use in lvmlockd is the one on the pool LV.
2017-07-07 12:06:53 -05:00
Zdenek Kabelac
2ceb5a0abb coverity: just make impossible division by zero
Visible for analyzer  code will not try to use 0 for division.
2017-06-30 20:39:23 +02:00
Zdenek Kabelac
ad286a3227 raid: ensure enum is defined
Just making sure enum is always defined.

TODO: code path using this enum needs closer inspection.
2017-06-30 20:39:02 +02:00
Alasdair G Kergon
7f1ec681d6 log: fix message prefix truncation
Restore the 29-character prefix limit that commit
e907535ab9 ("coverity: use better
function") accidentally reduced to 28 characters.
2017-06-27 12:41:59 +01:00
Zdenek Kabelac
419e8284c8 coverity: validate length of renaming path
Make sure path fits into buffer on stack.
2017-06-27 12:15:42 +02:00
Zdenek Kabelac
e907535ab9 coverity: use better function 2017-06-27 12:15:42 +02:00
Zdenek Kabelac
e9c60f874e coverity: extra check for find_pool_seg
find_pool_seg may return NULL in some internal error stats.
Handle it explicitely.
2017-06-27 12:15:15 +02:00
Zdenek Kabelac
b939ddf80c debug: more display_lvname usage 2017-06-27 08:28:36 +02:00
Zdenek Kabelac
275fc2d45b coverity: validate retval from get_only_segment_using_this_lv 2017-06-27 00:27:36 +02:00
Zdenek Kabelac
d444accdbf debug: fail in backup is not traced nor error 2017-06-27 00:27:36 +02:00
Zdenek Kabelac
c440bb0742 debug: check for fail in id validation 2017-06-27 00:27:36 +02:00
Zdenek Kabelac
3e331c8e68 cleanup: remove unused code 2017-06-27 00:27:25 +02:00
Zdenek Kabelac
ab6f4649a0 dev_manager: add missing validation for usable target_name
Coverity shown path where target_name == NULL would be dereferenced.
2017-06-27 00:27:25 +02:00
Zdenek Kabelac
b1e21cf9ed raid: fix write_commit_backup
With commit 41c10034aa we actually
do require LV to be used with _vg_write_lv_suspend_commit_backup().

So write a proper separte single wrapper for write && commit && backup.
2017-06-27 00:27:25 +02:00
Zdenek Kabelac
c465ca6a3a raid: allow more sync action for extraction
Since we discovered status reporting from 'md' goes from large set
of weird states we can't just decided based on this word.
So let it pass for rebuild and idle as well
and check for health devices afterwards.
2017-06-24 22:28:25 +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
07eec06f5d display: add display_percent function
Add universal function to print dm_percent_t values via single
code path.

TODO: extend with configurale precision of printed values.
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
a7c7d53543 debug: add missing internal error message
Do not just 'return_0'  log error would need to be shown.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
1bdcd156fd cache: restore origin only reload
Basically reverting commit 58a9f88b8c.
We can use origin_only  in case we are snapshot's origin,
as we do support this stack.

So when we are 'uncaching'  origin+snaps - we do need to reload only
origin and we do not need to play with snaps.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
63ecbcd1b7 raid: switch message to verbose
As this is not 'error' resulting query, decrease reported level.
2017-06-23 18:44:01 +02:00
Zdenek Kabelac
6d30350dd1 raid: improving messages for regionsize change
Handle change of 'region size' better and follow also standard rule
if the command can't success (i.e. size is already same) we return
error for all such cases.

Also log_pring more info about adjusted value (just like we
do for rounding)

Also avoid keep pointers on 'display_*' values - they are in
ringbuffer for immediate use - not to be kept across multiple calls
(as they could be already overwritten by later calls) - so dropped
seg_region_size_str
2017-06-23 18:44:00 +02:00
Zdenek Kabelac
41c10034aa debug: show message only when origin_only was set 2017-06-22 20:17:20 +02:00
Zdenek Kabelac
58e075f5fb cache: fix lvdisplay output
Unused cache pool may have lots of fields actually undefined,
so avoid printing them, if they are not specified in metadata.
2017-06-22 20:17:18 +02:00
Zdenek Kabelac
732928dda8 cache: fix lvdisplay --maps
'lvdisplay -m' tried to go through NULL policy settings,
when such policy was not defined for CachedLV.

Patch is fixing display of cache-pool without defined settings,
as this is now a valid pool and we mostly want users to define
these settings when actually really caching a LV.
2017-06-22 20:15:12 +02:00
Zdenek Kabelac
58a9f88b8c cache: drop usage of origin_only
Since cache LV can be a stacked device, there is no real reason
trying to use slight optimised tree for origin_only cache reload
(it could be even wrongly implemented in this case).

We can easily go with stardard tree load here.
2017-06-22 20:14:31 +02:00
Zdenek Kabelac
ca9e6cec61 cache: make syncing abortable by user
When user runs command like 'lvconvert --splitcache' the operation
might be actually either slow or not making any progress in kernel,
so lets give user a chance to abort such operation.

When user press 'Ctrl+C' device table is restored to pre-flushing state.
2017-06-22 20:11:43 +02:00
Heinz Mauelshagen
2df9a78684 mirror: reformat conditional 2017-06-22 00:57:16 +02:00
Heinz Mauelshagen
64fac77e8a raid: fix segfault
Add missing else clause
(already missing in initial commit fe18e5e77a).

Resolves: rhbz1463794
2017-06-22 00:49:00 +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
48f06005ab raid: update path for repair
Updating path from commit 61980bcf06.

When repair is running, no removing PVS are given so it shall return
success in such case.
2017-06-21 14:00:50 +02:00
Zdenek Kabelac
5f4cfa7c4a debug: missing traces 2017-06-21 12:36:01 +02:00
Zdenek Kabelac
07fe64b473 raid: use log_error on error path
Converting log_warn to log_error since error must be logged
when tool returns error.
2017-06-21 12:35:17 +02:00
Zdenek Kabelac
61980bcf06 raid: report error when specified devices are not contained
lvm2 always return non-zero error code when action cannot happen.
2017-06-21 12:35:17 +02:00
Zdenek Kabelac
31d153ced0 raid: drop debug code 2017-06-21 12:35:16 +02:00
Zdenek Kabelac
49fa2bea1c raid: more origin_only updates
Seems the code is multiplied - so keep it consistent for now.

TODO:  drop all uneeded code
2017-06-21 12:35:16 +02:00