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

9 years agodmsetup: Fix dmsetup return code.
Alasdair G Kergon [Thu, 13 Aug 2015 23:09:40 +0000 (00:09 +0100)]
dmsetup: Fix dmsetup return code.

9 years agodmsetup: Restructure arg handling.
Alasdair G Kergon [Thu, 13 Aug 2015 21:30:39 +0000 (22:30 +0100)]
dmsetup: Restructure arg handling.

Introduce enums and global variables to record cleanly which command we
are processing and eliminate the historically inconsistent use of the
shifted argv[0] and fix assorted bugs discovered along the way.

Add dm_report_is_empty() to indicate there is no data awaiting output
and use this to suppress dmsetup report headings when no data is output
so we don't get a stray line saying 'Help' at the end of reporting help.

Define a report type (as the interface requires) so -o all selects
the right fields in splitname.  (A fix for stats list will follow.)

Exit immediately if no device is supplied to dmsetup wipe_table instead
of hitting errors later and failing.

Adjust the command name printed in usage/help output to match command
invoked (most of the time).

9 years agodmstats: do not use "region_id" in error messages
Bryn M. Reeves [Thu, 13 Aug 2015 17:12:56 +0000 (18:12 +0100)]
dmstats: do not use "region_id" in error messages

Refer to either '--regionid' or '--allregions' when the user fails
to specify either a single region ID or the --allregions switch.

9 years agodmstats: replace --force with new stats-specific --alldevices
Bryn M. Reeves [Thu, 13 Aug 2015 13:42:55 +0000 (14:42 +0100)]
dmstats: replace --force with new stats-specific --alldevices

The '--force' switch is only used by dmstats to allow either
creation or deletion of one or more regions on all devices.

These operations do not carry any risk: just a possible mess of
region IDs to be cleaned up.

Remove the use of '--force' for stats commands and change current
uses to a new '--alldevices' switch.

9 years agodmstats: improve region creation messages
Bryn M. Reeves [Thu, 13 Aug 2015 11:42:35 +0000 (12:42 +0100)]
dmstats: improve region creation messages

The region creation message just outputs the new region_id, e.g.:

Created region: 0

This is fine when the device is unambigous (as above) but produces
unhelpful output when creating multiple regions, or regions on
multiple devices:

Created region: 0
Created region: 0
Created region: 1
Created region: 2
Created region: 0

To address this refactor _stats_create_segments() (previously only
used when creating one-region-per-target for --segments) into a
more general _do_stats_create_regions() that can create regions
for each segment, or a single region spanning either the entire
device or a specied start/len range.

This allows us to output all region creation messages from a
single point where both the device name and all information needed
to derive the number of areas is available.

This allows us to log all these facts in the resulting messages:

vg_hex-lv_home: Created new region with 13 area(s) as region ID 0
vg_hex-lv_home: Created new region with 4 area(s) as region ID 1
vg_hex-lv_home: Created new region with 1 area(s) as region ID 2
vg_hex-lv_swap: Created new region with 1 area(s) as region ID 0
vg_hex-lv_root: Created new region with 10 area(s) as region ID 0
luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e: Created new region with 17 area(s) as region ID 0
vg_hex-lv_images: Created new region with 20 area(s) as region ID 0
vg_hex-lv_images: Created new region with 4 area(s) as region ID 1

9 years agodmsetup: make timekeeping debug messages more readable
Bryn M. Reeves [Wed, 12 Aug 2015 18:46:11 +0000 (19:46 +0100)]
dmsetup: make timekeeping debug messages more readable

Don't use cryptic abbreviations and make sure that all values can
be understood by someone not familiar with the clock internals.

Include the current interval number (inverse of the _count) in all
interval update messages and attempt to align interval timestamp
logs for interval counts < 99,999.

9 years agodmsetup: Use #define for command names.
Alasdair G Kergon [Thu, 13 Aug 2015 12:10:23 +0000 (13:10 +0100)]
dmsetup: Use #define for command names.

