]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agolibdm: no validate for pool without messages
Zdenek Kabelac [Mon, 14 Sep 2015 12:59:40 +0000 (14:59 +0200)]
libdm: no validate for pool without messages

Avoid validation of free space in pool, when no messages are passed.

Patch a3c7e326c3e9950fe74e433c406d6e1b5a53bf25 add new check for
pool overload - but this check should not be made if there are
no messages and transaction_id is still within 'bounds' (bigger by 1).

9 years agovgimporeclone: use correct cache dir path
Zdenek Kabelac [Mon, 14 Sep 2015 07:24:15 +0000 (09:24 +0200)]
vgimporeclone: use correct cache dir path

Commit 00b36ef06acb15c82d7c9b37872753f02c638316 had a typo
and missed '{' for shell variable, thus command used slightly
different 'tmp' dir name for cache dir (with extra '}').

Such change was unnoticed until a recent fix in persistent
filter, lvm2 missed to update cache file when --config
was specified.

The result was, /tmp dir was accumulating snap.XXXXX} dirs when
running vgimportclose  script.

9 years agotests: wait for sync before deactivation
Zdenek Kabelac [Fri, 11 Sep 2015 18:54:43 +0000 (20:54 +0200)]
tests: wait for sync before deactivation

On slower machine/disk, sync may block udev from reading and may prevent
deactivation.

9 years agotests: new thin tests
Zdenek Kabelac [Fri, 11 Sep 2015 19:00:10 +0000 (21:00 +0200)]
tests: new thin tests

9 years agomakefiles: distclean missing files
Zdenek Kabelac [Fri, 11 Sep 2015 19:30:45 +0000 (21:30 +0200)]
makefiles: distclean missing files

9 years agopool: validate pool_metadata has proper suffix
Zdenek Kabelac [Fri, 11 Sep 2015 18:58:58 +0000 (20:58 +0200)]
pool: validate pool_metadata has proper suffix

9 years agothin: improve swapping of identifiers
Zdenek Kabelac [Fri, 11 Sep 2015 18:56:53 +0000 (20:56 +0200)]
thin: improve swapping of identifiers

Since we may want to swap names when LVs are complex types, we cannot
avoid doing full renames on both LV stacks.
Temporarily use 'pvmove_tmeta' as unused name to prevent validation troubles.

9 years agothin: lvconvert use passed PVs for _pmspare
Zdenek Kabelac [Fri, 11 Sep 2015 18:56:02 +0000 (20:56 +0200)]
thin: lvconvert use passed PVs for _pmspare

When PVs are given on 'lvconvert' respect them when converting
volume to thin-pool and allocating i.e. _pmspare.

9 years agoconfigure: relocate configure.h
Zdenek Kabelac [Fri, 11 Sep 2015 19:30:05 +0000 (21:30 +0200)]
configure: relocate configure.h

Commit 9403edbb93a2c337df790408e9ff3d26566b7443 move location of
configure.h and lvm-version.h.

Let's try even better place then /conf dir which should be left
for user configurable files.

Put these files right into include dir.

9 years agoconfigure: correct message
Zdenek Kabelac [Fri, 11 Sep 2015 19:16:31 +0000 (21:16 +0200)]
configure: correct message

9 years agoman lvmlockd: move and update text about vgremove
David Teigland [Fri, 11 Sep 2015 19:34:22 +0000 (14:34 -0500)]
man lvmlockd: move and update text about vgremove

The requirement to stop VGs before vgremove applies
to both sanlock and dlm VGs.

9 years agolvmlockd: prevent vgremove of dlm VG while lockspace is used
David Teigland [Fri, 11 Sep 2015 19:06:46 +0000 (14:06 -0500)]
lvmlockd: prevent vgremove of dlm VG while lockspace is used

This applies the same rule/logic to dlm VGs that has always
existed for sanlock VGs.  Allowing a dlm VG to be removed
while its lockspace was still running on other hosts largely
worked, but there were difficult problems if another VG with
the same name was recreated.  Forcing the VG lockspace to
be stopped, gives both sanlock and dlm VGs the same behavior.

9 years agolvmlockd: remove shortcut for lockspace thread cleanup
David Teigland [Thu, 10 Sep 2015 15:33:45 +0000 (10:33 -0500)]
lvmlockd: remove shortcut for lockspace thread cleanup

This shortcut was added for an odd case that I do not
believe is relevant any more.  Having an alternate
path for lockspace thread cleanup is a complication
that could lead to problems.

9 years agolvmlockd: optimize dlm global lockspace creation
David Teigland [Thu, 10 Sep 2015 15:31:25 +0000 (10:31 -0500)]
lvmlockd: optimize dlm global lockspace creation

Set a flag indicating that the dlm global lockspace
exists to avoid going through the entire process of
trying to add it before finding it exists.

9 years agolockd: fix rescanning VG metadata
David Teigland [Fri, 11 Sep 2015 18:08:59 +0000 (13:08 -0500)]
lockd: fix rescanning VG metadata

