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

10912 Commits

Author SHA1 Message Date
Zdenek Kabelac
3173442984 lvm: move hyphen mangling code
Relocate hyphen code from lvm main into lvm_run_command()
so all command and library user will have it.

Update WHATS_NEW with missing changes.
2015-06-19 09:51:48 +02:00
Zdenek Kabelac
438a65dfdb display: drop allocation from display_lvname
Use of display_lvname() in plain log_debug() may accumulate memory in
command context mempool. Use instead small ringbuffer which allows to
store cuple (10 ATM) names so upto 10 full names can be used at one.

We are not keeping full VG/LV names as it may eventually consume larger
amount of RAM resouces if vgname is longer and lots of LVs are in use.

Note: if there would be ever needed for displaing more names at once,
the limit should be raised (e.g. log_debug() would need to print more
then 10 LVs on a single line).
2015-06-18 18:50:37 +02:00
Zdenek Kabelac
a3e0d830bd thin: support unaligned size of external origin and thin pool
With thin-pool kernel target module 1.13 it's now support usage of
external origin with sizes which are not 'alligned' with chunk size
of thin-pool.

Enable lvm2 support for this and also fix reporting of data_percent
usage for case sizes are not alligned.
2015-06-18 18:50:36 +02:00
Zdenek Kabelac
6f2a617c31 thin: drop limitation for extension of reduced thin volume
Drop check which has prevented resize of reduce thin volume with
external origin. User is supposed to use 'zeroing' to get 'clean'
chunks.
2015-06-18 18:48:59 +02:00
Zdenek Kabelac
69132f55ea libdm: add dm_tree_node_set_thin_pool_read_only
Support thin-pool tree node with activation in read-only mode.
(Native kernel API).
2015-06-18 15:15:39 +02:00
David Teigland
fd1376ebef libdaemon: move compare_config to lib
so it can be used elsewhere.
2015-06-17 13:07:52 -05:00
Peter Rajnoha
0a203070f5 cleanup: missing target_type check in device_is_usable filter 2015-06-17 14:27:48 +02:00
Peter Rajnoha
5577f2f4f0 cleanup: || instead of |
More efficient with same result here.
2015-06-17 14:12:58 +02:00
Peter Rajnoha
1e6a926e85 filter: filter-usable: consider snapshot and origin LV as unusable if its component is suspended
Note that this is just a quick fix and it needs more robust fix to
encompass any combination, not just the (old) snapshot one!

This started with this report:
  https://bugzilla.redhat.com/show_bug.cgi?id=1219222

If we have devices/ignore_suspended_devices=1 set based on which we
filter out suspended devices as unusable (or if we ignore suspended
devices by force, e.g. during lvconvert called from dmeventd) and
when we have snapshot and snapshot origin devices in the play, we
need to look at their components unerneath (*-real and *-cow) to
check if they're not suspended. If they are, the snapshot/snapshot
origin is not usable as well and hence it needs to be filtered out
by filter-usable.c code which does suspended device filtering.

Not going into much details here, more details are in the bugzilla
mentioned above. However, this is a quick fix since snapshot
and this exact situation is not the only one. So this is
something that needs to be revisited and fixed properly
with full dm tree and checking the whole stack to state
whether the device at the very top is usable or not.
2015-06-17 13:37:53 +02:00
Peter Rajnoha
a9bc53d5f3 config: fix some settings incorrectly marked as CFG_DEFAULT_COMMENTED instead of CFG_DEFAULT_UNDEFINED and causing segfault
This patch fixes segfault which was caused by incorrectly marking some
settings CFG_DEFAULT_COMMENTED instead of CFG_DEFAULT_UNDEFINED - the
ones which have NULL default value, hence they're really undefined.
A regression caused by a98ceceb1d.

For example:

$ lvmconfig log/file
file="/a"

Before this patch:

$ lvmconfig --type diff
Segmentation fault (core dumped)

With this patch applied:

$ lvmconfig --type diff
log {
	file="/a"
}

The same applies for these settings:

  log/activate_file
  global/library_dir
  global/system_id_file
  <disk_area>/disk_area_id

