]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agotests: deactivate before remove
Zdenek Kabelac [Fri, 26 Jun 2015 20:00:40 +0000 (22:00 +0200)]
tests: deactivate before remove

Testing if this avoids udev race with removal of snapshot on some
test machines.
See: https://bugzilla.redhat.com/show_bug.cgi?id=1217819

9 years agomakefiles: avoid bash == operator syntax, use = instead
Ferenc Wágner [Fri, 26 Jun 2015 07:00:16 +0000 (09:00 +0200)]
makefiles: avoid bash == operator syntax, use = instead

Commit e587b0677b705786a78f21bac1966621f70b2752 broke the build on
systems where /bin/sh is Dash, for example.

Origin patch by Ferenc Wágner <wferi@niif.hu>  changed later to
avoid using shell call, so makefile add 'server' target when
one of  metad or polld daemon is requested.

9 years agolvmconfig: do not display settings with undefined default values
Peter Rajnoha [Thu, 25 Jun 2015 10:49:59 +0000 (12:49 +0200)]
lvmconfig: do not display settings with undefined default values

Do not display settings with undefined default values, but do display
these settings in case the value is defined directly in any part of
the existing config cascade.

For example, the lvmconfig --type current always displays these settings
(as it's somewhere in "current" configuration cascade that makes it defined).
The lvmconfig --type full displays these settings only if it's defined
somewhere in the cascade, but not if default value is used instead
The lvmconfig --type default never displays these settings...

More concrete example - let's have activation/volume_list directly
set in lvm.conf and activation/read_only_volume_list not set.
Both of these settings have *undefined default* values.

  $lvmconfig --type full activation/volume_list activation/read_only_volume_list
  volume_list="/dev/vg/lv"

(...only volume_list is defined, hence it's printed)

However, the comments will display more info (see also previous commit):

  $lvmconfig --type full activation/volume_list activation/read_only_volume_list --withsummary

  # Configuration option activation/volume_list.
  # Only LVs selected by this list are activated.
  # This configuration option does not have a default value defined.
  # Value defined in existing configuration has been used for this setting.
  volume_list="/dev/vg/lv"

  # Configuration option activation/read_only_volume_list.
  # LVs in this list are activated in read-only mode.
  # This configuration option does not have a default value defined.

9 years agolvmconfig: display comment about value from existing config being used
Peter Rajnoha [Thu, 25 Jun 2015 11:03:31 +0000 (13:03 +0200)]
lvmconfig: display comment about value from existing config being used

Display comment abour value from existing config being used. For example:

$ lvmconfig --type full --withsummary report/compact_output report/buffered

 # Configuration option report/compact_output.
 # Do not print empty report fields.
 # Value defined in existing configuration has been used for this setting.
 compact_output=1

 # Configuration option report/buffered.
 # Buffer report output.
 buffered=1

9 years agolvmconfig: add --type full to display full tree of settings
Peter Rajnoha [Thu, 25 Jun 2015 08:51:30 +0000 (10:51 +0200)]
lvmconfig: add --type full to display full tree of settings

The lvmconfig --type full is actually a combination of --type current
and --type missing together with --mergedconfig options used.

The overall outcome is a configuration tree with settings as LVM sees
it when it looks for the values - that means, if the setting is defined
in some config source (lvm.conf, --config, lvmlocal.conf or any profile
that is used), the setting is used. Otherwise, if the setting is not
defined in any part of the config cascade, the defaults are used.

The --type full displays exactly this final tree with all the values
defined, either coming from configuration tree or from defaults.

9 years agoconfig: also clone associated id when cloning node using dm_config_clone_node{_with_mem}
Peter Rajnoha [Thu, 25 Jun 2015 08:21:07 +0000 (10:21 +0200)]
config: also clone associated id when cloning node using dm_config_clone_node{_with_mem}

9 years agoman: Add missing env vars to lvm man page.
Alasdair G Kergon [Wed, 24 Jun 2015 19:43:35 +0000 (20:43 +0100)]
man: Add missing env vars to lvm man page.

9 years agolibdaemon: add comment about using main and init
David Teigland [Wed, 24 Jun 2015 17:16:26 +0000 (12:16 -0500)]
libdaemon: add comment about using main and init

9 years agotests: workaround udev problem
Zdenek Kabelac [Wed, 24 Jun 2015 11:21:21 +0000 (13:21 +0200)]
tests: workaround udev problem

If udev has not removed 'dir' entry - just issue TEST WARNING, clear
dir, but do not fail whole rest of test.

9 years agosnapshot: add synchronization point
Zdenek Kabelac [Wed, 24 Jun 2015 13:12:43 +0000 (15:12 +0200)]
snapshot: add synchronization point

Synchronize with udev logic before reusing device as snapshot.

This patch tries to fix the problem with udev, where we manage
to 'active' LV for clearing, then we deactivate such device and
active again as member of 'origin&snapshot' tree all in 1 step.

There needs to be a sync point where udev has time to remove all links,
otherwise we race with scans and we may end-up with mysterious 'free'
links in the system pointing to wrong dm names.

This patch tries to fix failing topology cluster tests..

9 years agocommands: --withspaces also for config and lvmconfig cmd aliases
Peter Rajnoha [Wed, 24 Jun 2015 11:28:40 +0000 (13:28 +0200)]
commands: --withspaces also for config and lvmconfig cmd aliases

9 years agomake: use lvmconfig ... --withspaces when generating lvm.conf and lvmlocal.conf
Peter Rajnoha [Wed, 24 Jun 2015 11:18:50 +0000 (13:18 +0200)]
make: use lvmconfig ... --withspaces when generating lvm.conf and lvmlocal.conf

9 years agolvmconfig: add --withspaces option
Peter Rajnoha [Wed, 24 Jun 2015 11:14:30 +0000 (13:14 +0200)]
lvmconfig: add --withspaces option

We shouldn't be adding spaces by default in output as that
may be be used already in scripts and especially for the eval
in shell scripts where spaces are not allowed between key
and value!

Add --withspaces option to lvmconfig for pretty output with
more space in for readability.

9 years agoWHATS_NEW: recent commits - config value format flags
Peter Rajnoha [Wed, 24 Jun 2015 09:33:34 +0000 (11:33 +0200)]
WHATS_NEW: recent commits - config value format flags

9 years agoconfig: regenerate configure.in to accomodate all recent changes
Peter Rajnoha [Tue, 23 Jun 2015 13:21:18 +0000 (15:21 +0200)]
config: regenerate configure.in to accomodate all recent changes

Hopefully closer to the ideal.

9 years agoconfig: devices/filter and devices/global_filter setting have 'a/.*/' as default...
Peter Rajnoha [Wed, 24 Jun 2015 09:21:12 +0000 (11:21 +0200)]
config: devices/filter and devices/global_filter setting have 'a/.*/' as default value

9 years agoconfig: allow empty values for {thin,cache}_{check,repair}_options
Peter Rajnoha [Tue, 23 Jun 2015 13:35:24 +0000 (15:35 +0200)]
config: allow empty values for {thin,cache}_{check,repair}_options

It's not an error to define empty values for
{thin,cache}_{check,repair}_options - such empty value means no
options are passed when these external commands are called.

9 years agoconfigure: add DEFAULT_USE_BLKID_WIPING
Peter Rajnoha [Tue, 23 Jun 2015 13:20:51 +0000 (15:20 +0200)]
configure: add DEFAULT_USE_BLKID_WIPING

If blkid wiping is possible, than set use_blkid_wiping=1 and
use_blkid_wiping=0 otherwise for its default value. If blkid wiping
is disabled during configure and use_blkid_wiping=1 is set by chance,
it's simply ignored - this patch is just a cleanup that makes it more
obvious for the user (we use similar logic for use_lvmetad and
use_lvmpolld settings).

9 years agoconfig: display global/umask in octal form
Peter Rajnoha [Tue, 23 Jun 2015 11:24:15 +0000 (13:24 +0200)]
config: display global/umask in octal form

9 years agoconfig: use proper unconfigured default values for use_lvmetad and use_lvmpolld settings
Peter Rajnoha [Tue, 23 Jun 2015 12:13:12 +0000 (14:13 +0200)]
config: use proper unconfigured default values for use_lvmetad and use_lvmpolld settings

Default value for lvmetad and lvmpolld has hooks in configure script,
the "lvmconfig --type default --unconfigured" should display:

   use_lvmetad = @DEFAULT_USE_LVMETAD@
   use_lvmpolld = @DEFAULT_USE_LVMPOLLD@

Note that these settings are not of string type. Recent change (the
DM_CONFIG_VALUE_FMT_STRING_NO_QUOTES formatting flag) makes it
possible to recognize that the setting is not of string type and if
there's unconfigured value defined for it, the enclosing " " is
automatically removed on output.

9 years agoconfig: cleanup default values for some configuration settings with array values
Peter Rajnoha [Tue, 23 Jun 2015 11:18:53 +0000 (13:18 +0200)]
config: cleanup default values for some configuration settings with array values

Do not use "#S" (blank string) as default value as that ends up with
'key = [ "" ]' to be generated which is not what we want in most cases.

Also, fix default values for global/{thin,cache}_{check,repair}_options
and avoid assigning blank values. For example, the thin_check_options
had this set as default value previously:

  "#S" DEFAULT_THIN_CHECK_OPTION1 "#S" DEFAULT_THIN_CHECK_OPTION2

If any (or both) of DEFAULT_THIN_CHECK_OPTION* variables was set
to "", we ended up with clumsy default value generated like:

  thin_check_options = [ "-q", "" ]

With this patch, we end up with correct:

  thin_check_options = [ "-q" ]

or, if all options are undefined:

  thin_check_options = [ ]

Which is the correct way to express this.

9 years agoconfig: add support for config value formatting flags
Peter Rajnoha [Tue, 23 Jun 2015 11:02:45 +0000 (13:02 +0200)]
config: add support for config value formatting flags

There are two basic groups of formatting flags (32 bits):
  - common ones applicable for all config value types (lower 16 bits)
  - type-related formatting flags (higher 16 bits)

With this patch, we initially support four new flags that
modify the the way the config value is displayed:

  Common flags:
  =============

  DM_CONFIG_VALUE_FMT_COMMON_ARRAY - causes array config values
    to be enclosed in "[ ]" even if there's only one item
    (previously, there was no way to recognize an array with one
     item and scalar value, hence array values with one member
     were always displayed without "[ ]" which libdm accepted
     when reading, but it may have been misleading for users)

  DM_CONFIG_VALUE_FMT_COMMON_EXTRA_SPACE - causes extra spaces to
    be inserted in "key = value" (or key = [ value, value, ... ] in
    case of arrays), compared to "key=value" seen on output before.
    This makes the output more readable for users.

  Type-related flags:
  ===================

  DM_CONFIG_VALUE_FMT_INT_OCTAL - prints integers in octal form with
    "0" as a prefix (libdm's config reading code can handle this via
    strtol just fine so it's properly recognized as number in octal
    form already if there's "0" used as prefix)

  DM_CONFIG_VALUE_FMT_STRING_NO_QUOTES - makes it possible to print
    strings without enclosing " "

This patch also adds dm_config_value_set_format_flags and
dm_config_value_get_format_flags functions to set and get
these formatting flags.

9 years agolibdaemon: allow main processing function to be specified
David Teigland [Tue, 2 Dec 2014 20:08:58 +0000 (14:08 -0600)]
libdaemon: allow main processing function to be specified

9 years agodoc: mention new invalid states in lvmetad_design
David Teigland [Tue, 23 Jun 2015 21:48:28 +0000 (16:48 -0500)]
doc: mention new invalid states in lvmetad_design

9 years agoReread global state the lvmetad copy is stale
David Teigland [Fri, 7 Nov 2014 18:51:42 +0000 (12:51 -0600)]
Reread global state the lvmetad copy is stale

This is the client side handling of the global_invalid state
added to lvmetad in commit c595b50cec8a6b95c6ac4988912d1412f3cc0237.

The function added here:
. checks if the global state in lvmetad is invalid
. if so, scans disks to update the state in lvmetad
. clears the global_invalid flag in lvmetad
. updates the local udev db to reflect any changes

9 years agoReread a VG if the lvmetad copy is stale
David Teigland [Thu, 6 Nov 2014 20:01:12 +0000 (14:01 -0600)]
Reread a VG if the lvmetad copy is stale

and update the lvmetad copy after it is reread from disk.

This is the client side handling of the vg_invalid state
added to lvmetad in commit c595b50cec8a6b95c6ac4988912d1412f3cc0237.

9 years agolvmetad: add invalidation method
David Teigland [Tue, 21 Oct 2014 14:40:13 +0000 (09:40 -0500)]
lvmetad: add invalidation method

Add the ability to invalidate global or individual VG metadata.
The invalid state is returned to lvm commands along with the metadata.
This allows lvm commands to detect stale metadata from the cache and
reread the latest metadata from disk (in a subsequent patch.)

These changes do not change the protocol or compatibility between
lvm commands and lvmetad.

Global information
------------------

Global information refers to metadata that is not isolated
to a single VG , e.g. the list of vg names, or the list of pvs.

When an external system, e.g. a locking system, detects that global
information has been changed from another host (e.g. a new vg has been
created) it sends lvmetad the message: set_global_info: global_invalid=1.
lvmetad sets the global invalid flag to indicate that its cached data is
stale.

When lvm commands request information from lvmetad, lvmetad returns the
cached information, along with an additional top-level config node called
"global_invalid".  This new info tells the lvm command that the cached
information is stale.

When an lvm command sees global_invalid from lvmated, it knows it should
rescan devices and update lvmetad with the latest information.  When this
is complete, it sends lvmetad the message: set_global_info:
global_invalid=0, and lvmetad clears the global invalid flag.  Further lvm
commands will use the lvmetad cache until it is invalidated again.

The most common commands that cause global invalidation are vgcreate and
vgextend.  These are uncommon compared to commands that report global
information, e.g. vgs.  So, the percentage of lvmetad replies containing
global_invalid should be very small.

VG information
--------------

VG information refers to metadata that is isolated to a single VG,
e.g. an LV or the size of an LV.

When an external system determines that VG information has been changed
from another host (e.g. an lvcreate or lvresize), it sends lvmetad the
message: set_vg_info: uuid=X version=N.  X is the VG uuid, and N is the
latest VG seqno that was written.  lvmetad checks the seqno of its cached
VG, and if the version from the message is newer, it sets an invalid flag
for the cached VG.  The invalid flag, along with the newer seqno are saved
in a new vg_info struct.

When lvm commands request VG metadata from lvmetad, lvmetad includes the
invalid flag along with the VG metadata.  The lvm command checks for this
flag, and rereads the VG from disk if set.  The VG read from disk is sent
to lvmetad.  lvmetad sees that the seqno in the new version matches the
seqno from the last set_vg_info message, and clears the vg invalid flag.
Further lvm commands will use the VG metadata from lvmetad until it is
next invalidated.

9 years agotests: use vgscan after enable_dev
Zdenek Kabelac [Tue, 23 Jun 2015 11:39:57 +0000 (13:39 +0200)]
tests: use vgscan after enable_dev

Since our test environment runs also in non-real-udev world,
it's using  /etc/.cache file with scanned files.

So in this case it is mandatory the user runs 'vgscan'
after a device reappears in the system.

This 'first' lvm2 command then fixes metadata (just like vgs did).

9 years agotests: skip when snapshot does not work
Zdenek Kabelac [Tue, 23 Jun 2015 11:25:09 +0000 (13:25 +0200)]
tests: skip when snapshot does not work

Some older kernel (i.e. 3.11.10 on fc20) do not work properly.
Skip the test if snapshot does not meet 50%.

9 years agotests: newer version needed for ext-orig
Zdenek Kabelac [Tue, 23 Jun 2015 09:56:42 +0000 (11:56 +0200)]
tests: newer version needed for ext-orig

9 years agocleanup: avoid printing gcc warning
Zdenek Kabelac [Tue, 23 Jun 2015 09:03:46 +0000 (11:03 +0200)]
cleanup: avoid printing gcc warning

Casting to (void) with gcc doesn't remove unused_result warning.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509

9 years agopost-release
Alasdair G Kergon [Sat, 20 Jun 2015 00:05:21 +0000 (01:05 +0100)]
post-release

9 years agopre-release v2_02_122
Alasdair G Kergon [Fri, 19 Jun 2015 23:57:35 +0000 (00:57 +0100)]
pre-release

9 years agotests: external origin updates
Zdenek Kabelac [Fri, 19 Jun 2015 14:26:18 +0000 (16:26 +0200)]
tests: external origin updates

Update test for recent updates to support unalligned sizes
and extension of reduced volume.

9 years agolog: flush stdout before print to stderr
Zdenek Kabelac [Fri, 19 Jun 2015 14:24:32 +0000 (16:24 +0200)]
log: flush stdout before print to stderr

Keep logging readable and fflush stdout before printing to stderr.

9 years agolvm: move hyphen mangling code
Zdenek Kabelac [Fri, 19 Jun 2015 07:44:14 +0000 (09:44 +0200)]
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.

9 years agodisplay: drop allocation from display_lvname
Zdenek Kabelac [Tue, 16 Jun 2015 11:47:43 +0000 (13:47 +0200)]
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).

9 years agothin: support unaligned size of external origin and thin pool
Zdenek Kabelac [Thu, 18 Jun 2015 12:38:57 +0000 (14:38 +0200)]
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.

9 years agothin: drop limitation for extension of reduced thin volume
Zdenek Kabelac [Thu, 18 Jun 2015 12:38:05 +0000 (14:38 +0200)]
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.

9 years agolibdm: add dm_tree_node_set_thin_pool_read_only
Zdenek Kabelac [Thu, 18 Jun 2015 13:15:39 +0000 (15:15 +0200)]
libdm: add dm_tree_node_set_thin_pool_read_only

Support thin-pool tree node with activation in read-only mode.
(Native kernel API).

9 years agolibdaemon: move compare_config to lib
David Teigland [Wed, 17 Jun 2015 18:06:37 +0000 (13:06 -0500)]
libdaemon: move compare_config to lib

so it can be used elsewhere.

9 years agocleanup: missing target_type check in device_is_usable filter
Peter Rajnoha [Wed, 17 Jun 2015 12:27:48 +0000 (14:27 +0200)]
cleanup: missing target_type check in device_is_usable filter

9 years agocleanup: || instead of |
Peter Rajnoha [Wed, 17 Jun 2015 12:12:18 +0000 (14:12 +0200)]
cleanup: || instead of |

More efficient with same result here.

9 years agofilter: filter-usable: consider snapshot and origin LV as unusable if its component...
Peter Rajnoha [Wed, 17 Jun 2015 11:37:53 +0000 (13:37 +0200)]
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.

9 years agoconfig: fix some settings incorrectly marked as CFG_DEFAULT_COMMENTED instead of...
Peter Rajnoha [Wed, 17 Jun 2015 11:26:11 +0000 (13:26 +0200)]
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 a98ceceb1d101f0b19a6115f406e23f13feab5ae.

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).

9 years agoAdd a global get_cmd_name()
David Teigland [Tue, 16 Jun 2015 20:13:10 +0000 (15:13 -0500)]
Add a global get_cmd_name()

Which returns the string set by set_cmd_name().

9 years agolv_refresh: move the bulk of the function into lib
David Teigland [Tue, 16 Jun 2015 18:38:40 +0000 (13:38 -0500)]
lv_refresh: move the bulk of the function into lib

So that it can be used from other lib code.

9 years agoman vgchange lvchange: mention activation option s
David Teigland [Tue, 16 Jun 2015 18:28:07 +0000 (13:28 -0500)]
man vgchange lvchange: mention activation option s

and improve the existing text about existing
activation options.

9 years agoman lvm: mention hyphens in option names
David Teigland [Tue, 16 Jun 2015 15:33:01 +0000 (10:33 -0500)]
man lvm: mention hyphens in option names

9 years agoAdd the 's' activation mode
David Teigland [Tue, 16 Jun 2015 15:18:16 +0000 (10:18 -0500)]
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

9 years agoIgnore hyphens in long option names
David Teigland [Tue, 16 Jun 2015 14:35:52 +0000 (09:35 -0500)]
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-

9 years agoxlate: add new variants
David Teigland [Tue, 16 Jun 2015 14:30:14 +0000 (09:30 -0500)]
xlate: add new variants

New variants use the clearer function names from the kernel.

9 years agolvmcache: mention lvconvert --cachemode
David Teigland [Mon, 15 Jun 2015 19:30:58 +0000 (14:30 -0500)]
lvmcache: mention lvconvert --cachemode

for changing the cache mode on an existing LV.

9 years agodebug: better tracing messages
Zdenek Kabelac [Mon, 15 Jun 2015 12:33:29 +0000 (14:33 +0200)]
debug: better tracing messages

Enhance traced output.

9 years agolibdm: better debug message
Zdenek Kabelac [Thu, 4 Jun 2015 06:45:22 +0000 (08:45 +0200)]
libdm: better debug message

Print reason for failing ioctl if thin pool message fails.

9 years agocleanup: drop double const
Zdenek Kabelac [Wed, 27 May 2015 13:46:41 +0000 (15:46 +0200)]
cleanup: drop double const

Second const is unneeded.
Also always create whole array with MAX elements.

9 years agodmeventd: better debug
Zdenek Kabelac [Mon, 15 Jun 2015 12:35:33 +0000 (14:35 +0200)]
dmeventd: better debug

Avoid using 'static' variable within threaded environmnent for debuging.

9 years agodmeventd: drop stack
Zdenek Kabelac [Mon, 15 Jun 2015 12:38:44 +0000 (14:38 +0200)]
dmeventd: drop stack

9 years agodmeventd: drop pthread_cancel
Zdenek Kabelac [Mon, 15 Jun 2015 12:39:17 +0000 (14:39 +0200)]
dmeventd: drop pthread_cancel

Drop unused pthread canceling as well as DEBUG printing in signal
handler.

9 years agopost-release
Alasdair G Kergon [Fri, 12 Jun 2015 20:42:57 +0000 (21:42 +0100)]
post-release

9 years agopre-release v2_02_121
Alasdair G Kergon [Fri, 12 Jun 2015 20:40:56 +0000 (21:40 +0100)]
pre-release

9 years agotest: Ensure that outdated PVs are wiped just once. dev-mornfall-lvmetad-repair
Petr Rockai [Wed, 10 Jun 2015 14:27:59 +0000 (16:27 +0200)]
test: Ensure that outdated PVs are wiped just once.

9 years agometadata: When outdated PVs are wiped, notify lvmetad about the fact.
Petr Rockai [Wed, 10 Jun 2015 14:27:12 +0000 (16:27 +0200)]
metadata: When outdated PVs are wiped, notify lvmetad about the fact.

9 years agometadata: Reject lvmetad metadata extensions when reading from disk.
Petr Rockai [Wed, 10 Jun 2015 14:25:57 +0000 (16:25 +0200)]
metadata: Reject lvmetad metadata extensions when reading from disk.

9 years agolvmetad: Make it possible to clear the outdated PVs list for a VG.
Petr Rockai [Wed, 10 Jun 2015 14:18:57 +0000 (16:18 +0200)]
lvmetad: Make it possible to clear the outdated PVs list for a VG.

9 years agometadata: Explain the pvs_outdated field in struct volume_group.
Petr Rockai [Wed, 10 Jun 2015 14:17:45 +0000 (16:17 +0200)]
metadata: Explain the pvs_outdated field in struct volume_group.

9 years agolvmetad, lvmpolld: remove DL_LIBS from Makefile
David Teigland [Mon, 8 Jun 2015 16:48:22 +0000 (11:48 -0500)]
lvmetad, lvmpolld: remove DL_LIBS from Makefile

and rdynamic.  They are not needed.

9 years agolvmetad.c: internal err on modifying global handle with open connection
Ondrej Kozina [Fri, 22 May 2015 12:55:42 +0000 (14:55 +0200)]
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.

9 years agolvmetad.h: rephrase API descriptions
Ondrej Kozina [Fri, 22 May 2015 12:25:54 +0000 (14:25 +0200)]
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.

9 years agoman: lvmthin chunk and metadata sizes
David Teigland [Wed, 27 May 2015 20:53:01 +0000 (15:53 -0500)]
man: lvmthin chunk and metadata sizes

Clear some stale information, and give a suggestion to use
a metadata size of 1GiB.

9 years agotests: check for idle only for raid type
Zdenek Kabelac [Wed, 27 May 2015 09:59:10 +0000 (11:59 +0200)]
tests: check for idle only for raid type

9 years agolvmetad: missing wrapper for lvmetad less compilation
Zdenek Kabelac [Wed, 27 May 2015 09:44:33 +0000 (11:44 +0200)]
lvmetad: missing wrapper for lvmetad less compilation

9 years agotests: check for clmvd socket
Zdenek Kabelac [Wed, 27 May 2015 08:43:24 +0000 (10:43 +0200)]
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.

9 years agotests: better check for array in sync
Zdenek Kabelac [Tue, 26 May 2015 11:11:46 +0000 (13:11 +0200)]
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

9 years agotests: drop debug print
Zdenek Kabelac [Mon, 25 May 2015 07:59:02 +0000 (09:59 +0200)]
tests: drop debug print

9 years agocleanup: gcc warn fix, don't hide pvs()
Zdenek Kabelac [Fri, 22 May 2015 14:23:19 +0000 (16:23 +0200)]
cleanup: gcc warn fix, don't hide pvs()

9 years agolvmpolld: terminate error message with a dot and LF
Ondrej Kozina [Wed, 27 May 2015 06:24:36 +0000 (08:24 +0200)]
lvmpolld: terminate error message with a dot and LF

9 years agoWHATS_NEW: various updates
Ondrej Kozina [Tue, 26 May 2015 14:08:24 +0000 (16:08 +0200)]
WHATS_NEW: various updates

commit c069aff21b1450923b59e98ab709a5e667cdcda9
commit 8af5f54824f889c438104625dbe159f6e8dedbc4

9 years agodmsetup: zero errno in before strtoul call
Ondrej Kozina [Tue, 26 May 2015 14:01:40 +0000 (16:01 +0200)]
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.

9 years agolvmpolld: zero errno in before strtoul call
Ondrej Kozina [Tue, 26 May 2015 13:55:16 +0000 (15:55 +0200)]
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.

9 years agolvconvert.c: fix whitespace mess
Ondrej Kozina [Mon, 25 May 2015 11:16:57 +0000 (13:16 +0200)]
lvconvert.c: fix whitespace mess

9 years agolibdm: Add dm_task_get_errno to return ioctl errno.
Alasdair G Kergon [Tue, 26 May 2015 14:13:49 +0000 (15:13 +0100)]
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]