The code was expecting the wrong return value from
compare_config, which returns 0 when equal.

This is a problem for a lockd VG using multiple PVs
when the VG needs to be rescanned.

9 years agospec: upgrade
Zdenek Kabelac [Wed, 9 Sep 2015 13:59:32 +0000 (15:59 +0200)]
spec: upgrade

Upgrade spec rules to be in touch with recent code.
Provide services and proper postin/preun/postun scriplets.

9 years agotests: remove only existing loops
Zdenek Kabelac [Wed, 9 Sep 2015 07:40:17 +0000 (09:40 +0200)]
tests: remove only existing loops

If loop device meanwhile dissapered, skip 'losetup -d' call.

9 years agotests: fix check lv_not_exist
Zdenek Kabelac [Thu, 10 Sep 2015 15:19:30 +0000 (17:19 +0200)]
tests: fix check lv_not_exist

Use 'not' to set proper 'expected return status'
so we do not 'leak' debug logs printed for failing case.

9 years agotests: check cache stripe and raid behavior
Zdenek Kabelac [Thu, 10 Sep 2015 14:54:40 +0000 (16:54 +0200)]
tests: check cache stripe and raid behavior

Somehow raid tests landed in plain cache - separte them out
so they properly check for  have_raid.

Check we do not support strip option with cache-pool creation.

9 years agocache: disallow stripes/size for cache pool
Zdenek Kabelac [Thu, 10 Sep 2015 14:33:11 +0000 (16:33 +0200)]
cache: disallow stripes/size for cache pool

ATM allocation can't handle stripping and cache pool allocation.
It's not yet even clear what should be actually result.
Until resolved, disable this option (it's been coredumping
inside allocation anyway).

9 years agocache: warn if caching causes troubles
Zdenek Kabelac [Thu, 10 Sep 2015 13:07:59 +0000 (15:07 +0200)]
cache: warn if caching causes troubles

Certain stacks of cached LVs may have unexpected consequences.
So add a warning function called when LV is cached to detect
such caces and WARN user about them - the best we could do ATM.

9 years agolib: when moving segtypes, move LV bits
Zdenek Kabelac [Thu, 10 Sep 2015 13:08:29 +0000 (15:08 +0200)]
lib: when moving segtypes, move LV bits

When we insert layer we also move status flag-bits for certain LV types,
so internal volume_group structure remains consistent.
(Perhaps it's misuse of 'insert_layer' function and we should have
another similar function for this.)

Basically we aim to maintain the same state as after reading fresh
metadata out of volume group.

Currently we when i.e. cache  'raid' LV - this should transfer 'raidLV' flag
to  _corigin LV and cache is no longer a raid.

TODO: bits for stacked devices needs more exact rules.

9 years agolvmlockd: check all variations of lvb values
David Teigland [Wed, 9 Sep 2015 19:40:48 +0000 (14:40 -0500)]
lvmlockd: check all variations of lvb values

The dlm will often lose the lvb content, so we need to
check quite a few possibilities for lvb values that
were not being checked before.

Refactoring was required to pass the entire lvb value
back to the core code instead of the single value.

The only functional change should be detecting new
lvb states where metadata is now invalidated where
it wasn't before.

9 years agolvmlockd: flag for internal actions
David Teigland [Wed, 9 Sep 2015 18:33:10 +0000 (13:33 -0500)]
lvmlockd: flag for internal actions

When an action is created by lvmlockd for itself,
there is no client to send the result to.  Add
the NO_CLIENT flag to the action to skip sending
the result to a client.

9 years agolvmlockd: rename ADOPT_CLIENT_ID
David Teigland [Wed, 9 Sep 2015 18:25:39 +0000 (13:25 -0500)]
lvmlockd: rename ADOPT_CLIENT_ID

to INTERNAL_CLIENT_ID since it will be
used for more than adopting locks.

9 years agolockd: add start_init arg to lockd_start_vg
David Teigland [Wed, 9 Sep 2015 18:20:37 +0000 (13:20 -0500)]
lockd: add start_init arg to lockd_start_vg

Add a new arg to lockd_start_vg() that indicates
it is being called for a new lockd VG, so that
lvmlockd knows the lockspace being started is new.
(Will be used by a following commit.)

9 years agovgchange: lock-stop only needs shared lock
David Teigland [Wed, 9 Sep 2015 18:09:17 +0000 (13:09 -0500)]
vgchange: lock-stop only needs shared lock

lock-stop is one of the vgchange options that
doesn't change the VG so we can override the
default ex lock and use sh.

9 years agodev-cache: ignore persistent cache if configuration changed
Peter Rajnoha [Thu, 10 Sep 2015 14:00:14 +0000 (16:00 +0200)]
dev-cache: ignore persistent cache if configuration changed

Commit f6473baffc2d0b486b2aa941cf2681683026b3a5 introduced a new
cmd->initialized variable to keep info about which parts of the
cmd_context have been initialized.