There were also other settings with NULL default value and marked as
CFG_DEFAULT_COMMENTED instead of CFG_DEFAULT_UNDEFINED, but they were
cfg_array config settings where the NULL value was not causing segfault
(NULL == empty array).
2015-06-17 13:34:31 +02:00
David Teigland
da1f887060 Add a global get_cmd_name()
Which returns the string set by set_cmd_name().
2015-06-16 15:13:10 -05:00
David Teigland
e043e03cd8 lv_refresh: move the bulk of the function into lib
So that it can be used from other lib code.
2015-06-16 13:38:40 -05:00
David Teigland
3d9957e3dd man vgchange lvchange: mention activation option s
and improve the existing text about existing
activation options.
2015-06-16 13:28:07 -05:00
David Teigland
857296c823 man lvm: mention hyphens in option names 2015-06-16 10:33:01 -05:00
David Teigland
d5adec1056 Add the 's' activation mode
Just as 'e' means activation with an exclusive lock,
add an 's' to mean activation with a shared lock.

This allows the existing but implicit behavior of '-ay'
of clvm LVs to be specified explicitly.  For local VGs,
asy simply means ay, just like aey means ay.

For local VGs, ay == aey == asy

For clvm VGs,  ay == asy, aey == aey, asy == asy
2015-06-16 10:18:16 -05:00
David Teigland
1f318dbcee Ignore hyphens in long option names
The hyphens are removed from long option names before
being read.  This means that:

- Option name specifications in args.h must not include hyphens.
  (The hyphen in 'use-policies' is removed.)

- A user can include hyphens anywhere in the option name.
  All the following are equivalent:
  --vgmetadatacopies,
  --vg-metadata-copies,
  --v-g-m-e-t-a-d-a-t-a-c-o-p-i-e-s-
2015-06-16 09:35:52 -05:00
David Teigland
7fe5e4010c xlate: add new variants
New variants use the clearer function names from the kernel.
2015-06-16 09:30:14 -05:00
David Teigland
ce18fb61c0 lvmcache: mention lvconvert --cachemode
for changing the cache mode on an existing LV.
2015-06-15 14:30:58 -05:00
Zdenek Kabelac
e7eb5b0696 debug: better tracing messages
Enhance traced output.
2015-06-15 14:48:06 +02:00
Zdenek Kabelac
9a06ae7b35 libdm: better debug message
Print reason for failing ioctl if thin pool message fails.
2015-06-15 14:48:04 +02:00
Zdenek Kabelac
ac6b355978 cleanup: drop double const
Second const is unneeded.
Also always create whole array with MAX elements.
2015-06-15 14:46:44 +02:00
Zdenek Kabelac
edbdbddfb6 dmeventd: better debug
Avoid using 'static' variable within threaded environmnent for debuging.
2015-06-15 14:46:44 +02:00
Zdenek Kabelac
3d5f7f90c8 dmeventd: drop stack 2015-06-15 14:46:44 +02:00
Zdenek Kabelac
9da07f1d3e dmeventd: drop pthread_cancel
Drop unused pthread canceling as well as DEBUG printing in signal
handler.
2015-06-15 14:46:44 +02:00
Alasdair G Kergon
f715fefe31 post-release 2015-06-12 21:42:57 +01:00
Alasdair G Kergon
2c64762a40 pre-release 2015-06-12 21:40:56 +01:00
Petr Rockai
9c0049b1ce test: Ensure that outdated PVs are wiped just once. 2015-06-10 16:27:59 +02:00
Petr Rockai
632dde0cbc metadata: When outdated PVs are wiped, notify lvmetad about the fact. 2015-06-10 16:27:12 +02:00
Petr Rockai
c78b6f18d4 metadata: Reject lvmetad metadata extensions when reading from disk. 2015-06-10 16:25:57 +02:00
Petr Rockai
4f91ad64c3 lvmetad: Make it possible to clear the outdated PVs list for a VG. 2015-06-10 16:18:57 +02:00
Petr Rockai
756d027da5 metadata: Explain the pvs_outdated field in struct volume_group. 2015-06-10 16:17:45 +02:00
David Teigland
fd29c7f3a1 lvmetad, lvmpolld: remove DL_LIBS from Makefile
and rdynamic.  They are not needed.
2015-06-08 11:48:22 -05:00
Ondrej Kozina
7c31293221 lvmetad.c: internal err on modifying global handle with open connection
lvmetad_init() should not be called with open connection to the daemon.
Doing so is considered to be an internall error within lvm2 code.