9 years agodmstats: don't output column headings if report fails
Bryn M. Reeves [Wed, 12 Aug 2015 21:02:23 +0000 (22:02 +0100)]
dmstats: don't output column headings if report fails

If _stats_report fails (e.g. due to an invalid device on the
command line) destroy the _report to prevent stats columns headings
from being displayed.

This also requires a change in main to test the return from
_perform_command_for_all_repeatable_args inside the interval loop
and exit immediately in case of error.

9 years agodmstats: don't output column headings when args checks fail
Bryn M. Reeves [Wed, 12 Aug 2015 20:14:00 +0000 (21:14 +0100)]
dmstats: don't output column headings when args checks fail

The clear, create, delete, and print commands do not use _report:
make sure it is freed and set to NULL before checking arguments.

9 years agoconfig: description updates
David Teigland [Wed, 12 Aug 2015 17:51:35 +0000 (12:51 -0500)]
config: description updates

Make the first line of every description a complete one
line sentence for the benefit of lvmconfig --withsummary.

9 years agodmsetup: only free resources once in the final interval
Bryn M. Reeves [Wed, 12 Aug 2015 18:16:05 +0000 (19:16 +0100)]
dmsetup: only free resources once in the final interval

The _update_interval_times() function is called once per reported
object: when shutting down at the end of a run only the first call
should free timestamps. Clear the timestamp pointers after free
and use this to signal to other callers that the clock is already
shut down.

9 years agoudev: fix missing escape for +
Zdenek Kabelac [Wed, 12 Aug 2015 17:45:32 +0000 (19:45 +0200)]
udev: fix missing escape for +

Commit 3ea396e9d220cec55fd4e139be7ae486cb4ddb91 missed to escape +
which is used by 'sed' as separator for 's'.

9 years agolvcreate: fix return value
Zdenek Kabelac [Wed, 12 Aug 2015 12:53:00 +0000 (14:53 +0200)]
lvcreate: fix return value

Return correct 0 instead of NULL.

9 years agodmsetup: use timerfd for interval timing if available dev-bmr-dmstats-timerfd
Bryn M. Reeves [Sat, 8 Aug 2015 22:59:06 +0000 (23:59 +0100)]
dmsetup: use timerfd for interval timing if available

If the Linux timerfd interface to POSIX timers is available at compile
time use it for all report interval timekeeping. This gives more
accurate interval timing when the per-interval processing time is less
than the configured interval and simplifies the timestamp bookkeeping
required to keep accurate time.

For systems without timerfd support fall back to the simple usleep based
timer.

9 years agolibdm: add dm_timestamp_copy()
Bryn M. Reeves [Fri, 7 Aug 2015 12:09:56 +0000 (13:09 +0100)]
libdm: add dm_timestamp_copy()

9 years agotests: keep testing mq policy
Zdenek Kabelac [Wed, 12 Aug 2015 12:18:28 +0000 (14:18 +0200)]
tests: keep testing mq policy

Tests were written for 'mq' policy, so disable smq.

9 years agotests: link some new cache profiles
Zdenek Kabelac [Mon, 20 Jul 2015 09:56:11 +0000 (11:56 +0200)]
tests: link some new cache profiles

9 years agocleanup: indent
Zdenek Kabelac [Tue, 21 Jul 2015 09:18:42 +0000 (11:18 +0200)]
cleanup: indent

9 years agocleanup: use IEC KiB units
Zdenek Kabelac [Thu, 16 Jul 2015 12:03:48 +0000 (14:03 +0200)]
cleanup: use IEC KiB units

Reduce mixing of KB, kiB and use just KiB.

9 years agolibdm: rename to data_block_size
Zdenek Kabelac [Tue, 11 Aug 2015 11:30:02 +0000 (13:30 +0200)]
libdm: rename to data_block_size