A part of this patch was also a change in refresh_filters fn
which checks for cmd->initialized.filters variable and it does
the filter refresh *only* if the filter has already been initialized
before otherwise it's a NOOP (before, the refresh_filters also
initialized filters as a side effect in case it had not been
initialized before which was not quite correct).

However, the commit f6473baffc2d0b486b2aa941cf2681683026b3a5
did not handle the case in which configuration changes
either via --config argument or when configuration file changed
and its timestamp was higher than the timestamp of the persistent
cache file - the /etc/lvm/cache/.cache.

This patch fixes this issue and it causes the init_filters fn
in lvm_run_command fn to be called with proper value of
"load_persistent_cache" switch even if the configuration changes,
hence causing the persistent cache file to be ignored in this
case.

9 years agoman lvmlockd: fix typo
David Teigland [Wed, 9 Sep 2015 20:43:28 +0000 (15:43 -0500)]
man lvmlockd: fix typo

9 years agoman lvmlockd: mention device used for first vgcreate
David Teigland [Wed, 9 Sep 2015 20:21:10 +0000 (15:21 -0500)]
man lvmlockd: mention device used for first vgcreate

9 years agotests: ensure dd flushed all data before exit
Zdenek Kabelac [Tue, 8 Sep 2015 12:11:46 +0000 (14:11 +0200)]
tests: ensure dd flushed all data before exit

9 years agotests: better check for compiled version
Zdenek Kabelac [Tue, 8 Sep 2015 12:11:06 +0000 (14:11 +0200)]
tests: better check for compiled version

Use install /lib files to check for expected version.

9 years agomakefiles: ensure no old .h are left
Zdenek Kabelac [Tue, 8 Sep 2015 12:33:29 +0000 (14:33 +0200)]
makefiles: ensure no old .h are left

Ensure make clean  cleans any left-over file from their previous
location so they are not in conflict with new ones.

Also hide error message when .commands file is not present.

9 years agoWHATS_NEW: commit b77497cbd86a854add3ffa4ce09a35f165c0d2ba
Peter Rajnoha [Tue, 8 Sep 2015 13:37:23 +0000 (15:37 +0200)]
WHATS_NEW: commit b77497cbd86a854add3ffa4ce09a35f165c0d2ba

9 years agofilters: make sure regex filter is evaluated before any filter that needs disk access
Peter Rajnoha [Tue, 8 Sep 2015 13:03:15 +0000 (15:03 +0200)]
filters: make sure regex filter is evaluated before any filter that needs disk access

The regex filter (controlled by devices/filter lvm.conf setting) was
evaluated as the very last filter. However, this is not optimal when
it comes to restricting disk access - users define devices/filter
as well as devices/global_filter to avoid this.

The devices/global_filter is already positioned at the beginning of the
filter chain. We need to do the same for devices/filter.

Filter chains before this patch:

  A: when lvmetad is not used:
       persistent_filter -> sysfs_filter -> global_regex_filter ->
       type_filter -> usable->filter -> mpath_component_filter ->
       partition_filter -> md_component_filter -> fw_raid_filter ->
       regex_filter

  B: when lvmetad is used:

    B1: to update lvmetad:
      sysfs_filter -> global_regex_filter -> type_filter ->
      usable_filter -> mpath_component_filter -> partition_filter ->
      md_component_filter -> fw_raid_filter

    B2: to retrieve info from lvmetad:
      persistent_filter -> usable_filter -> regex_filter

From the chain list above we can see that particularly in case when
lvmetad is not used, the regex filter is the very last one that is
processed. If lvmetad is used, it doesn't matter much as there's
the global_regex_filter which is used instead when updating lvmetad
and when retrieving info from lvmetad, putting regex_filter in front
of usable_filter wouldn't change much since usabled_filter is not
reading disks directly.

This patch puts the regex filter to the front even in case lvmetad
is not used, hence reinstating the state as it was before commit
a7be3b12dfe7388d1648595e6cc4c7a1379bb8a7 (which moved the regex_filter
position in the chain). Still, the arguments for the commit
a7be3b12dfe7388d1648595e6cc4c7a1379bb8a7 still apply and they're
still satisfied since component filters (MD, mpath...) are evaluated
first just before updating lvmetad.

So with this patch, we end up with:

  A: when lvmetad is not used:
       persistent_filter -> sysfs_filter -> global_regex_filter ->
       regex_filter -> type_filter -> usable->filter ->
       mpath_component_filter -> partition_filter ->
       md_component_filter -> fw_raid_filter

  B: when lvmetad is used:

    B1: to update lvmetad:
      sysfs_filter -> global_regex_filter -> type_filter ->
      usable_filter -> mpath_component_filter -> partition_filter ->
      md_component_filter -> fw_raid_filter

    B2: to retrieve info from lvmetad:
      persistent_filter -> regex_filter -> usable_filter

This way, specifying the regex_filter in non-lvmetad case causes
the devices to be filtered based on regex first before processing
any other filters which can access disks (like md_component_filter).

This patch also streamlines the code for better readability.

