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

9 years agoconfig: explain automatic default values
David Teigland [Thu, 13 Aug 2015 18:35:45 +0000 (13:35 -0500)]
config: explain automatic default values

Before printing a commented automatic config value,
print a line describing what it is.  Otherwise, the
commented value can look like it's a part of an
example preceding it.

9 years agodmsetup: check timerfd reads for valid byte count (Coverity)
Bryn M. Reeves [Mon, 17 Aug 2015 18:26:44 +0000 (19:26 +0100)]
dmsetup: check timerfd reads for valid byte count (Coverity)

The timerfd guarantees that it will return 8 bytes when a read(2)
is issued (a uint64_t giving the number of timer events during the
call). Check that it does so and log a non-fatal error if the byte
count is not 8.

9 years agolibdm: check for zero in _nr_areas() (Coverity)
Bryn M. Reeves [Mon, 17 Aug 2015 17:33:22 +0000 (18:33 +0100)]
libdm: check for zero in _nr_areas() (Coverity)

9 years agodmstats: check for zero in _nr_areas_from_step() (Coverity)
Bryn M. Reeves [Mon, 17 Aug 2015 17:31:11 +0000 (18:31 +0100)]
dmstats: check for zero in _nr_areas_from_step() (Coverity)

9 years agodmsetup: make sure subcommand is initialised (Coverity)
Bryn M. Reeves [Mon, 17 Aug 2015 17:28:32 +0000 (18:28 +0100)]
dmsetup: make sure subcommand is initialised (Coverity)

9 years agolibdm: do not read region before checking dms for NULL (Coverity)
Bryn M. Reeves [Mon, 17 Aug 2015 17:25:22 +0000 (18:25 +0100)]
libdm: do not read region before checking dms for NULL (Coverity)

dm_stats_get_area_start() attempts to assign a region pointer from
a stats handle before checking it is non-NULL: move the assignment
after the test.

9 years agopost-release
Alasdair G Kergon [Mon, 17 Aug 2015 16:26:20 +0000 (17:26 +0100)]
post-release

9 years agopre-release v2_02_128
Alasdair G Kergon [Mon, 17 Aug 2015 16:20:14 +0000 (17:20 +0100)]
pre-release

9 years agolibdm-stats: only return uint64_t when required
Bryn M. Reeves [Mon, 17 Aug 2015 14:23:27 +0000 (15:23 +0100)]
libdm-stats: only return uint64_t when required

Several interfaced in libdm-stats return a uint64_t when it is
only used to signal success/failure: change all these uses to
return a simple int instead.

9 years agoconf: Regenerate example.conf.
Alasdair G Kergon [Mon, 17 Aug 2015 15:51:43 +0000 (16:51 +0100)]
conf: Regenerate example.conf.

9 years agocache: more comments for new setting
Zdenek Kabelac [Mon, 17 Aug 2015 15:26:39 +0000 (17:26 +0200)]
cache: more comments for new setting

9 years agotests: update thin test
Zdenek Kabelac [Mon, 17 Aug 2015 15:07:09 +0000 (17:07 +0200)]
tests: update thin test

Since we now let pass activation of thin-pool 'off-by-one' for
plain 'vgchange -ay' update the test to use higher TID.

9 years agocache: move detection code to cache_set_policy
Zdenek Kabelac [Mon, 17 Aug 2015 13:35:43 +0000 (15:35 +0200)]
cache: move detection code to cache_set_policy

Move code which runtime detects settings for cache_policy
out of config dir to cache seg handling code.

Also mark cache_mode as command profilable setting.

9 years agodmsetup: fix usage of ifdefs
Zdenek Kabelac [Mon, 17 Aug 2015 13:11:00 +0000 (15:11 +0200)]
dmsetup: fix usage of ifdefs

9 years agolibdm: ensure dm_stats_get_area_offset() returns a value
Bryn M. Reeves [Mon, 17 Aug 2015 12:56:44 +0000 (13:56 +0100)]
libdm: ensure dm_stats_get_area_offset() returns a value

9 years agodevice: Don't try to close config file on failure.
Alasdair G Kergon [Mon, 17 Aug 2015 11:57:01 +0000 (12:57 +0100)]
device: Don't try to close config file on failure.

$file: open failed: Permission denied
Failed to load config file $file
Attempt to close device '$file' which is not open.

9 years agotests: Revert update for new thin pool messaging
Zdenek Kabelac [Fri, 14 Aug 2015 09:08:14 +0000 (11:08 +0200)]
tests: Revert update for new thin pool messaging

This reverts commit 3dbb9a57ca684271dbbc26300aa2e35da9608aa3.
Original code is back as the code restored previous TID handling.