Such coincidence can't occur within current code. Let's assure us it won't
ever happen.
2015-06-08 16:01:40 +02:00
Ondrej Kozina
b89ad7e2d4 lvmetad.h: rephrase API descriptions
Some of descritpions were misleading at least. Some were completely
off the reality.

lvmetad_init doesn't re-establish or initialise a connection
lvmetad_active and lvmetad_connect_or_warn can do so.
2015-06-08 16:01:32 +02:00
David Teigland
3225f8d175 man: lvmthin chunk and metadata sizes
Clear some stale information, and give a suggestion to use
a metadata size of 1GiB.
2015-05-27 15:53:01 -05:00
Zdenek Kabelac
778b66a719 tests: check for idle only for raid type 2015-05-27 11:59:10 +02:00
Zdenek Kabelac
6e4c04b1be lvmetad: missing wrapper for lvmetad less compilation 2015-05-27 11:44:33 +02:00
Zdenek Kabelac
d3abc25e76 tests: check for clmvd socket
A bit hacky since it expects PID_DIR == DEFAULT_RUN_DIR for now,
just to check whether it fixes startup clvmd sync problem.
2015-05-27 11:10:43 +02:00
Zdenek Kabelac
f0a4955eb1 tests: better check for array in sync
Update check for raid array being in sync - getting somewhat complex.
It's another way to fight with problems in:
https://bugzilla.redhat.com/show_bug.cgi?id=1210637
2015-05-27 11:10:43 +02:00
Zdenek Kabelac
c254743ef3 tests: drop debug print 2015-05-27 11:10:43 +02:00
Zdenek Kabelac
d1531ab26d cleanup: gcc warn fix, don't hide pvs() 2015-05-27 11:10:43 +02:00
Ondrej Kozina
1aba262edb lvmpolld: terminate error message with a dot and LF 2015-05-27 11:10:43 +02:00
Ondrej Kozina
f0268585dd WHATS_NEW: various updates
commit c069aff21b
commit 8af5f54824
2015-05-26 16:28:04 +02:00
Ondrej Kozina
8af5f54824 dmsetup: zero errno in before strtoul call
Testing errno value without explicitly setting to
zero in before the strtoul call may lead to
unexpected failures.
2015-05-26 16:27:10 +02:00
Ondrej Kozina
c069aff21b lvmpolld: zero errno in before strtoul call
Testing errno value without explicitly setting to
zero in before the strtoul call may lead to
unexpected failures.
2015-05-26 16:27:03 +02:00
Ondrej Kozina
a72a805896 lvconvert.c: fix whitespace mess 2015-05-26 16:26:57 +02:00
Alasdair G Kergon
eeb498627c libdm: Add dm_task_get_errno to return ioctl errno.
There are reports of unexplained ioctl failures when using dmeventd.
An explanation might be that the wrong value of errno is being used.

Change libdevmapper to store an errno set by from dm ioctl() directly
and provide it to the caller through a new dm_task_get_errno() function.

[Replaced f9510548667754d9209b232348ccd2d806c0f1d8]
2015-05-26 15:13:49 +01:00
Ondrej Kozina
b244fffc18 WHATS_NEW: update
update for commit: f8bf641095
2015-05-25 10:48:53 +02:00
Ondrej Kozina
da20e0c507 tests: add test for pvscan --cache --background
regression test for a segfault in pvscan --cache --background
bug fixed by commit:
f8bf641095
2015-05-25 10:48:45 +02:00
Ondrej Kozina
f8bf641095 lvmetad.c: ignore lvmetad global handle on disconnect
do not unset lvmetad global handle on disconnect. This is
hotfix for issue described in:
https://www.redhat.com/archives/linux-lvm/2015-May/msg00008.html

Reported-by: Christian Hesse <list@eworm.de>
2015-05-25 09:11:04 +02:00