9 years agotests: skip raid testing on 4.[1,2] fc24 kernels
Zdenek Kabelac [Tue, 8 Sep 2015 10:00:12 +0000 (12:00 +0200)]
tests: skip raid testing on 4.[1,2] fc24 kernels

Hopefull 4.3 will be fixed and test will be updated to let
raid test running again.

Meanwhile using md-raid may effectively kill kernel,
so leave at least other tests running.

9 years agospecs: install lvmlockctl only when built
Zdenek Kabelac [Mon, 7 Sep 2015 21:27:50 +0000 (23:27 +0200)]
specs: install lvmlockctl only when built

Move install line into proper section.

9 years agolibdm: clean up stats local variable use
Bryn M. Reeves [Mon, 7 Sep 2015 19:08:10 +0000 (20:08 +0100)]
libdm: clean up stats local variable use

9 years agolibdm: fix display of nsec suffixes in histogram strings
Bryn M. Reeves [Mon, 7 Sep 2015 19:11:28 +0000 (20:11 +0100)]
libdm: fix display of nsec suffixes in histogram strings

9 years agolibdm: clean up _build_histogram_arg()
Bryn M. Reeves [Mon, 7 Sep 2015 17:27:22 +0000 (18:27 +0100)]
libdm: clean up _build_histogram_arg()

Split up _build_histogram_arg() into separate functions to allocate
and fill the histogram arg string and remove nested local variable
declarations from the parent function.

9 years agolibdm: only free the first histogram explicitly (Coverity)
Bryn M. Reeves [Mon, 7 Sep 2015 16:53:56 +0000 (17:53 +0100)]
libdm: only free the first histogram explicitly (Coverity)

Coverity flags a user-after-free in _stats_histograms_destroy():

>>>     Calling "dm_pool_free" frees pointer "mem->chunk" which has
>>>     already been freed.

This should not be possible since the histograms are destroyed in
reverse order of allocation:

 203         for (n = _nr_areas_region(region) - 1; n; n--)
 204                 if (region->counters[n].histogram)
 205                         dm_pool_free(mem, region->counters[n].histogram);

It appears that Coverity is unaware that pool->chunk is updated
during the call to dm_pool_free() and valgrind flags no errors in
this function when called with multiple allocated histograms.

Since there is no actual need to free the histograms individually
in this way simplify the code and just free the first allocated
object (which will also free all later allocated histograms in a
single call).

9 years agocleanup: assign seg_name once
Zdenek Kabelac [Fri, 4 Sep 2015 07:42:45 +0000 (09:42 +0200)]
cleanup: assign seg_name once

9 years agospecs: package lvmlockctl man page
Zdenek Kabelac [Mon, 7 Sep 2015 14:40:46 +0000 (16:40 +0200)]
specs: package lvmlockctl man page

9 years agotests: update install rules
Zdenek Kabelac [Fri, 4 Sep 2015 14:34:34 +0000 (16:34 +0200)]
tests: update install rules

Enhnace 'make install' rules for test suite (used for rpm packaging).
Install lvmlockd conf files.
Compile runner with correct CXXFLAGS.

9 years agomakefiles: do not generate tags for everyone
Zdenek Kabelac [Mon, 7 Sep 2015 11:44:14 +0000 (13:44 +0200)]
makefiles: do not generate tags for everyone

Create tags file only on request (make tags).
Also clean file with 'make clean'.

9 years agomakefiles: deps depends on header links
Zdenek Kabelac [Mon, 7 Sep 2015 12:00:27 +0000 (14:00 +0200)]
makefiles: deps depends on header links

Put include/.symlinks_created as a prerequisite for dep calc.
Otherwise if these are not generated and user enters tests subdir and
runs 'make' he just gets endless loop of dep calculation.

9 years agoconfigure: regenerate
Zdenek Kabelac [Mon, 7 Sep 2015 12:02:25 +0000 (14:02 +0200)]
configure: regenerate

9 years agoconfigure: simpler version reading
Zdenek Kabelac [Mon, 7 Sep 2015 11:58:54 +0000 (13:58 +0200)]
configure: simpler version reading

Avoid calling 'cat' when 'read' could handle it.

Also drop DM_LIB_VERSION from AC_SUBST as it's not used anywhere
in .in file.

9 years agoconfigure: support --disable-dependency-tracking
Zdenek Kabelac [Mon, 7 Sep 2015 11:57:38 +0000 (13:57 +0200)]
configure: support --disable-dependency-tracking

One-time build may enjoy little speedup of build when dependencies are not
calculated.

9 years agoconfigure: relocate generated headers
Zdenek Kabelac [Mon, 7 Sep 2015 11:49:17 +0000 (13:49 +0200)]
configure: relocate generated headers

Relocate generated configure.h and lvm-version.h outside
of compilable .c source tree.

The reason is behind - when compiling in builddir != srcdir
the generated file in lib/misc/configure.h was used for all compiled
source file except ones located in lib/misc dir - those would have used
configure.h file located in this dir - if there have existed one (i.e.
from some other build)