9 years agoWHATS_NEW: update
Ondrej Kozina [Mon, 25 May 2015 08:46:38 +0000 (10:46 +0200)]
WHATS_NEW: update

update for commit: f8bf6410954fcf82bf28852e0dba015c6b7f19dc

9 years agotests: add test for pvscan --cache --background
Ondrej Kozina [Mon, 25 May 2015 08:41:14 +0000 (10:41 +0200)]
tests: add test for pvscan --cache --background

regression test for a segfault in pvscan --cache --background
bug fixed by commit:
f8bf6410954fcf82bf28852e0dba015c6b7f19dc

9 years agolvmetad.c: ignore lvmetad global handle on disconnect
Ondrej Kozina [Fri, 22 May 2015 12:48:28 +0000 (14:48 +0200)]
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>
9 years agolvconvert: change how to get failed mirrors number
Lidong Zhong [Fri, 22 May 2015 07:50:42 +0000 (15:50 +0800)]
lvconvert: change how to get failed mirrors number

Commit  b00711e3128c9cb38da90f303a3b64cf3a30fc9b improperly
convert _area_missing() replacment and moved check for
AREA_PV seg_type() into same if() section.

Signed-off-by: Lidong Zhong <lzhong@suse.com>
9 years agoscripts: activation generator: do not use --sysinit if lvmpolld used
Peter Rajnoha [Thu, 21 May 2015 09:07:07 +0000 (11:07 +0200)]
scripts: activation generator: do not use --sysinit if lvmpolld used

