]> sourceware.org Git - lvm2.git/log
lvm2.git
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

9 years agolvconvert: skip polling in test mode
Ondrej Kozina [Wed, 2 Sep 2015 14:53:23 +0000 (16:53 +0200)]
lvconvert: skip polling in test mode

9 years agolvmpolld.8.in: add missing space
Ondrej Kozina [Wed, 2 Sep 2015 14:52:03 +0000 (16:52 +0200)]
lvmpolld.8.in: add missing space

9 years agolvmpolld: make lvpoll error messages visible
Ondrej Kozina [Wed, 2 Sep 2015 14:50:14 +0000 (16:50 +0200)]
lvmpolld: make lvpoll error messages visible

Previously all stderr messages issued by spawned lvpoll command were reported
as INFO only. This made all such messages invisible in syslog or lvmpolld log
while running default configuration.

All lvpoll stderr messages are loged with WARN priority now and lvpoll
command exiting with retcode != 0 is logged with ERROR priority in
syslog and lvmpolld log

9 years agolibdm: Reinstate dm_task_get_info@Base.
Alasdair G Kergon [Tue, 1 Sep 2015 15:26:02 +0000 (16:26 +0100)]
libdm: Reinstate dm_task_get_info@Base.

Move the version script local:* wildcard into a node of its own
to avoid conflicting with in-source export macro definitions.

9 years agolvmlockd: also use vg name in set_vg_info
David Teigland [Fri, 28 Aug 2015 19:40:28 +0000 (14:40 -0500)]
lvmlockd: also use vg name in set_vg_info

Include both the VG uuid and name in the lvmetad
set_vg_info message.  This works around an obscure
problem where the VG uuid in lvmlockd is wrong
when one host removes a dlm VG, then creates a new
VG with the same name.  If the dlm lockspace for
the initial VG was never stopped on another host,
that other host will be using the old uuid in its
lvmetad set_vg_info message.  (That can be
corrected with a larger change, but this is an
effective workaround.)

9 years agolvmetad: also accept vg name for set_vg_info
David Teigland [Fri, 28 Aug 2015 19:36:48 +0000 (14:36 -0500)]
lvmetad: also accept vg name for set_vg_info

set_vg_info previously accepted only vg uuid,
now accept both vg uuid and vg name.  If the
uuid is provided, it's used just as before,
but if the uuid is not provided, or if it's
not found, then fall back to using the vg
name if that is provided.

9 years agoman lvmlockd: various improvements
David Teigland [Fri, 28 Aug 2015 16:37:55 +0000 (11:37 -0500)]
man lvmlockd: various improvements

9 years agoman: Add install_full_man makefile target.
Alasdair G Kergon [Fri, 28 Aug 2015 12:03:18 +0000 (13:03 +0100)]
man: Add install_full_man makefile target.

'make install_full_man' installs all the man pages regardless of
which components were enabled when 'configure' was run.

9 years agolvmlockd: VG lock can be used when changing lock type
David Teigland [Thu, 27 Aug 2015 21:34:51 +0000 (16:34 -0500)]
lvmlockd: VG lock can be used when changing lock type

This bit was missed from commit de4db6a that added
changing lock_type.

9 years agolvmlockd: fix starting dlm global lockspace
David Teigland [Thu, 27 Aug 2015 21:00:24 +0000 (16:00 -0500)]
lvmlockd: fix starting dlm global lockspace

lvmlockd would fail to recognize that the global lockspace
failed to start if the dlm wasn't running, so future attempts
to start the dlm global lockspace would do nothing, thinking
it was already running.

9 years agolvmlockd: remove list of inactive lockspaces
David Teigland [Thu, 27 Aug 2015 20:23:14 +0000 (15:23 -0500)]
lvmlockd: remove list of inactive lockspaces

This was only used to return two flags indicating specific
reasons for a lock failure so that a more specific error
message could be printed by the command (lockspace had been
stopped, or lockspace had an error starting.)

Remove the list, given its limited usefulness, the fact it
would easily become inaccurate, and the fact it was causing
misleading error messages.  The error conditions it was meant
to help could be reported differently.

9 years agolvmlockd: skip lockd removal check for non-lockd VGs
David Teigland [Wed, 26 Aug 2015 21:09:59 +0000 (16:09 -0500)]
lvmlockd: skip lockd removal check for non-lockd VGs

9 years agolvmlockd: fix function def for non-lvmlockd build
David Teigland [Wed, 26 Aug 2015 21:05:20 +0000 (16:05 -0500)]
lvmlockd: fix function def for non-lvmlockd build

9 years agolvmlockd: detect when dlm lvb is invalidated
David Teigland [Wed, 26 Aug 2015 19:55:27 +0000 (14:55 -0500)]
lvmlockd: detect when dlm lvb is invalidated