Use common name for pool device - as we use data_block_size
for thin pool metadata, use same name for cache_pool.

This change does not affect API.

9 years agolibdm: cache target arg validation
Zdenek Kabelac [Tue, 11 Aug 2015 11:31:26 +0000 (13:31 +0200)]
libdm: cache target arg validation

Add some arg validation for dm_tree_node_add_cache_target().

9 years agoconfig: extend definition for Allocation
Zdenek Kabelac [Thu, 23 Jul 2015 12:20:29 +0000 (14:20 +0200)]
config: extend definition for Allocation

Extend comment for this section.

9 years agoconfig: support longer config paths
Zdenek Kabelac [Thu, 23 Jul 2015 12:21:35 +0000 (14:21 +0200)]
config: support longer config paths

64 bytes might not be enough, so use larger buffer size.

9 years agocache: add more validation
Zdenek Kabelac [Tue, 11 Aug 2015 13:11:45 +0000 (15:11 +0200)]
cache: add more validation

9 years agocache: api update
Zdenek Kabelac [Tue, 11 Aug 2015 12:01:12 +0000 (14:01 +0200)]
cache: api update

Change logic and naming of some internal API functions.

cache_set_mode() and cache_set_policy() both take segment.

cache mode is now correctly 'masked-in'.

If the passed segment is 'cache' segment - it will automatically
try to find 'defaults' according to profiles if the are NOT
specified on command line or they are NOT already set for cache-pool.

These defaults are never set for cache-pool.

9 years agocache: undefined policy is mq
Zdenek Kabelac [Tue, 11 Aug 2015 13:19:00 +0000 (15:19 +0200)]
cache: undefined policy is mq

If the policy_name is unspecified in metadata,
it's automatically 'mq'.

9 years agotoollib: get_cache_params
Zdenek Kabelac [Thu, 23 Jul 2015 13:35:12 +0000 (15:35 +0200)]
toollib: get_cache_params

Enhance  get_cache_params() to read common cache args.

9 years agocache: man updates
Zdenek Kabelac [Mon, 20 Jul 2015 09:55:43 +0000 (11:55 +0200)]
cache: man updates

Better man for cachepolicy and cachesettings.

9 years agocache: runtime detect default policy
Zdenek Kabelac [Sun, 26 Jul 2015 21:05:11 +0000 (23:05 +0200)]
cache: runtime detect default policy

When the policy is not preset in lvm.conf,
detect in runtime whether to use 'mq' or
new available 'smq'.

9 years agocache: detect smq policy presence
Zdenek Kabelac [Thu, 23 Jul 2015 09:32:09 +0000 (11:32 +0200)]
cache: detect smq policy presence

Add code to detect available cache features.
Support policy_mq & policy_smq  features which might be disabled.

Introduce global_cache_disabled_features_CFG.

9 years agocache: introduce mq and smq profiles
Zdenek Kabelac [Mon, 20 Jul 2015 14:46:21 +0000 (16:46 +0200)]
cache: introduce mq and smq profiles

Add 2 demo profiles for mq and smq policies.
Show all support profilable params.

Use with: lvcreate --policy cache-mq ....

9 years agocache: add cache_policy cache_settings
Zdenek Kabelac [Mon, 20 Jul 2015 09:44:15 +0000 (11:44 +0200)]
cache: add cache_policy cache_settings

Add new profilable configurables:

allocation/cache_policy
allocation/cache_settings

and mark allocation/cache_pool_chunk_size as profilable as well.

Obsolete allocation/cache_pool_cachemode and
introduce new allocation/cache_mode instead.

Rename DEFAULT_CACHE_POOL_POLICY to DEFAULT_CACHE_POLICY.

9 years agoconfigure: --clear-need-check-flag needs 0.5.4
Zdenek Kabelac [Wed, 15 Jul 2015 14:08:02 +0000 (16:08 +0200)]
configure: --clear-need-check-flag needs 0.5.4