If lvmetad is not used, we generate lvm2-activation{-early,-net}.service
systemd services to activate any VGs found on the system. So far we used
--sysinit during this activation as polling was still forked off of the
lvm activation command.

This has changed with lvmpolld - we have proper lvmpolld systemd
service now (activated via its socket unit). As such, we don't need
to use --sysinit anymore during activation in systemd environment
as polling was the only barrier to remove the need for --sysinit.

9 years agolvmpolld-client.c: debug print when querying progress
Ondrej Kozina [Thu, 21 May 2015 09:10:09 +0000 (11:10 +0200)]
lvmpolld-client.c: debug print when querying progress

9 years agopolldaemon.c: modify log levels in report_progress
Ondrej Kozina [Thu, 21 May 2015 08:17:29 +0000 (10:17 +0200)]
polldaemon.c: modify log levels in report_progress

There's a race when asking lvmpolld about progress_status and
actually reading the progress info from kernel:

Even with lvmpolld being used we read status info from
LVM2 command issued by a user (client side from lvmpolld perspective).
The whole cycle may look like following:

1) set up an operation that requires polling (i.e. pvmove /dev/sda)
2) notify lvmpolld about such operation (lvmpolld_poll_init())
3) in case 1) was not called with --background it would continue with:
4) Ask lvmpolld about progress status. it may respond with one of:
   a) in_progress
   b) not_found
   c) finished
   d) any low level error