9 years agothin: restore transaction_id handling
Zdenek Kabelac [Fri, 14 Aug 2015 15:41:27 +0000 (17:41 +0200)]
thin: restore transaction_id handling

Revert back to already existing behavior which has been slightly
modified by a900d150e4658a5d72c39acdd4fefd069b8f00b8.

At the end however it seem to be equal to change TID right with first
metadata write.

Existing code missed handling for 'unused' thin-pool which would
require to also check empty message list for TID==0.

So with the fix we now again preserve 'active' thin-pool volume
when first thin volume is created - this property was lost and caused
problems in cluster, where the lock was hold, but volume was no longer
active on the node.

Another missing part was the proper support for already increased,
but unfinished TID change.

So going back here with existing logic -

TID is increased with first MDA update.

Code allows start with either same TID or (TID-1).

If there are messages, TID must be lower by 1 for sending,
otherwise messages were already posted.

9 years agocache: use undefined settings for cache_policy
Zdenek Kabelac [Mon, 17 Aug 2015 09:19:28 +0000 (11:19 +0200)]
cache: use undefined settings for cache_policy

As cache_policy is evaluated in runtime, we no longer should use
CFG_COMMENTED, but have to switch to CFG_UNDEFINED.

So as long as the value is undefined, it's runtime evaluated.
Once it's set - it's always respected (no runtime fallback).

Also fix version of introduced settings to 2.2.128.

9 years agoWHATS_NEW: Update.
Alasdair G Kergon [Sun, 16 Aug 2015 00:16:16 +0000 (01:16 +0100)]
WHATS_NEW: Update.

9 years agodmstats: fix --length argument
Bryn M. Reeves [Sat, 15 Aug 2015 15:51:31 +0000 (16:51 +0100)]
dmstats: fix --length argument

Commit f10ad95 introduced a regression causing the size of regions
passed in on the command line to be truncated to zero. Initialise
the 'this_len' variable to the supplied length to correct this.

9 years agodmstats: fix new area count for 'create --areasize'
Bryn M. Reeves [Fri, 14 Aug 2015 23:32:59 +0000 (00:32 +0100)]
dmstats: fix new area count for 'create --areasize'

Commit f10ad95 introduced a regression in the calculation of the
number of areas in a region created with the --areasize switch:

vg_hex-lv_home: Created new region with 0 area(s) as region ID 1
vg_hex-lv_swap: Created new region with 0 area(s) as region ID 1

Fis this by using the correct region size when calculating the
value.

9 years agodmstats: change region fields prefix to 'region_'
Bryn M. Reeves [Fri, 14 Aug 2015 22:53:42 +0000 (23:53 +0100)]
dmstats: change region fields prefix to 'region_'

9 years agodmstats: make -v enable per area reports for 'stats list'
Bryn M. Reeves [Fri, 14 Aug 2015 19:40:13 +0000 (20:40 +0100)]
dmstats: make -v enable per area reports for 'stats list'

When dmstats is run with -v or higher enable a per-area reporting
mode for statistics regions. This will output one row per area
(rather than one row per region) and adds additional fields of use
when viewing areas:

 area_id    - index within the region assigned by libdm-stats
 area_start - the start location of the area in the containing
              device.

9 years agodmstats: add 'area_offset' field to stats reports
Bryn M. Reeves [Fri, 14 Aug 2015 20:49:40 +0000 (21:49 +0100)]
dmstats: add 'area_offset' field to stats reports

9 years agolibdm: add dm_stats_get_{current_}area_offset()
Bryn M. Reeves [Fri, 14 Aug 2015 19:30:05 +0000 (20:30 +0100)]
libdm: add dm_stats_get_{current_}area_offset()

Add a method to retrieve the offset of an area within the
containing region (rather than the offset within the containing
device returned by dm_stats_get_area_start()).

Although users of the library can calculate this themselves it is
better to provide this through a method call to avoid users making
assumptions about the structure of regions and areas.

9 years agolibdm: ensure dm_stats_get_area_start includes region offset
Bryn M. Reeves [Fri, 14 Aug 2015 19:28:06 +0000 (20:28 +0100)]
libdm: ensure dm_stats_get_area_start includes region offset

The dm_stats_get_area_start (and its '_current_' variant) methods
are expected to return the start sector of the area in the
containing device.

Make sure the call adds region->start to the returned value.

9 years agodmsetup: add support for 'stats report --raw'
Bryn M. Reeves [Fri, 14 Aug 2015 16:42:03 +0000 (17:42 +0100)]
dmsetup: add support for 'stats report --raw'

Add a '--raw' switch to stats reports that causes us to report the
basic counter values rather than derived metrics for each visible
statistics region.

9 years agodmsetup: add prefixes for all report types
Bryn M. Reeves [Fri, 14 Aug 2015 20:14:29 +0000 (21:14 +0100)]
dmsetup: add prefixes for all report types