Require version 5.4 of cache_check tool where this option
will work correctly.

9 years agoudev: use += for SYSTEMD_WANTS instead of =
Thomas Bächler [Wed, 12 Aug 2015 07:29:04 +0000 (09:29 +0200)]
udev: use += for SYSTEMD_WANTS instead of =

Instead of using = to override SYSTEMD_WANTS, use += to add
the pvscan service.

9 years agolvconvert: fix lockd LV locking
David Teigland [Tue, 11 Aug 2015 17:12:22 +0000 (12:12 -0500)]
lvconvert: fix lockd LV locking

Request a transient LV lock from lvmlockd when
converting an LV.  If the LV is inactive when
lvconvert is run, the LV lock will be acquired
and then released when the command is done.
If the LV is active, a persistent lock exists
already and the transient lock request does nothing.

This fixes the issue that had been mentioned in the
comment previously.

9 years agolvrename: fix lockd LV locking
David Teigland [Mon, 10 Aug 2015 20:46:21 +0000 (15:46 -0500)]
lvrename: fix lockd LV locking

lvrename should not be done if the LV is active on another host.
This check was mistakenly removed when the code was changed to
use LV uuids in locks rather than LV names.

9 years agolvmlockd: add LV name to some debug logging
David Teigland [Mon, 10 Aug 2015 20:05:41 +0000 (15:05 -0500)]
lvmlockd: add LV name to some debug logging

The LV uuid is used as the lock name, and including
the LV name in some log messages makes it easier to
follow log messages.

9 years agolibdm-stats: backtrace if fclose fails (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 18:23:41 +0000 (19:23 +0100)]
libdm-stats: backtrace if fclose fails (Coverity)

Since libdm-stats only uses fmemopen'd FILE objects the only way
that a close can fail is corruption of the memory containing the
FILE: check for this case and emit a backtrace if it occurs.

libdm/libdm-stats.c: 338 in _stats_parse_list()
libdm/libdm-stats.c: 341 in _stats_parse_list()
libdm/libdm-stats.c: 481 in _stats_parse_region()
libdm/libdm-stats.c: 487 in _stats_parse_region()
libdm/libdm-stats.c: 487 in _stats_parse_region()
 - Calling "fclose" without checking return value

9 years agolibdm: simplify stats nr_areas calculation (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 18:18:16 +0000 (19:18 +0100)]
libdm: simplify stats nr_areas calculation (Coverity)

Remove an unneccessary conditional operator and simplify the logic
in _nr_areas:

libdm/libdm-stats.c: 501 in _nr_areas() - Control flow issues  (DEADCODE)

9 years agodmsetup: don't free handle if dm_stats_create fails (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 18:05:10 +0000 (19:05 +0100)]
dmsetup: don't free handle if dm_stats_create fails (Coverity)

The error path of _stats_list frees the task and stats objects:
don't try to branch to it before they have been allocated.

tools/dmsetup.c: 4589 in _stats_help() - Null pointer dereferences  (FORWARD_NULL)

9 years agolibdm: fix stats handle leak in dm_stats_create (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 09:15:22 +0000 (10:15 +0100)]
libdm: fix stats handle leak in dm_stats_create (Coverity)

Make sure the newly created handle is freed if we are unable to
also create the pool for it.

tools/dmsetup.c: 4255 in _stats_list() - Variable "dms" going out of scope leaks the storage it points to.

9 years agolibdm: fix FILE leak in _program_id_from_proc() (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 09:08:03 +0000 (10:08 +0100)]
libdm: fix FILE leak in _program_id_from_proc() (Coverity)

Make sure comm is closed in the error path of _program_id_from_proc().

libdm/libdm-stats.c: 98 in dm_stats_create() - Variable "comm" going out of scope leaks the storage it points to.