5) provided the answer was 4a) try to read progress info from polling LV
(i.e. vg00/pvmove1). Repeat steps 4) and 5) until the answer is != 4a).

And now we got into racy configuration: lvmpolld answered with in_progress
but it may be the that in_between 4) and 5) the operation has already
finished and polling LV is already gone or there's nothing to ask for.
Up to now, 5) would report warning and it could print such warning many
times if --interval was set to 0.

We don't want to scary users by warnings in such situation so let's just
print these messages in verbose mode. Error messages due to error while
reading kernel status info (on existing, active and locked LV) remained
the same.

9 years agoformat_text: Parse (optional) outdated_pvs section in VG metadata.
Petr Rockai [Wed, 29 Apr 2015 13:02:26 +0000 (15:02 +0200)]
format_text: Parse (optional) outdated_pvs section in VG metadata.

9 years agolvmetad: Set up lvmcache & PV structs for outdated_pvs.
Petr Rockai [Wed, 29 Apr 2015 13:01:20 +0000 (15:01 +0200)]
lvmetad: Set up lvmcache & PV structs for outdated_pvs.

9 years agolvmetad: Provide entire pvmeta sections for outdated_pvs.
Petr Rockai [Wed, 29 Apr 2015 13:00:28 +0000 (15:00 +0200)]
lvmetad: Provide entire pvmeta sections for outdated_pvs.

