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

9 years agoWHATS_NEW
Zdenek Kabelac [Fri, 21 Aug 2015 13:37:56 +0000 (15:37 +0200)]
WHATS_NEW

9 years agotests: check cachepolicy with lvconvert
Zdenek Kabelac [Fri, 21 Aug 2015 13:34:32 +0000 (15:34 +0200)]
tests: check cachepolicy with lvconvert

9 years agocleanup: add .
Zdenek Kabelac [Thu, 20 Aug 2015 13:09:23 +0000 (15:09 +0200)]
cleanup: add .

9 years agoman: fix sqm typo
Zdenek Kabelac [Fri, 21 Aug 2015 09:06:18 +0000 (11:06 +0200)]
man: fix sqm typo

9 years agothin: metadata size cannot be reduced
Zdenek Kabelac [Fri, 21 Aug 2015 09:05:21 +0000 (11:05 +0200)]
thin: metadata size cannot be reduced

Until we implement offline metadata manipulation,
the size of metadata LV cannot be reduced.

9 years agocache: enable setting cachepolicy in lvconvert
Zdenek Kabelac [Fri, 21 Aug 2015 11:00:13 +0000 (13:00 +0200)]
cache: enable setting cachepolicy in lvconvert

9 years agolvmlockd: fix sending debug info to lvmlockctl
David Teigland [Thu, 20 Aug 2015 19:00:12 +0000 (14:00 -0500)]
lvmlockd: fix sending debug info to lvmlockctl

Single messages sent over unix sockets are limited in
size to /proc/sys/net/core/wmem_max, so send the 1MB
debug buffer in smaller chunks to avoid EMSGSIZE.

Also look for EAGAIN and retry sending for a limited
time when the reader is slower than the writer.

Also shift the location of that code so it's the same
as other requests.

9 years agoWHATS_NEW: Update.
Heinz Mauelshagen [Tue, 18 Aug 2015 15:38:57 +0000 (17:38 +0200)]
WHATS_NEW: Update.

9 years agocmirrord: avoid resync buffer overflow in LOG_SPRINT
Ferenc Wágner [Wed, 8 Jul 2015 12:41:27 +0000 (14:41 +0200)]
cmirrord: avoid resync buffer overflow in LOG_SPRINT

Use snprintf() instead of sprintf() to exclude the possibility of
overflowing the resync history buffers.

9 years agocmirrord: avoid debugging buffer overflow in LOG_SPRINT
Ferenc Wágner [Wed, 8 Jul 2015 12:41:26 +0000 (14:41 +0200)]
cmirrord: avoid debugging buffer overflow in LOG_SPRINT

Use snprintf() instead of sprintf() to exclude the possibility of
overflowing the debugging history buffers.

9 years agocmirrord: fix stack smashing
Ferenc Wágner [Wed, 8 Jul 2015 12:41:25 +0000 (14:41 +0200)]
cmirrord: fix stack smashing

With clusters larger than 3 nodes, the 32-byte debug buffer in
cpg_join_callback() is too small to contain all the node IDs, because
32-bit identifiers are generally rendered in 10 decimal digits.  No fixed
size is good in all cases, but this is conditionally logged debug info,
so we can simply truncate it.  Double the size, nevertheless.

9 years agocmirrord manual: add --foreground and --help options
Ferenc Wágner [Wed, 8 Jul 2015 12:41:24 +0000 (14:41 +0200)]
cmirrord manual: add --foreground and --help options

9 years agocmirrord: add --foreground and --help options.
Ferenc Wágner [Wed, 8 Jul 2015 12:41:23 +0000 (14:41 +0200)]
cmirrord: add --foreground and --help options.

9 years agocmirrord: move generic setup from daemonize() to init_all()
Ferenc Wágner [Wed, 8 Jul 2015 12:41:22 +0000 (14:41 +0200)]
cmirrord: move generic setup from daemonize() to init_all()

Apply pidfile creation, removal and signal setup to foreground processes too.

9 years agoman: fix program_id string in dmstats.8.in
Bryn M. Reeves [Thu, 20 Aug 2015 11:18:51 +0000 (12:18 +0100)]
man: fix program_id string in dmstats.8.in

9 years agolibdm: add dm_message_supports_precise_timestamps()
Bryn M. Reeves [Tue, 18 Aug 2015 15:37:03 +0000 (16:37 +0100)]
libdm: add dm_message_supports_precise_timestamps()

Add a function to test whether the kernel precise_timestamps
feature is available in the current device-mapper driver version.

Presence of precise_timestamps also implies the availability of
latency histograms.

9 years agolvmlockd: ignore cmd close if no locks were taken
David Teigland [Wed, 19 Aug 2015 17:16:04 +0000 (12:16 -0500)]
lvmlockd: ignore cmd close if no locks were taken

When a command closes its connection, don't waste
time looking for locks to purge if it did not make
any lock requests.

9 years agolvmlockd: change log_error to log_debug for non error
David Teigland [Wed, 19 Aug 2015 16:43:39 +0000 (11:43 -0500)]
lvmlockd: change log_error to log_debug for non error

It's not uncommon for a command like vgchange -an to
deactivate and unlock LVs that were not active, so
don't lock that as an error.

9 years agolvmlockctl: fix debug output
David Teigland [Tue, 18 Aug 2015 21:49:33 +0000 (16:49 -0500)]
lvmlockctl: fix debug output

9 years agotests: fix lockd options in sanlock-prepare
David Teigland [Tue, 18 Aug 2015 19:50:45 +0000 (14:50 -0500)]
tests: fix lockd options in sanlock-prepare

9 years agoconfig: improve description text layout
David Teigland [Tue, 18 Aug 2015 15:15:40 +0000 (10:15 -0500)]
config: improve description text layout