9 years agodmsetup: remove bogus !_report test in _stats_report (Coverity)
Bryn M. Reeves [Mon, 10 Aug 2015 09:01:18 +0000 (10:01 +0100)]
dmsetup: remove bogus !_report test in _stats_report (Coverity)

There's no point testing _report here in _stats_report: it's always
initialised before the function is called and if the check did fail
we'd end up freeing an uninitialized dm_task in the error path.

tools/dmsetup.c: 4389 in _stats_report() - Declaring variable "dmt" without initializer.

9 years agolvmlockd: fix check for other sanlock lockspaces
David Teigland [Mon, 10 Aug 2015 18:16:04 +0000 (13:16 -0500)]
lvmlockd: fix check for other sanlock lockspaces

The check for other sanlock lockspaces was not checking
that the lockspace type was sanlock, so if dlm lockspaces
were visible, they were wrongly included.

9 years agovgremove: fix locking when lvmlockd global lock is removed
David Teigland [Mon, 10 Aug 2015 18:04:11 +0000 (13:04 -0500)]
vgremove: fix locking when lvmlockd global lock is removed

When vgremove is used to remove multiple VGs in one command,
e.g. vgremove foo bar, the first VG (foo) that is removed
may have held the sanlock global lock.  In this case,
do not continue removing further VGs (bar) without the
global lock.

9 years agopost-release
Alasdair G Kergon [Mon, 10 Aug 2015 00:02:31 +0000 (01:02 +0100)]
post-release

9 years agopre-release v2_02_127
Alasdair G Kergon [Sun, 9 Aug 2015 23:40:42 +0000 (00:40 +0100)]
pre-release

9 years agodmsetup: Also install dmstats.
Alasdair G Kergon [Sun, 9 Aug 2015 23:35:15 +0000 (00:35 +0100)]
dmsetup: Also install dmstats.

9 years agodmstats: add libdm-stats library and 'dmsetup stats' command
Bryn M. Reeves [Wed, 5 Aug 2015 09:40:00 +0000 (10:40 +0100)]
dmstats: add libdm-stats library and 'dmsetup stats' command

Add the libdm-stats module to libdm: this implements a simple interface
for creating, managing and interrogating I/O statistics regions and
areas on device-mapper devices.

The library interface is documented in libdevmapper.h and provides a
'dm_stats' handle that is used to perform statistics operations and
obtain data.

Public methods are provided to create and destroy handles and to list,
create, and destroy statistics regions as well as to obtain and parse
counter data and calculate rate-based metrics.

This commit also adds a 'dmsetup stats' (aka 'dmstats') command with
'clear', 'create', 'delete', 'list', 'print', and 'report' sub-commands.

See the library documentation and the dmstats.8 manual page for detailed
API and command descriptions.

9 years agoWHATS_NEW_DM: Update for preliminary stats commits
Bryn M. Reeves [Sat, 8 Aug 2015 16:37:07 +0000 (17:37 +0100)]
WHATS_NEW_DM: Update for preliminary stats commits

Add entries for dm_report_column_headings() and report row leaks
and remove the dm_report interval/wait entry.

9 years agolibdm: do not attempt to output column headings with --rows
Bryn M. Reeves [Sat, 8 Aug 2015 16:31:36 +0000 (17:31 +0100)]
libdm: do not attempt to output column headings with --rows

Columns-as-rows output does not use _report_headings(); don't
try to call it when rh->flags & DM_REPORT_OUTPUT_COLUMNS_AS_ROWS.

9 years agolibdm: remove report interval support
Bryn M. Reeves [Fri, 7 Aug 2015 15:15:21 +0000 (16:15 +0100)]
libdm: remove report interval support

Don't do interval management and external timekeeping for stats in
dm_report: let applications handle this on their own.

Since this has not been included in a release remove it from the
library entirely and handle report timing directly inside dmsetup.

9 years agolibdm: add dm_report_column_headings
Bryn M. Reeves [Fri, 7 Aug 2015 17:11:23 +0000 (18:11 +0100)]
libdm: add dm_report_column_headings