This problem was only visible, when srcdir == buildir was used before
trying to use  srcdri != builddir  (as configure.h appeared then in
srcdir).

9 years agolibdm: fix dm_stats leak in dm_stats_create()
Bryn M. Reeves [Mon, 7 Sep 2015 11:08:34 +0000 (12:08 +0100)]
libdm: fix dm_stats leak in dm_stats_create()

The histogram changes adds a new error path to dm_stats_create().
Make sure that the dm_stats handle is properly destroyed if we fail
to create the histogram pool and check for failures setting the
program_id.

9 years agolibdm: handle pool errors in dm_histogram_to_string()
Bryn M. Reeves [Mon, 7 Sep 2015 11:01:20 +0000 (12:01 +0100)]
libdm: handle pool errors in dm_histogram_to_string()

9 years agolibdm: check dm_pool_begin_object() return value.
Bryn M. Reeves [Mon, 7 Sep 2015 10:52:54 +0000 (11:52 +0100)]
libdm: check dm_pool_begin_object() return value.

9 years agolibdm: add missing error handling in _stats_parse_histogram()
Bryn M. Reeves [Mon, 7 Sep 2015 10:44:53 +0000 (11:44 +0100)]
libdm: add missing error handling in _stats_parse_histogram()

Since we are growing an object in the histogram pool the return
value of dm_pool_grow_object() must be checked and error paths need
to abandon the object before returning.

9 years agodmsetup: fix bounds leak in _do_stats_create_regions()
Bryn M. Reeves [Mon, 7 Sep 2015 10:14:28 +0000 (11:14 +0100)]
dmsetup: fix bounds leak in _do_stats_create_regions()

If we fail to create the DM_DEVICE_TABLE dm_task destroy the bounds
object before returning.

9 years agopost-release
Alasdair G Kergon [Sat, 5 Sep 2015 22:58:40 +0000 (23:58 +0100)]
post-release

9 years agostyle: Standardise some error paths.
Alasdair G Kergon [Sat, 5 Sep 2015 22:56:30 +0000 (23:56 +0100)]
style: Standardise some error paths.

9 years agopre-release v2_02_130
Alasdair G Kergon [Sat, 5 Sep 2015 22:46:22 +0000 (23:46 +0100)]
pre-release

9 years agoWHATS_NEW_DM: fix histogram entries for 1.02.107
Bryn M. Reeves [Fri, 4 Sep 2015 18:53:10 +0000 (19:53 +0100)]
WHATS_NEW_DM: fix histogram entries for 1.02.107

The histogram entries were under the wrong version (1.02.106). Fix
that and describe the library changes in more detail.

9 years agolvmlockd: don't stop lockspace for EREMOVED
David Teigland [Fri, 4 Sep 2015 18:41:38 +0000 (13:41 -0500)]
lvmlockd: don't stop lockspace for EREMOVED

Undo the part of the recent EREMOVED change which
automatically stopped the lockspace for a remotely
removed VG.  It didn't always work (would not work
when lvb content was rebuilt in the dlm).  This will
be handled better when the lvb content is controlled
more strictly.

9 years agoman lvmlockd: add section about first sanlock VG
David Teigland [Fri, 4 Sep 2015 18:01:03 +0000 (13:01 -0500)]
man lvmlockd: add section about first sanlock VG

Add a section specifically about creating the first
sanlock VG.

9 years agoman lvmlockctl: add man page
David Teigland [Fri, 4 Sep 2015 16:02:48 +0000 (11:02 -0500)]
man lvmlockctl: add man page

9 years agolvmlockctl: update command descriptions and add logging
David Teigland [Fri, 4 Sep 2015 16:01:25 +0000 (11:01 -0500)]
lvmlockctl: update command descriptions and add logging

The one line descriptions will match the man page.

Add a syslog entry when enabling/disabling the global lock
to help debugging.

9 years agoman lvmlockd: explain the use of lvmlockctl kill
David Teigland [Fri, 4 Sep 2015 15:29:01 +0000 (10:29 -0500)]
man lvmlockd: explain the use of lvmlockctl kill

9 years agodev-cache: fix use of uninitialized device status if reading outdated .cache record
Peter Rajnoha [Fri, 4 Sep 2015 16:00:29 +0000 (18:00 +0200)]
dev-cache: fix use of uninitialized device status if reading outdated .cache record

As part of fix that came with cf700151eba483aeedbf790fd66ce1c44e19c707,
I forgot to add the check whether the result of stat was successful or
not. This bug caused uninitialized buffer to be used for entries
from .cache file which are no longer valid.

This bug may have caused these uninitialized values to be used further,
for example (see the unreal (2567,590944) representing major:minor
pair):

$ pvs
  /dev/abc: stat failed: No such file or directory
  Path /dev/abc no longer valid for device(2567,590944)
  PV               VG   Fmt  Attr PSize   PFree
  /dev/mapper/test      lvm2 ---  104.00m 104.00m
  /dev/vda2        rhel lvm2 a--    9.51g      0