Add prefixes to all dmsetup report types to allow the 'group_all'
option to be effective:

  DR_NAME       name_
  DR_INFO       info_
  DR_DEPS       deps_
  DR_TREE       tree_
  DR_NAME       splitname_

9 years agodmstats: add 'stat_' prefix to stats report columns
Bryn M. Reeves [Fri, 14 Aug 2015 16:10:47 +0000 (17:10 +0100)]
dmstats: add 'stat_' prefix to stats report columns

9 years agospec: Add cache-*.profile
Marian Csontos [Fri, 14 Aug 2015 19:44:10 +0000 (21:44 +0200)]
spec: Add cache-*.profile

9 years agodmsetup: do not track moving average for interval estimate
Bryn M. Reeves [Fri, 14 Aug 2015 12:52:33 +0000 (13:52 +0100)]
dmsetup: do not track moving average for interval estimate

When run with full verbosity dmsetup or dmstats reports will
output a figure that tracks a moving average over a window of the
last two intervals:

Interval     #3        time delta:    999991087ns
Interval     #3     mean duration:    999907064ns, current err: -8913ns
End interval #3          duration:    999991087ns
Adjusted sample interval duration:    999991087ns

Due to the narrow window this is a very crude estimate and is only
of use to someone debugging or modifying the stats clock: remove
the value and the global variables used to track it.

Anyone with a particular use for this information can construct a
better mean by calculating the value of a greater number of
intervals.

9 years agoWHATS_NEW_DM: recent commits (stats field split and timestamp headers)
Bryn M. Reeves [Fri, 14 Aug 2015 12:20:20 +0000 (13:20 +0100)]
WHATS_NEW_DM: recent commits (stats field split and timestamp headers)

9 years agodmstats: make 'dmstats list' use common report infrastructure
Bryn M. Reeves [Thu, 13 Aug 2015 22:03:46 +0000 (23:03 +0100)]
dmstats: make 'dmstats list' use common report infrastructure

Unlike 'info -c' and 'stats report' the 'dmstats list' subcommand
does its own report processing. This complicates the handling of
the DR_STATS and DR_STATS_META fields and leads to inconsistent
behaviour between the different commands. In particular it causes
'stats list' to segfault when using 'all' field options:

Segmentation fault (core dumped)

Delete _stats_list() entirely and adapt _stats_report so that it
can correctly format a DR_STATS_META-only report request.

This requires passing the subcommand into _report_init() where it
is used in addition to the command name to select the default set
of report fields for the 'list' and 'report' stats subcommands.

With this change both 'list' and 'report' dmstats report will use
the correct report object type and ensure that it is initialised
appropriately for the field selection in use.

9 years agodmstats: separate stats meta fields into their own report type
Bryn M. Reeves [Thu, 13 Aug 2015 20:14:57 +0000 (21:14 +0100)]
dmstats: separate stats meta fields into their own report type

Although statistics and meta fields (region and area properties) share
the same object type the state of the handle they expect differs: meta
only expects a dm_stats_list() operation to have been performed whereas
statistics require a fully populated handle.

Distinguish between these requirements by separating the fields into
two distinct report types:

  DR_STATS = 32,
  DR_STATS_META = 64

The new category is described as "Mapped Device Statistics Region
Information" in the help text.

9 years agodmstats: cleanup _do_stats_create_regions()
Bryn M. Reeves [Thu, 13 Aug 2015 19:54:21 +0000 (20:54 +0100)]
dmstats: cleanup _do_stats_create_regions()

Make the use of the this_start and this_len variables easier to
follow and clarify the use of zero start and len arguments to
request a whole-device region.

9 years agodmstats: add 'interval' and 'interval_ns' report fields
Bryn M. Reeves [Thu, 13 Aug 2015 16:29:15 +0000 (17:29 +0100)]
dmstats: add 'interval' and 'interval_ns' report fields

Add a pair of fields to expose the current per-interval duation
estimate. The 'interval' field provides a real value in units of
seconds and the 'interval_ns' field provides the same quantity
expressed as a whole number of nanoseconds.

9 years agolibdm: do not in include internal bits/time.h header
Natanael Copa [Fri, 14 Aug 2015 10:32:36 +0000 (11:32 +0100)]
libdm: do not in include internal bits/time.h header

Do not include bits/time.h as it is an internal libc header file.

A comment at the top of the glibc specific bits/time.h says:
"Never include this file directly; use <time.h> instead."

This fixes the following build error with musl libc:
libdm-timestamp.c:37:23: fatal error: bits/time.h: No such file or directory
---
Compile tested with Alpine Linx (musl libc) and ubuntu 15.04

 libdm/libdm-timestamp.c | 1 -
 1 file changed, 1 deletion(-)

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