The lvb content can be lost during dlm recovery,
and we need to detect when this happens to revalidate.

9 years agolvmlockd: rescan lockd VG in two new cases
David Teigland [Wed, 26 Aug 2015 19:06:39 +0000 (14:06 -0500)]
lvmlockd: rescan lockd VG in two new cases

Previously, a command would only rescan a lockd VG
when lvmetad returned the "vg_invalid" flag indicating
that the cached copy was invalid (which is done by
lvmlockd.)  This is still the only usual reason for
rescanning a lockd VG, but two new special cases are
added where we also do the rescan:

. When the --shared option is used to display lockd VGs
  from hosts not using lvmlockd.  This is the same case
  as using --foreign to display foreign VGs, but --shared
  was missing the corresponding bits to rescan the VGs.

. When a lockd VG is allowed to be read for displaying
  after failing to acquire the lock from lvmlockd.  In
  this case, the usual mechanism for validating the
  cache is missed, so assume the cache would have been
  invalidated.  (This had been a previous todo item
  that was lost during other cleanup.)

These were long-standing todos that were lost track of.

9 years agolvmlockd: improve VG removal for lock_type dlm
David Teigland [Wed, 26 Aug 2015 15:01:05 +0000 (10:01 -0500)]
lvmlockd: improve VG removal for lock_type dlm

This makes lvmlockd removal steps for dlm VGs closely match
sanlock VGs.  Because dlm lockspaces are not required to be
stopped on all hosts before vgremove, there is an extra bit
for dlm lockspaces, where a flag is set in the VG lock lvb
indicating that the VG was removed.  If other hosts happen
to use the VG lock they will see this flag and stop their
lockspace.

9 years agolvmlockd: fix to work around dlm lvb bug
David Teigland [Tue, 25 Aug 2015 21:10:12 +0000 (16:10 -0500)]
lvmlockd: fix to work around dlm lvb bug

Work around a dlm bug that fails to copy lvb
on a NL->EX conversion.

9 years agolvmlockd: fix dlm EAGAIN checks
David Teigland [Mon, 24 Aug 2015 20:54:25 +0000 (15:54 -0500)]
lvmlockd: fix dlm EAGAIN checks

libdlm returns EAGAIN in errno

9 years agolvmlockd: add full changing of lock type
David Teigland [Mon, 24 Aug 2015 20:06:23 +0000 (15:06 -0500)]
lvmlockd: add full changing of lock type

Remove the existing lock type using the same functions
used to remove the lockd components during vgremove.
This results in a "clean" VG and lvmlockd state after
the vgchange, i.e. no bits left over from previous
lock type.

9 years agopost-release
Alasdair G Kergon [Wed, 26 Aug 2015 22:13:34 +0000 (23:13 +0100)]
post-release

9 years agopre-release v2_02_129
Alasdair G Kergon [Wed, 26 Aug 2015 22:11:13 +0000 (23:11 +0100)]
pre-release

9 years agovgdisplay: Drop error message for exported VGs.
Alasdair G Kergon [Wed, 26 Aug 2015 20:11:46 +0000 (21:11 +0100)]
vgdisplay: Drop error message for exported VGs.

Originally when vgdisplay encountered an exported VG it issued a
WARNING.  Commit d6b1de30 replaced this with an error message
but still exited with success (incorrect).  A backtrace was recently
added in commit b19380998739b9971d27845a70a78511c2335cb0.

As vgdisplay already states that the VG is exported in its output,
just drop these messages completely.

9 years agolibdm: Drop ignored duplicate export designation.
Alasdair G Kergon [Wed, 26 Aug 2015 16:30:36 +0000 (17:30 +0100)]
libdm: Drop ignored duplicate export designation.

dm_stats_create_region is now assigned to DM_1_02_106 by default:
the DM_1_02_104 .exported_symbols file entry was moved into
libdm-stats.c as:
  DM_EXPORT_SYMBOL(dm_stats_create_region, 1_02_104)
so delete it from .exported_symbols.DM_1_02_104.

9 years agomake.tmpl: Mark internal sharedlib symbols local.
Alasdair G Kergon [Wed, 26 Aug 2015 12:36:23 +0000 (13:36 +0100)]
make.tmpl: Mark internal sharedlib symbols local.

Since commit 797c18d543947f4c2777b4dcf3ceff57cb55352b some internal symbols
have been exported in shared libraries by mistake because 'local: *' got
lost.  Fix the shell script not to compare the whole filename with
'Base'

9 years agotests: update cache tests
Zdenek Kabelac [Tue, 25 Aug 2015 13:10:53 +0000 (15:10 +0200)]
tests: update cache tests