9 years agovgchange: improve error message about changing lock type
David Teigland [Fri, 4 Sep 2015 14:53:33 +0000 (09:53 -0500)]
vgchange: improve error message about changing lock type

9 years agolibdm: fix uninitialized variable warnings on older gcc
Bryn M. Reeves [Fri, 4 Sep 2015 10:40:19 +0000 (11:40 +0100)]
libdm: fix uninitialized variable warnings on older gcc

Older versions of gcc aren't able to track the assignments of
local variables as well as the latest versions leading to spurious
warnings like:

libdm-stats.c:2183: warning: "len" may be used uninitialized in this
function
libdm-stats.c:2177: warning: "minwidth" may be used uninitialized in
this function

Both of these variables are in fact assigned in all possible paths
through the function and later compilers do not produce these
warnings.

There's no reason to not initialize these variables though and
it makes the function slightly easier to follow.

Also fix one use of 'unsigned' for a nr_bins value.

9 years agodmstats: replace histogram command with switch
Bryn M. Reeves [Thu, 3 Sep 2015 22:00:44 +0000 (23:00 +0100)]
dmstats: replace histogram command with switch

Replace the histogram stats subcommand with a --histogram switch
to enable histogram related fields for both list and report output.

To avoid overloading the existing --histogram rename it to --bounds:
this is also a better description of the option.

9 years agolvmlockd: fixes for starting dlm global lockspace
David Teigland [Thu, 3 Sep 2015 21:42:19 +0000 (16:42 -0500)]
lvmlockd: fixes for starting dlm global lockspace

Remove the optimization/shortcut for starting the dlm global
lockspace when it was already running.

Reenable automatically starting the dlm global lockspace
when a command attempts to use it and it's not yet started.
This had become disabled at some point.

9 years agolockd: check for unlock failure in all cases
David Teigland [Thu, 3 Sep 2015 18:47:54 +0000 (13:47 -0500)]
lockd: check for unlock failure in all cases

This suppresses an unwanted error message.

9 years agolvmlockd: improve log messages for adding dlm global lockspace
David Teigland [Thu, 3 Sep 2015 18:39:56 +0000 (13:39 -0500)]
lvmlockd: improve log messages for adding dlm global lockspace

9 years agotests: update thin test
Zdenek Kabelac [Thu, 3 Sep 2015 21:05:33 +0000 (23:05 +0200)]
tests: update thin test

Use slightly better values

9 years agotests: use conv=fdatasync
Zdenek Kabelac [Thu, 3 Sep 2015 21:04:15 +0000 (23:04 +0200)]
tests: use conv=fdatasync

Should be slightly better to flushed before dd exits
instead of using direct IO.

9 years agocleanup: use just 2 decimal digits
Zdenek Kabelac [Wed, 2 Sep 2015 14:13:50 +0000 (16:13 +0200)]
cleanup: use just 2 decimal digits

9 years agocleanup: avoid printing -0.00
Zdenek Kabelac [Thu, 3 Sep 2015 20:51:15 +0000 (22:51 +0200)]
cleanup: avoid printing -0.00

Nice trick to not print -0.00 for some percent values.

9 years agocleanup: show error message
Zdenek Kabelac [Wed, 26 Aug 2015 12:14:44 +0000 (14:14 +0200)]
cleanup: show error message

Add error message on error path.

9 years agolvcreate: restore missed --monitor
Zdenek Kabelac [Thu, 27 Aug 2015 15:19:09 +0000 (17:19 +0200)]
lvcreate: restore missed --monitor

Fix regression from d13239b0547e09def4b58b0f49bd0252f459d431.
This patch reorganized whole command option parsing, however
it has lost support to accept --monitor arg.

9 years agodmeventd: reorder mempool allocation
Zdenek Kabelac [Thu, 3 Sep 2015 15:39:03 +0000 (17:39 +0200)]
dmeventd: reorder mempool allocation

Since lvm2_init() effectively detects memory leaks
allocate mempool after this initialization
(so it's not reported as leak).

9 years agothin: do not flush when quering for thin percent
Zdenek Kabelac [Thu, 3 Sep 2015 20:57:50 +0000 (22:57 +0200)]
thin: do not flush when quering for thin percent

Since we may easily get blocked when checking for percentage
of thin-pool - do not flush and just show current values.
This avoids holding VG locked when pool is overfilled.

9 years agothin: validate mapped size of thin volume
Zdenek Kabelac [Thu, 3 Sep 2015 20:52:21 +0000 (22:52 +0200)]
thin: validate mapped size of thin volume

Never show we map more then 100% for a volume.
But show warning when there could be some consistency problems.

9 years agothin: detect unusable thins
Zdenek Kabelac [Wed, 2 Sep 2015 14:13:31 +0000 (16:13 +0200)]
thin: detect unusable thins

Try to detect thin-pool which my block lvm2 command from furher
processing (i.e. lvextend).

Check if pool is read-only or out-of-space and in this case thins
will skipped from being scanned (so user may miss some PVs located
on thin volumes).

9 years agofilters: swap device_is_usable test
Zdenek Kabelac [Wed, 2 Sep 2015 14:08:30 +0000 (16:08 +0200)]
filters: swap device_is_usable test

Fix regression introduced with commit:
2fc126b00d83991c6a2f3ed9aa61457294a4c45e

This commit has moved  pv_min_size() test in front
of device_is_usable(). However pv_min_size needs to open device,
so it may have actually get blocked.

So restore the original order and first validate
dm device to be usable for open.

It's worth to note that such check is not 'race-free',
but it usually eliminates 99.99% of problems ;).