9 years agometadata: Add pvs_outdated to struct volume_group.
Petr Rockai [Wed, 15 Apr 2015 14:41:09 +0000 (16:41 +0200)]
metadata: Add pvs_outdated to struct volume_group.

This is a list of PVs that should have their MDAs wiped because they carry
outdated metadata (that used to belong to the VG they are attached to).

9 years agometadata: Factor _wipe_outdated_pvs() PVs out of _vg_read().
Petr Rockai [Wed, 15 Apr 2015 14:40:26 +0000 (16:40 +0200)]
metadata: Factor _wipe_outdated_pvs() PVs out of _vg_read().

9 years agolvmetad: Attach an outdated_pvs list to vg_lookup replies.
Petr Rockai [Wed, 15 Apr 2015 14:39:32 +0000 (16:39 +0200)]
lvmetad: Attach an outdated_pvs list to vg_lookup replies.

9 years agolvmetad: Clear the vgid_to_outdated_pvs hash on shutdown.
Petr Rockai [Wed, 15 Apr 2015 14:38:57 +0000 (16:38 +0200)]
lvmetad: Clear the vgid_to_outdated_pvs hash on shutdown.

9 years agolvmetad: Maintain info about outdated PVs.
Petr Rockai [Wed, 15 Apr 2015 11:00:35 +0000 (13:00 +0200)]
lvmetad: Maintain info about outdated PVs.

9 years agomakefiles: use bash subshell
Zdenek Kabelac [Wed, 20 May 2015 07:25:50 +0000 (09:25 +0200)]
makefiles: use bash subshell

Avoid using  make's $(shell invocation since the eval order is
then somewhat different and use $$(  subshell.

This also fixes a problem when more then one symbol is found,
since target shell has been given separate word list
so the 'R' assignment would need "" around it.

9 years agoconfigure: fix missing [
Zdenek Kabelac [Wed, 20 May 2015 07:07:49 +0000 (09:07 +0200)]
configure: fix missing [

9 years agoWHATS_NEW: various updates
Ondrej Kozina [Tue, 19 May 2015 19:01:24 +0000 (21:01 +0200)]
WHATS_NEW: various updates

This page took 0.078474 seconds and 5 git commands to generate.