Add a function to print column headings regardless of whether they
have already been output. This will be used by dmstats to issue
periodic reminders of the column headings.

This patch removes a check for RH_HEADINGS_PRINTED from
_report_headings that prevents headings being displayed if the flag
is already set; this check is redundant since the only existing
caller (_output_as_columns()) already tests the flag before
calling the function.

9 years agolibdm: fix report rows and headings memory and state leaks
Bryn M. Reeves [Fri, 7 Aug 2015 16:08:54 +0000 (17:08 +0100)]
libdm: fix report rows and headings memory and state leaks

Not releasing objects back to the pool is fine for short-lived
pools since the memory will be freed when dm_pool_destroy() is
called.

Any pool that may be long-lived needs to be more careful to free
objects back to the pool to avoid leaking memory that will not be
reclaimed until the pool is destroyed at process exit time.

The report pool currently leaks each headings line and some row
data.

Although dm_report_output() tries to free the first allocated row
this may end up freeing a later row due to sorting of the row list
while reporting. Store a pointer to the first allocated row from
_do_report_obect() instead and free this at the end of
_output_as_columns(), _output_as_rows(), and dm_report_clear().

Also make sure to call dm_pool_free() for the headings line built
in _report_headings().

When dmstats is introduced it will maintain dm_report objects for
the whole lifetime of the process: without these changes a stats
report could leak around 600k in 10m (exact rate depends on field
selection and data values):

 top - 12:11:32 up 4 days,  3:16, 15 users,  load average: 0.01, 0.12, 0.14
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 6473 root      20   0  130196   3124   2792 S   0.0  0.0   0:00.00 dmstats

 top - 12:22:04 up 4 days,  3:26, 15 users,  load average: 0.06, 0.11, 0.13
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
 6498 root      20   0  130836   3712   2752 S   0.0  0.0   0:00.60 dmstats

With this patch no increase in RSS is seen:

 top - 13:54:58 up 4 days,  4:59, 15 users,  load average: 0.12, 0.14, 0.14
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
13962 root      20   0  130196   2996   2688 S   0.0  0.0   0:00.00 dmstats

 top - 14:04:31 up 4 days,  5:09, 15 users,  load average: 1.02, 0.67, 0.36
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
13962 root      20   0  130196   2996   2688 S   0.3  0.0   0:00.32 dmstats

This also affects report output for repeating reports in the
DM_REPORT_OUTPUT_COLUMNS_AS_ROWS case; row state is not fully cleared for
the next iteration leading to progressive growth of the heading width:

vg_hex-lv_home:vg_hex-lv_swap:vg_hex-lv_root:luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:vg_hex-lv_images
253:253:253:253:253
2:0:1:4:3
L--w:L--w:L--w:L--w:L--w
1:2:1:1:1
3:1:1:1:2
0:0:0:0:0
LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiv08BCGvF4WsJSqWUDUt7qtf2hEmjtVvo:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiKf7XIiwdAYOJfaGhQe9fu26cTEICGgFS:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiEZj7ZXbmrWDuGhd7vvi88VF0NdTMG8iA:CRYPT-LUKS1-797339213f684c929eb7d0aca4c6ba3e-luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOi2rKredlBPnw2X7v1BiCuEpFo6gaE7BRw

:::::vg_hex-lv_home:vg_hex-lv_swap:vg_hex-lv_root:luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:vg_hex-lv_images
:::::253:253:253:253:253
:::::2:0:1:4:3
:::::L--w:L--w:L--w:L--w:L--w
:::::1:2:1:1:1
:::::3:1:1:1:2
:::::0:0:0:0:0
:::::LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiv08BCGvF4WsJSqWUDUt7qtf2hEmjtVvo:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiKf7XIiwdAYOJfaGhQe9fu26cTEICGgFS:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOiEZj7ZXbmrWDuGhd7vvi88VF0NdTMG8iA:CRYPT-LUKS1-797339213f684c929eb7d0aca4c6ba3e-luks-79733921-3f68-4c92-9eb7-d0aca4c6ba3e:LVM-9t8ITqLZa6AuuyVoz5Olp1KwF9ZDBfOi2rKredlBPnw2X7v1BiCuEpFo6gaE7BRw