9 years agolibdm: relocate parsing of thin-pool status
Zdenek Kabelac [Wed, 2 Sep 2015 09:10:59 +0000 (11:10 +0200)]
libdm: relocate parsing of thin-pool status

Use single routine for parsing status.

Internally we do not need to allocate pool memory for
passed struct.

9 years agoconfigure: better parsing of cache_check version
Zdenek Kabelac [Thu, 3 Sep 2015 20:48:56 +0000 (22:48 +0200)]
configure: better parsing of cache_check version

Properly read also version string like  0.5.5-1.fc24
and read just first 3 digits split by '.'

Also remove one extra  $HAVE_REALTIME.

9 years agodmstats: support --noheadings for histogram fields
Bryn M. Reeves [Thu, 3 Sep 2015 20:56:34 +0000 (21:56 +0100)]
dmstats: support --noheadings for histogram fields

9 years agodmstats: add --notimesuffix switch
Bryn M. Reeves [Thu, 3 Sep 2015 20:55:25 +0000 (21:55 +0100)]
dmstats: add --notimesuffix switch

Add a switch to disable the printing of time unit suffixes in
histogram bounds descriptions.

9 years agolibdm: allow formatting histogram strings with no whitespace
Bryn M. Reeves [Thu, 3 Sep 2015 20:48:15 +0000 (21:48 +0100)]
libdm: allow formatting histogram strings with no whitespace

Allow dm_histogram_to_string() to format histogram strings with
no whitespace by passing a width value less than zero.

9 years agovgrename: add missing trace on error path
David Teigland [Thu, 3 Sep 2015 15:38:16 +0000 (10:38 -0500)]
vgrename: add missing trace on error path

9 years agolockd: vgrename fixes
David Teigland [Thu, 3 Sep 2015 15:21:44 +0000 (10:21 -0500)]
lockd: vgrename fixes

If busy locks in lvmlockd prevent vgrename, use the
correct error exit path, and print a user-friendly
error message.

9 years agodev-cache: append (major:minor) to debug messages about adding device or its alias...
Peter Rajnoha [Thu, 3 Sep 2015 12:36:15 +0000 (14:36 +0200)]
dev-cache: append (major:minor) to debug messages about adding device or its alias to cache

device/dev-cache.c:350         /dev/sda: Added to device cache (8:0)
device/dev-cache.c:346         /dev/disk/by-id/lvm-pv-uuid-5nPovF-EWp4-vBwd-ylCJ-9Y0B-yzHQ-ek1li2: Aliased to /dev/sda in device cache (8:0)
...

9 years agofilters: do not print [none:nil] as external device info's [source:handler] if "none...
Peter Rajnoha [Thu, 3 Sep 2015 12:19:48 +0000 (14:19 +0200)]
filters: do not print [none:nil] as external device info's [source:handler] if "none" source is used

Print [source:handler] in filters' debug messages only if external
device info source other than "none" is used.

$ lvmconfig --type full devices/external_device_info_source
external_device_info_source="none

Before this patch (from the -vvvv log):

filters/filter-usable.c:47         /dev/mapper/test: Skipping: Too small to hold a PV [none:(nil)]
filters/filter-md.c:33         /dev/sdb: Skipping md component device [none:(nil)]
filters/filter-partitioned.c:25         /dev/vda: Skipping: Partition table signature found [none:(nil)]

With this patch applied:

filters/filter-usable.c:44         /dev/mapper/test: Skipping: Too small to hold a PV
filters/filter-md.c:35         /dev/sdb: Skipping md component device
filters/filter-partitioned.c:27         /dev/vda: Skipping: Partition table signature found

9 years agolibdm: pkgconfig: fix devmapper.pc to not reference nonexistent rt.pc file
Peter Rajnoha [Thu, 3 Sep 2015 07:28:42 +0000 (09:28 +0200)]
libdm: pkgconfig: fix devmapper.pc to not reference nonexistent rt.pc file

librt doesn't have a pkgconfig file so use Libs.private: -lrt instead
to declare the dependency directly.

The same applies for -lm which is also used and which hasn't been
defined in the devmapper.pc file yet.

9 years agoman: fix typo in dmstats.8.in
Bryn M. Reeves [Wed, 2 Sep 2015 22:01:46 +0000 (23:01 +0100)]
man: fix typo in dmstats.8.in

9 years agoman: document --regionid in dmstats.8.in
Bryn M. Reeves [Wed, 2 Sep 2015 19:35:43 +0000 (20:35 +0100)]
man: document --regionid in dmstats.8.in