This mainly makes the description text use 80 columns.
There are a few minor adjustments to wording to help
the text layout, and a couple minor improvements to
descriptions.

9 years agolockd: no error when unlock fails
David Teigland [Tue, 18 Aug 2015 15:39:40 +0000 (10:39 -0500)]
lockd: no error when unlock fails

The unlock call will fail in expected and normal cases,
and should not cause the command to fail.  (An actual
unlock in the lock manager should never fail.)

9 years agoconfigure: check for -lm and log10 function
Bryn M. Reeves [Tue, 18 Aug 2015 14:21:19 +0000 (15:21 +0100)]
configure: check for -lm and log10 function

We already use -lm functions in a couple of places (these are
satisfied by gcc built-ins for most builds): add a configure.in
check and explicitly link to -lm.

9 years agocleanup: compare fgets pointer
Zdenek Kabelac [Tue, 18 Aug 2015 13:48:05 +0000 (15:48 +0200)]
cleanup: compare fgets pointer

Check pointer for not being NULL.

9 years agocleanup: move var declaration
Zdenek Kabelac [Tue, 18 Aug 2015 13:47:07 +0000 (15:47 +0200)]
cleanup: move var declaration

9 years agocleanup: preserve constness of some pointers
Zdenek Kabelac [Tue, 18 Aug 2015 13:39:04 +0000 (15:39 +0200)]
cleanup: preserve constness of some pointers

9 years agocleanup: log_debug format matches args
Zdenek Kabelac [Tue, 18 Aug 2015 13:28:56 +0000 (15:28 +0200)]
cleanup: log_debug format matches args

9 years agoman: update dmstats.8.in examples
Bryn M. Reeves [Sun, 16 Aug 2015 18:30:16 +0000 (19:30 +0100)]
man: update dmstats.8.in examples

9 years agoRevert "lvmcache: check for too long pvid"
Zdenek Kabelac [Tue, 18 Aug 2015 13:21:48 +0000 (15:21 +0200)]
Revert "lvmcache: check for too long pvid"

This reverts commit 70db1d523db330cbdfc39163c30dc00cf16a1fdc.
Since we use 'strncpy' even for case where it exactly matches
the buffer size and \0 is not expected to be added there.

9 years agodebug: vgdisplay trace failing result code
Zdenek Kabelac [Tue, 18 Aug 2015 09:46:13 +0000 (11:46 +0200)]
debug: vgdisplay trace failing result code

Add stack on error path.

9 years agocleanup: trace error from lvmcache_update_vgname_and_id
Zdenek Kabelac [Tue, 18 Aug 2015 11:48:53 +0000 (13:48 +0200)]
cleanup: trace error from lvmcache_update_vgname_and_id

Check result value from lvmcache_update_vgname_and_id().

9 years agocleanup: check pthread result codes
Zdenek Kabelac [Tue, 18 Aug 2015 11:42:52 +0000 (13:42 +0200)]
cleanup: check pthread result codes

9 years agocleanup: typo fix and drop \
Zdenek Kabelac [Tue, 18 Aug 2015 11:18:59 +0000 (13:18 +0200)]
cleanup: typo fix and drop \

Fix 'th e'  and use % directly.

9 years agocleanup: add FMTssize_t
Zdenek Kabelac [Tue, 18 Aug 2015 10:59:13 +0000 (12:59 +0200)]
cleanup: add FMTssize_t

Add define to print nicely ssize_t type.

9 years agocleanup: add cast
Zdenek Kabelac [Tue, 18 Aug 2015 10:39:17 +0000 (12:39 +0200)]
cleanup: add cast

9 years agocleanup: unused header files (Coverity)
Zdenek Kabelac [Tue, 18 Aug 2015 10:31:20 +0000 (12:31 +0200)]
cleanup: unused header files (Coverity)

9 years agolibdm: simplify dmstats formula.
Zdenek Kabelac [Tue, 18 Aug 2015 10:12:07 +0000 (12:12 +0200)]
libdm: simplify dmstats formula.

Since we check for stats for not being 0,
simplify the operation and use a single division.

9 years agolockd: check for failing unlock
Zdenek Kabelac [Tue, 18 Aug 2015 09:46:42 +0000 (11:46 +0200)]
lockd: check for failing unlock

Avoid ignoring unlocking error.

9 years agolvmcache: check for too long pvid
Zdenek Kabelac [Tue, 18 Aug 2015 09:28:02 +0000 (11:28 +0200)]
lvmcache: check for too long pvid

9 years agodmstats: reduce minimum field widths
Bryn M. Reeves [Sun, 16 Aug 2015 18:35:06 +0000 (19:35 +0100)]
dmstats: reduce minimum field widths

9 years agodmstats: fix type formatting
Bryn M. Reeves [Mon, 17 Aug 2015 16:30:38 +0000 (17:30 +0100)]
dmstats: fix type formatting

Fix several instances of 'const char * const*' to be:

  'const char * const *'

9 years agoconfig: create lists of accepted values in descriptions
David Teigland [Thu, 13 Aug 2015 20:31:29 +0000 (15:31 -0500)]
config: create lists of accepted values in descriptions

9 years agoconfig: add empty lines around examples
David Teigland [Thu, 13 Aug 2015 14:16:21 +0000 (09:16 -0500)]
config: add empty lines around examples

When --withspaces is used, a blank line is
added before and after an Example section,
making the text less dense.

9 years agoconfig: recognize a blank comment line
David Teigland [Wed, 12 Aug 2015 20:45:27 +0000 (15:45 -0500)]
config: recognize a blank comment line

Consider the comment line "#\n" to be a blank line, and
print a blank line at that position when --withspaces is set.

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