9 years agoman: replace to with for
Zdenek Kabelac [Mon, 24 Aug 2015 09:20:29 +0000 (11:20 +0200)]
man: replace to with for

Better word.

9 years agocache: lvconvert accepts --cachemode for --cache
Zdenek Kabelac [Tue, 25 Aug 2015 12:48:31 +0000 (14:48 +0200)]
cache: lvconvert accepts --cachemode for --cache

All cache args could be specified when caching LV
(means converting LV to cached).

When --cachemode arg is given during cache-pool conversion,
store it in the metadata.

https://bugzilla.redhat.com/show_bug.cgi?id=1255184

9 years agocache: report cache pool attrs also for pools
Zdenek Kabelac [Tue, 25 Aug 2015 13:07:41 +0000 (15:07 +0200)]
cache: report cache pool attrs also for pools

Since cache-pool actualy keeps info about caching,
display this info for cache-pool LV as well
(matches info for cache LV when cache-pool is asociated with it).

9 years agocache: no report error for cpool without mode
Zdenek Kabelac [Tue, 25 Aug 2015 12:47:07 +0000 (14:47 +0200)]
cache: no report error for cpool without mode

It's perferctly valid to not have cachemode for
unused cache-pool.

https://bugzilla.redhat.com/show_bug.cgi?id=1255184

9 years agomakefiles: remove stray ')'
Bryn M. Reeves [Tue, 25 Aug 2015 18:05:45 +0000 (19:05 +0100)]
makefiles: remove stray ')'

9 years agomakefiles: fix ld version script generation for older make versions
Bryn M. Reeves [Tue, 25 Aug 2015 17:18:34 +0000 (18:18 +0100)]
makefiles: fix ld version script generation for older make versions

Commit 82a27a8 introduced a change to the symbol versioning macros
that allows a new version of a function to be introduced while
keeping the old behaviour via a versioned symbol export. The new
symbol is listed in the current .exported_symbols.DM_* file and a
default (@@VERSION) binding is created during linking.

This broke the build on RHEL5, RHEL6 and Debian Lenny. This is
because the make version in these distros returns results from the
$(wildcard *) command in a different order to the RHEL7 and F22
versions: this affects the ordering of the generated .export.sym
version script:

RHEL7/F22
for i in ./.exported_symbols.Base ./.exported_symbols.DM_1_02_99
 ./.exported_symbols.DM_1_02_98 ./.exported_symbols.DM_1_02_97
 ./.exported_symbols.DM_1_02_106 ./.exported_symbols.DM_1_02_105
 ./.exported_symbols.DM_1_02_103 ./.exported_symbols.DM_1_02_101
 ./.exported_symbols.DM_1_02_104 ./.exported_symbols.DM_1_02_100

 290: 000000000003d101   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region_v1_02_104
*388: 000000000003cfc7   314 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region@@DM_1_02_106
 391: 000000000003d101   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region@DM_1_02_104
*552: 000000000003cfc7   314 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region
 944: 000000000003d101   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region_v1_02_104
 992: 000000000003d101   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region@DM_1_02_104

RHEL6:
for i in ./.exported_symbols.Base ./.exported_symbols.DM_1_02_100
 ./.exported_symbols.DM_1_02_101 ./.exported_symbols.DM_1_02_103
 ./.exported_symbols.DM_1_02_104 ./.exported_symbols.DM_1_02_105
 ./.exported_symbols.DM_1_02_106 ./.exported_symbols.DM_1_02_97
 ./.exported_symbols.DM_1_02_98 ./.exported_symbols.DM_1_02_99; do\

 290: 000000000003d0e1   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region_v1_02_104
 390: 000000000003d0e1   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region@DM_1_02_104
*479: 000000000003cfa7   314 FUNC    LOCAL  DEFAULT   12 dm_stats_create_region
 944: 000000000003d0e1   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region_v1_02_104
 992: 000000000003d0e1   106 FUNC    GLOBAL DEFAULT   12 dm_stats_create_region@DM_1_02_104

The F22 build has the correct behaviour (although the sort order is
inconsistent) but on RHEL6 the 1_02_106 symbol file appears after
version 1_02_104 which introduced the original symbol. This causes
the later version of the symbol to lose its version binding and be
reduced to local scope.

If using un-versioned exports of the current version of a symbol
(i.e.  exported with the plain symbol name and no macro) and using
the linker script to set the symbol version, the current version
node must appear first in the version script: the un-versioned
symbol will be bound to the first version node found that contains
it.

On RHEL6 and the other older distros the original version of the
dm_stats_create_region() call sorted before the current version
(DM_1_02_104 vs. DM_1_02_106) leading to a subsequent link error for
the later symbol version:

dmsetup.o: In function `_do_stats_create_regions':
/root/src/git/lvm2/tools/dmsetup.c:4658: undefined reference to
`dm_stats_create_region'

Ensure that the ordering of entries in the version script is
consistent to avoid an old implementation shadowing a newer one by
sorting the list of file names before the loop:

  $$(echo $(EXPORTED_SYMBOLS) | tr ' ' '\n' | sort -rnt_ -k5 )

This only sorts by patch level but this is sufficient to maintain
the correct order for current version files.

Tested on RHEL5, 6, 7 and F22.

9 years agodmstats: add 'precise' flag field to stats report
Bryn M. Reeves [Mon, 17 Aug 2015 17:09:43 +0000 (18:09 +0100)]
dmstats: add 'precise' flag field to stats report

Add a flag indicating whether or not precise_timestamps are enabled for
a given region or area.

9 years agodmstats: add --precise switch to enable nanosecond counters.
Bryn M. Reeves [Tue, 18 Aug 2015 11:39:34 +0000 (12:39 +0100)]
dmstats: add --precise switch to enable nanosecond counters.

9 years agolibdm: add per region precise timestamps property methods
Bryn M. Reeves [Mon, 17 Aug 2015 17:08:18 +0000 (18:08 +0100)]
libdm: add per region precise timestamps property methods

9 years agolibdm: add precise timestamps support to libdm-stats
Bryn M. Reeves [Thu, 20 Aug 2015 10:55:06 +0000 (11:55 +0100)]
libdm: add precise timestamps support to libdm-stats

Add support for the kernel precise_timestamps feature. This allows
regions to be created using counters with nanosecond precision.

A new dm_stats method, dm_stats_set_precise_timestamps() causes all
future regions created with this handle to attempt to enable precise
counters.

9 years agomacros: fix default symbol export control
Bryn M. Reeves [Fri, 21 Aug 2015 20:15:10 +0000 (21:15 +0100)]
macros: fix default symbol export control

Fix the version export macros to make it possible to export two
different DM_* versions of a symbol: currently it is only possible for a
DM_* symbol to override a symbol in Base. Attempting to export two
symbols at different DM_* version levels (e.g. DM_1_02_104 and
DM_1_02_106) leads to a linker error due to a duplicate symbol
definition.

This is because the DM_EXPORTED_SYMBOL macro makes each exported symbol
the default (@@VERSION):

       __asm__(".symver " #func "_v" #ver ", " #func "@@DM_" #ver )

Fix the macro to use a single '@' for a symbols exported in multiple
versions and rename the macros to DM_EXPORT_*:

  DM_EXPORT_SYMBOL(func,ver)
  DM_EXPORT_SYMBOL_BASE(func,ver)

For functions that have multiple implementations these macros control
symbol export and versioning.

Function definitions that exist in only one version never need to use
these macros.

Backwards compatible implementations must include a version tag of
the form "_v1_02_104" as a suffix to the function name and use the
macro DM_EXPORT_SYMBOL to export the function and bind it to the
specified version string.

Since versioning is only available when compiling with GCC the entire
compatibility version should be enclosed in '#if defined(__GNUC__)',
for example:

  int dm_foo(int bar)
  {
    return bar;
  }

  #if defined(__GNUC__)
  // Backward compatible dm_foo() version 1.02.104
  int dm_foo_v1_02_104(void);
  int dm_foo_v1_02_104(void)
  {
    return 0;
  }
  DM_EXPORT_SYMBOL(dm_foo,1_02_104)
  #endif

A prototype for the compatibility version is required as these
functions must not be declared static.

The DM_EXPORT_SYMBOL_BASE macro is only used to export the base
versions of library symbols prior to the introduction of symbol
versioning: it must never be used for new symbols.

9 years agotests: fix check for lvmlockd test
David Teigland [Fri, 21 Aug 2015 22:00:21 +0000 (17:00 -0500)]
tests: fix check for lvmlockd test

9 years agotests: add test for lvmlockd lock_args
David Teigland [Fri, 21 Aug 2015 20:06:28 +0000 (15:06 -0500)]
tests: add test for lvmlockd lock_args

9 years agotests: add lib function to test hidden LVs with lvs -a
David Teigland [Fri, 21 Aug 2015 20:06:00 +0000 (15:06 -0500)]
tests: add lib function to test hidden LVs with lvs -a

9 years agotests: create/remove improvements for lvmlockd testing
David Teigland [Thu, 20 Aug 2015 21:10:36 +0000 (16:10 -0500)]
tests: create/remove improvements for lvmlockd testing

9 years agotest: allow tests with lvmlockd
David Teigland [Thu, 20 Aug 2015 21:09:29 +0000 (16:09 -0500)]
test: allow tests with lvmlockd

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