9 years agoman: update dmstats.8.in examples
Bryn M. Reeves [Wed, 2 Sep 2015 11:19:13 +0000 (12:19 +0100)]
man: update dmstats.8.in examples

Make sure that correct 'dmstats create' messages are shown for all
examples and fix LV examples to use correct dmsetup output name
format (vg/lv -> vg-lv).

9 years agodmstats: improve stats column names
Bryn M. Reeves [Sat, 22 Aug 2015 18:35:43 +0000 (19:35 +0100)]
dmstats: improve stats column names

Improve the names and labels of stats reports columns, ensure that
the minimum field widths allow unambiguos labels to be shown and
update the man page descriptions of these fields.

9 years agodmstats: add histogram support
Bryn M. Reeves [Tue, 18 Aug 2015 11:40:03 +0000 (12:40 +0100)]
dmstats: add histogram support

Add support to dmstats to create and report histograms.

Add a --histogram switch to 'create' that accepts a string
description of bin boundaries and DR_STATS and DR_STATS_META fields
to report bin configuration and absolute and relative histogram
values:

  hist_bins
  hist_bounds
  hist_ranges
  hist_count
  hist_count_bounds
  hist_count_ranges
  hist_percent
  hist_percent_bounds
  hist_percent_ranges

A new 'histogram' subcommand displays a report that emphasizes
histogram data as either counters or percentage values.

9 years agolibdm: add latency histogram support
Bryn M. Reeves [Wed, 19 Aug 2015 19:39:10 +0000 (20:39 +0100)]
libdm: add latency histogram support

Add support for creating, parsing, and reporting dm-stats latency
histograms on kernels that support precise_timestamps.

Histograms are specified as a series of time values that give the
boundaries of the bins into which I/O counts accumulate (with
implicit lower and upper bounds on the first and last bins).

A new type, struct dm_histogram, is introduced to represent
histogram values and bin boundaries.

The boundary values may be given as either a string of values (with
optional unit suffixes) or as a zero terminated array of uint64_t
values expressing boundary times in nanoseconds.

A new bounds argument is added to dm_stats_create_region() which
accepts a pointer to a struct dm_histogram initialised with bounds
values.

Histogram data associated with a region is parsed during a call to
dm_stats_populate() and used to build a table of histogram values
that are pointed to from the containing area's counter set. The
histogram for a specified area may then be obtained and interogated
for values and properties.

This relies on kernel support to provide the boundary values in
a @stats_list response: this will be present in 4.3 and 4.2-stable. A
check for a minimum driver version of 4.33.0 is implemented to ensure
that this is present (4.32.0 has the necessary precise_timestamps and
histogram features but is unable to report these via @stats_list).

Access methods are provided to retrieve histogram values and bounds
as well as simple string representations of the counts and bin
boundaries.  Methods are also available to return the total count
for a histogram and the relative value (as a dm_percent_t) of a
specified bin.

9 years agolibdm: reset report field widths in _destroy_rows()
Bryn M. Reeves [Mon, 24 Aug 2015 10:38:17 +0000 (11:38 +0100)]
libdm: reset report field widths in _destroy_rows()

For repeating reports field widths should be re-calculated for
each report interval. Not doing so will cause a single row with
wide field data to cause all subsequent rows to share the width:

Name                                      RgID ArID R/s     W/s    Histogram                                     Bounds
vg_hex-lv_home                               0    0 4522.00 834.00 0s:   991, 2ms:   152, 4ms:   161, 6ms:  4052 0s, 2ms, 4ms, 6ms
vg_hex-lv_swap                               0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_root                               0    0 1754.00 683.00 0s:  369, 2ms:   65, 4ms:   90, 6ms: 1913     0s, 2ms, 4ms, 6ms
luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e    0    0 4522.00 868.00 0s:   985, 2ms:   152, 4ms:   161, 6ms:  4092 0s, 2ms, 4ms, 6ms
vg_hex-lv_images                             0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms

Name                                      RgID ArID R/s     W/s    Histogram                                     Bounds
vg_hex-lv_home                               0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_swap                               0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_root                               0    0    0.00   2.00 0s: 1, 2ms: 0, 4ms: 0, 6ms: 1                 0s, 2ms, 4ms, 6ms
luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e    0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
vg_hex-lv_images                             0    0    0.00   0.00 0s: 0, 2ms: 0, 4ms: 0, 6ms: 0                 0s, 2ms, 4ms, 6ms
                                                                                                ^^^^^^^^^^^^^^^^^
This is especially significant for the current histogram fields:
depending on the time since the last clear operation the first
report iteration may contain very large values leading to a very
large minimum field width. Without resetting field widths this
large minimum field width value is used for all subsequent rows.

9 years agopvmove: skip polling later in test mode
Ondrej Kozina [Wed, 2 Sep 2015 14:54:22 +0000 (16:54 +0200)]
pvmove: skip polling later in test mode

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