9 years agolibdm: ensure new dm_timestamp objects are initialized
Bryn M. Reeves [Fri, 7 Aug 2015 12:10:34 +0000 (13:10 +0100)]
libdm: ensure new dm_timestamp objects are initialized

Allocate a dm_timestamp with dm_zalloc() to ensure the memory is
initialized to a known state.

9 years agoman: mention system ID in vgexport and vgimport
David Teigland [Fri, 7 Aug 2015 21:35:07 +0000 (16:35 -0500)]
man: mention system ID in vgexport and vgimport

9 years agoman: add lockd bits to relevant commands
David Teigland [Fri, 7 Aug 2015 21:25:00 +0000 (16:25 -0500)]
man: add lockd bits to relevant commands

9 years agoman lvmlockd: update
David Teigland [Fri, 7 Aug 2015 20:18:44 +0000 (15:18 -0500)]
man lvmlockd: update

9 years agoman lvmcache: mention LVs must be in the same VG
David Teigland [Thu, 6 Aug 2015 15:05:12 +0000 (10:05 -0500)]
man lvmcache: mention LVs must be in the same VG

9 years agolvmlockd: handle loss of sanlock lease storage
David Teigland [Fri, 31 Jul 2015 18:38:38 +0000 (13:38 -0500)]
lvmlockd: handle loss of sanlock lease storage

This adds the infrastructure, code paths, error reporting,
etc. to handle storage errors, or storage loss, under the
sanlock leases in a VG that is being used.  The loss of
storage means sanlock cannot renew its leases, which means
that the host needs to stop using the shared VG before its
leases expire.

This still requires manually shutting down a VG that has
lost lease storage, e.g. unmounting file systems,
deactivating LVs in the VG.  The next step is to
automatically use a command like blkdeactivate to do that.

9 years agodmsetup: Report timestamps of ioctls with -vvv.
Alasdair G Kergon [Wed, 5 Aug 2015 07:28:35 +0000 (08:28 +0100)]
dmsetup: Report timestamps of ioctls with -vvv.

If enabled, record timestamp immediately after the ioctl() returns.

9 years agolibdm: Whitespace.
Alasdair G Kergon [Wed, 5 Aug 2015 04:21:58 +0000 (05:21 +0100)]
libdm: Whitespace.

9 years agolibdm: Whitespace.
Alasdair G Kergon [Wed, 5 Aug 2015 04:11:42 +0000 (05:11 +0100)]
libdm: Whitespace.

9 years agolibdm: Sort new exported symbols.
Alasdair G Kergon [Wed, 5 Aug 2015 04:07:45 +0000 (05:07 +0100)]
libdm: Sort new exported symbols.

9 years agodmsetup: Tidy whitespace.
Alasdair G Kergon [Wed, 5 Aug 2015 04:03:33 +0000 (05:03 +0100)]
dmsetup: Tidy whitespace.

9 years agoman: document --nameprefixes
Peter Rajnoha [Tue, 4 Aug 2015 12:03:50 +0000 (14:03 +0200)]
man: document --nameprefixes

9 years agocoverity: check vg->lvm1_system_id is not NULL before calling strncmp with that
Peter Rajnoha [Tue, 4 Aug 2015 08:16:45 +0000 (10:16 +0200)]
coverity: check vg->lvm1_system_id is not NULL before calling strncmp with that

lib/format1/import-export.c:167: var_deref_model: Passing null pointer "vg->lvm1_system_id" to "strncmp", which dereferences it.

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