]> sourceware.org Git - lvm2.git/log
lvm2.git
8 years agocoverity: cleaning some PW.NOT_COMPATIBLE_WITH_PREVIOUS_DECL
Zdenek Kabelac [Tue, 12 Jul 2016 14:42:14 +0000 (16:42 +0200)]
coverity: cleaning some PW.NOT_COMPATIBLE_WITH_PREVIOUS_DECL

Some very low-prio warns....

8 years agocoverity: easier to follow set-up of vsn variable
Zdenek Kabelac [Tue, 12 Jul 2016 14:41:25 +0000 (16:41 +0200)]
coverity: easier to follow set-up of vsn variable

Helping coverity to see 'vsn' really can't be NULL.

8 years agotests: skip more cache tests for older driver
Zdenek Kabelac [Wed, 13 Jul 2016 14:13:29 +0000 (16:13 +0200)]
tests: skip more cache tests for older driver

8 years agotests: resize of filesystem
Zdenek Kabelac [Wed, 13 Jul 2016 19:15:34 +0000 (21:15 +0200)]
tests: resize of filesystem

Test for https://bugzilla.redhat.com/1354396

8 years agocleanup: add some dots to messages
Zdenek Kabelac [Tue, 12 Jul 2016 20:25:21 +0000 (22:25 +0200)]
cleanup: add some dots to messages

8 years agolvresize: fix zero size extension
Zdenek Kabelac [Wed, 13 Jul 2016 14:23:25 +0000 (16:23 +0200)]
lvresize: fix zero size extension

Commit ca878a3426197b629c76e98cfc049948da470cd7 changed behavior
or resize operation. Later the code has been futher changed
to skip fs resize completely when size of LV is already matching
and finaly at the most recent resize changeset for resize the
check for matching size has been eliminated as well so we ended
with a request call to resize fs to 0 size in some cases.

This commit reoders some test so the prompt happens just once before
resize of possibly 2 related volumes.

Also extra test for having LV already given size is added, and
whole metadata update is skipped for this case as the only
result would be an increment of seqno.

However the filesystem is still resized when requested,
so if the LV has some size and the resize is resolved to
the same size, the filesystem resize is called so in case FS
would not match, the resize will happen.

8 years agolvcreate: raid0 needs default number of stripes
Heinz Mauelshagen [Wed, 13 Jul 2016 19:44:06 +0000 (21:44 +0200)]
lvcreate: raid0 needs default number of stripes

raid0/raid0_meta type LVs don't have a default number of stripes when
created without '-i/--stripes Stripes' whereas other raid types have one.

Patch sets the default for raid0/raid0_meta to 2 stripes.

The default amount of stripes for raid4/5/10 is changed to 2 and for raid6 to 3
rather than using all PVs in the VG or those provided on the command line.

This is to avoid unintended high number of stripes in case of many PVs.

To select a different amount of stripes from the default,
use 'lvcreate -i/--stripes Stripes'.

- resolves rhbz1354650

8 years agoman: changes to lvconvert
David Teigland [Wed, 13 Jul 2016 18:09:38 +0000 (13:09 -0500)]
man: changes to lvconvert

Generally include more information about options.

8 years agolv_manip: extension of raid0 causes livelock
Heinz Mauelshagen [Wed, 13 Jul 2016 13:16:23 +0000 (15:16 +0200)]
lv_manip: extension of raid0 causes livelock

A livelock occurs on extension in lv_manip when adjusting the region size,
which doesn't apply to any raid0/raid0_meta LVs (these don't have a bitmap).

Fix by prohibiting the region size adjustment on any such LVs.

- resolves rhbz1354604

8 years agoraid_manip: 'vgreduce --removemissing --force ...' segfaults on raid0 LV
Heinz Mauelshagen [Tue, 12 Jul 2016 15:55:01 +0000 (17:55 +0200)]
raid_manip: 'vgreduce --removemissing --force ...' segfaults on raid0 LV

An unconditional access to the non-existing MetaLV of a raid0 LV in
lv_raid_remove_missing() was causing the segfault.

Only call log_debug() on replacements of existing MetaLVs.

- resolves rhbz1354646

8 years agolvchange: resync attempts on raid0 cause segfaults
Heinz Mauelshagen [Tue, 12 Jul 2016 15:20:38 +0000 (17:20 +0200)]
lvchange: resync attempts on raid0 cause segfaults

Resync attempts on raid0/raid0_meta via 'lvchange --resync ...'
cause segfaults.

'lvchange --syncaction ...' doesn't get rejected either.

Prohibit both on raid0/raid0_meta LVs.

- resolves rhbz1354656

8 years agoRevert "man: restore lost synopsis for lvconvert"
David Teigland [Tue, 12 Jul 2016 14:48:59 +0000 (09:48 -0500)]
Revert "man: restore lost synopsis for lvconvert"

This reverts commit 80394ae7cd9ae3a9b7523216840a3b4bfca5cd70.

Anything that was missing or in error will be handled differently.

8 years agovgsplit: use dm_list_next()
Heinz Mauelshagen [Tue, 12 Jul 2016 14:25:06 +0000 (16:25 +0200)]
vgsplit: use dm_list_next()

8 years agovgsplit: temporary list pointer may be invalid
Heinz Mauelshagen [Tue, 12 Jul 2016 14:15:32 +0000 (16:15 +0200)]
vgsplit: temporary list pointer may be invalid

4420d41fea8 introduced recursive split of lvs which
splits a top-level LV together with it's sub LVs.

This lead to invalid temporary list pointers
causing hangs/OOM situations.

Patch updates the temporary list pointer
referencing a moved sub LV.

- resolves rhbz1354686

8 years agoman: lvcreate: try to be clearer about -W|--wipesignatures
Peter Rajnoha [Tue, 12 Jul 2016 13:20:12 +0000 (15:20 +0200)]
man: lvcreate: try to be clearer about -W|--wipesignatures

There was still some confusion report about -W|--wipesignatures
lvcreate option so try to be even clearer. Hopefully, the last edit
here.

8 years agotests: remove more test
Zdenek Kabelac [Tue, 12 Jul 2016 08:37:40 +0000 (10:37 +0200)]
tests: remove more test

Try to remove more tests before confusing older driver to death.

8 years agotests: cache error message changes too often
Zdenek Kabelac [Mon, 11 Jul 2016 19:58:14 +0000 (21:58 +0200)]
tests: cache error message changes too often

Until lvconvert stabilize, avoid testing resulting error message.

8 years agoman: restore lost synopsis for lvconvert
Zdenek Kabelac [Tue, 12 Jul 2016 11:17:36 +0000 (13:17 +0200)]
man: restore lost synopsis for lvconvert

Synopsis are very useful for quick orientation and also
we provide then for all remaining command.

Also list ALL supported options in a single ordered list,
user should not seek for them.

8 years agocleanup: lvconvert display_lvname and indent updates
Zdenek Kabelac [Tue, 12 Jul 2016 09:05:34 +0000 (11:05 +0200)]
cleanup: lvconvert  display_lvname and indent updates

Use display_lvname() for printing vg/lv names.
Add some missing dots.
Some indents.

8 years agocleanup: gcc warns removal
Zdenek Kabelac [Mon, 11 Jul 2016 20:58:21 +0000 (22:58 +0200)]
cleanup: gcc warns removal

Ensure vars have always defined value.

8 years agoblkdeactivate: add -m|--mpathoption disablequeueing and use it for blk-availability...
Peter Rajnoha [Tue, 12 Jul 2016 07:52:18 +0000 (09:52 +0200)]
blkdeactivate: add -m|--mpathoption disablequeueing and use it for blk-availability systemd service and initscript

blkdeactivate -m disablequeueing causes "multipathd disablequeueing maps"
call inside blkdeactivate script before deactivating devices. This
avoids a situation where blkdeactivate may wait for paths to appear if
multipath is set to queueing and there's a stack of other devices and/or
mount points on top of such multipath device.

See also https://bugzilla.redhat.com/show_bug.cgi?id=1344381.

8 years agolvconvert: remove some FIXME comments
David Teigland [Fri, 8 Jul 2016 20:31:27 +0000 (15:31 -0500)]
lvconvert: remove some FIXME comments

8 years agoman: lvconvert changes
David Teigland [Fri, 8 Jul 2016 20:22:31 +0000 (15:22 -0500)]
man: lvconvert changes

8 years agotests: skip some tests for older cache driver
Zdenek Kabelac [Mon, 11 Jul 2016 13:45:28 +0000 (15:45 +0200)]
tests: skip some tests for older cache driver

Cache target 1.4 on f19 kernel shows error, skipping some tests...

8 years agotests: reduce amount of pvcreates
Zdenek Kabelac [Mon, 11 Jul 2016 13:29:28 +0000 (15:29 +0200)]
tests: reduce amount of pvcreates

Reduce number of evualted pvcreate commands.
Since 0 is default value used to fill missing params,
and 0 is also 1st. value in array, it's being tested.

Drop unused data_alignment_offset.

8 years agotests: increase max lines for clvmd
Zdenek Kabelac [Mon, 11 Jul 2016 12:45:25 +0000 (14:45 +0200)]
tests: increase max lines for clvmd

Clvmd is a bit more verbose long time running process so
let it live with more logged lines.

Also fix typo in warn message from last commit.

8 years agotests: add LVM_LOG_FILE_MAX_LINES
Zdenek Kabelac [Mon, 11 Jul 2016 10:43:28 +0000 (12:43 +0200)]
tests: add LVM_LOG_FILE_MAX_LINES

When logging to epoch files we would like to prevent creating too large
log files otherwise a spining command could fulfill available space
very easily and quickly.

Limit for to 100000 per command.

8 years agolibdm: add configure.in checks for fiemap.h and magic.h
Bryn M. Reeves [Fri, 8 Jul 2016 22:38:32 +0000 (23:38 +0100)]
libdm: add configure.in checks for fiemap.h and magic.h

8 years agolibdm: use 'goto_bad' if extent pool allocation fails
Bryn M. Reeves [Fri, 8 Jul 2016 21:28:50 +0000 (22:28 +0100)]
libdm: use 'goto_bad' if extent pool allocation fails

Generate a backtrace if unable to extend the extent table.

8 years agolibdm: use macro for boundary test in _stats_get_extents_for_file()
Bryn M. Reeves [Fri, 8 Jul 2016 21:21:14 +0000 (22:21 +0100)]
libdm: use macro for boundary test in _stats_get_extents_for_file()

8 years agodoc: update --filemap usage in dmstats.8.in
Bryn M. Reeves [Fri, 8 Jul 2016 21:05:14 +0000 (22:05 +0100)]
doc: update --filemap usage in dmstats.8.in

8 years agodmstats: accept multiple arguments to --filemap
Bryn M. Reeves [Fri, 8 Jul 2016 21:02:47 +0000 (22:02 +0100)]
dmstats: accept multiple arguments to --filemap

Make the --filemap switch take no arguments and instead accept one
or more files on the command line to be mapped and placed into
groups.

This allows --filemap to be used with a glob:

  # dmstats create --filemap *
  rhel5.10-1.qcow2: Created new group with 87 region(s) as group ID 1564.
  rhel5.10.qcow2: Created new group with 8 region(s) as group ID 1651.
  rhel7.0-1.qcow2: Created new group with 11 region(s) as group ID 1659.
  rhel7.0.qcow2: Created new group with 1454 region(s) as group ID 1670.
  vm.img: Created new group with 2 region(s) as group ID 3124.

8 years agolibdm: use a constant for FIEMAP buffer size
Bryn M. Reeves [Fri, 8 Jul 2016 20:13:25 +0000 (21:13 +0100)]
libdm: use a constant for FIEMAP buffer size

8 years agolibdm: use SECTOR_SHIFT constant in _stats_add_extent()
Bryn M. Reeves [Fri, 8 Jul 2016 20:12:18 +0000 (21:12 +0100)]
libdm: use SECTOR_SHIFT constant in _stats_add_extent()

8 years agoman: lvconvert changes
David Teigland [Fri, 8 Jul 2016 16:55:42 +0000 (11:55 -0500)]
man: lvconvert changes

8 years agolvconvert: allow splitcache on hidden/used cache pool
David Teigland [Fri, 8 Jul 2016 19:08:55 +0000 (14:08 -0500)]
lvconvert: allow splitcache on hidden/used cache pool

lvconvert --splitcache VG/CachePool_corig

Allow the split via the hidden/used cache pool for the time being,
since the new lvconvert code did intend to allow it, but was just
missing the exception in the list of hidden LVs that were allowed.

The preferred method for splitcache is to run it on the visible
cache LV, not the hidden cache pool.  That may eventually become
the only method since we try to avoid running commands on
hidden LVs.

8 years agolvconvert: don't show aliases in error output
David Teigland [Fri, 8 Jul 2016 18:29:19 +0000 (13:29 -0500)]
lvconvert: don't show aliases in error output

We want to consistently use the standard command form.
The aliases are now mentioned in the man page for reference.

8 years agodmstats: use canonical path when reporting errors
Bryn M. Reeves [Fri, 8 Jul 2016 16:06:35 +0000 (17:06 +0100)]
dmstats: use canonical path when reporting errors

When a 'dmstats create --filemap' operation fails (e.g. during
open(2), close(2), or dm_stats_create_regions_from_fd()), use the
canonical version of the path. This avoids cryptic/confusing error
messages when symbolic links exist in the path argument given:

  # findmnt /var/lib/libvirt/images -otarget,source
  TARGET                  SOURCE
  /var/lib/libvirt/images /dev/mapper/vg_hex-lv_images

  # readlink /var/lib/libvirt/images/my.img
  /boot/my.img

  # dmstats create --filemap /var/lib/libvirt/images/my.img
  Cannot map file: not a device-mapper device.
  Could not create regions from file /var/lib/libvirt/images/my.img
  Command failed

Using the canonical path the error is immediately obvious:

  # dmstats create --filemap /var/lib/libvirt/images/my.img
  Cannot map file: not a device-mapper device.
  Could not create regions from file /boot/my.img
  Command failed

8 years agodoc: remove obsolete --statstype references from dmstats.8.in
Bryn M. Reeves [Thu, 7 Jul 2016 14:23:07 +0000 (15:23 +0100)]
doc: remove obsolete --statstype references from dmstats.8.in

8 years agoWHATS_NEW_DM: add --segments grouping and resource leak fix
Bryn M. Reeves [Thu, 7 Jul 2016 13:37:49 +0000 (14:37 +0100)]
WHATS_NEW_DM: add --segments grouping and resource leak fix

8 years agodoc: mention --segments grouping in dmstats.8.in
Bryn M. Reeves [Thu, 7 Jul 2016 14:10:07 +0000 (15:10 +0100)]
doc: mention --segments grouping in dmstats.8.in

8 years agodmstats: group regions by default with --segments
Bryn M. Reeves [Thu, 7 Jul 2016 12:53:06 +0000 (13:53 +0100)]
dmstats: group regions by default with --segments

Grouping is also useful in combination with --segments: creating a
group allows both individual segment data and data for the device
as a whole to be presented in the same report.

Support grouping for 'create --segments' in the same manner as for
'create --filemap'; group regions by default, applying an optional
alias specified with --alias, unless the user specifies --nogroup.

8 years agoWHATS_NEW_DM: add --filemap and histogram aggregation
Bryn M. Reeves [Thu, 7 Jul 2016 08:51:54 +0000 (09:51 +0100)]
WHATS_NEW_DM: add --filemap and histogram aggregation

8 years agodmstats: allow --bounds with 'create --filemap'
Bryn M. Reeves [Thu, 7 Jul 2016 08:48:09 +0000 (09:48 +0100)]
dmstats: allow --bounds with 'create --filemap'

8 years agolibdm: enable creation of filemap regions with histograms
Bryn M. Reeves [Thu, 7 Jul 2016 08:47:19 +0000 (09:47 +0100)]
libdm: enable creation of filemap regions with histograms

8 years agodoc: mention group histogram restrictions in dmstats.8.in
Bryn M. Reeves [Mon, 4 Jul 2016 11:49:14 +0000 (12:49 +0100)]
doc: mention group histogram restrictions in dmstats.8.in

8 years agolibdm: allow regions with histograms in dm_stats_create_group()
Bryn M. Reeves [Sun, 3 Jul 2016 21:55:33 +0000 (22:55 +0100)]
libdm: allow regions with histograms in dm_stats_create_group()

Allow regions with histograms to be grouped if all histograms have
the same number of bins and matching bounds.

8 years agolibdm: add aggregation support to dm_stats_get_histogram()
Bryn M. Reeves [Sun, 3 Jul 2016 20:59:31 +0000 (21:59 +0100)]
libdm: add aggregation support to dm_stats_get_histogram()

Support aggregate group and region histograms by allocating a new
histogram from the pool and populating it with a sum of the histogram
data for the areas contained in the region or group.

To avoid repeatedly summing the same histogram data, cache the pointer
in the group and regions structs for subsequent access. The aggregate
histograms are allocated from the same pool as the area histograms in
the corresponding handle and will be discarded at each list or populate
operation.

8 years agodoc: update dmstats.8.in for --filemap and --nogroup dev-bmr-dmstats-filemap
Bryn M. Reeves [Fri, 1 Jul 2016 20:41:25 +0000 (21:41 +0100)]
doc: update dmstats.8.in for --filemap and --nogroup

8 years agodmstats: add create --filemap
Bryn M. Reeves [Thu, 30 Jun 2016 20:48:10 +0000 (21:48 +0100)]
dmstats: add create --filemap

Add a new option to the create command to create regions that map the
extents of a file:

  # dmstats create --filemap /path/to/file
  /path/to/file: Created new group with 10 region(s) as group ID 0.

When performing a --filemap no device argument is required (and
supplying one results in error) since the device to bind to is implied
by the file path and is obtained directly from an fstat().

Grouping may be optionally disabled by the --nogroup switch: in this
case the command will report each region individually:

  # dmstats create --nogroup --filemap /path/to/file
  /path/to/file: Created new region with 1 area as region ID 0.
  /path/to/file: Created new region with 1 area as region ID 1.
  /path/to/file: Created new region with 1 area as region ID 2.

When grouping regions the group alias is automatically set to the
basename (as returned by dm_basename()) of the provided file.

This can be overridden to a user-defined value at the command line by
use of the --alias option.

If grouping is disabled no alias can be set.

Use of offset and subdivision options (--start, --length, --segments,
--areas, --areasize).

Setting aux_data and histograms for groups is possible but is not
currently implemented.

8 years agolibdm: add dm_stats_create_regions_from_fd()
Bryn M. Reeves [Thu, 30 Jun 2016 20:46:43 +0000 (21:46 +0100)]
libdm: add dm_stats_create_regions_from_fd()

Add a call to create dmstats regions that correspond to the extents
present in a file descriptor open on a file in a local file system.
The file must reside on a file system type that correctly supports
physical extent location data in the FIEMAP ioctl.

Regions are optionally placed into a group with a user-defined alias.

File systems that do not support physical offsets in FIEMAP (btrfs
currently) are detected via fstatfs() - although attempting to map
a --filemap group on btrfs will fail anyway with the generic error
"Not on a device-mapper device" this is confusing; the file system
mount is on a device-mapper device, but btrfs' volume layer masks
this in the returned st_dev field since the returned logical file
extents may span multiple physical devices.

8 years agoman: enhance lvconvert
Heinz Mauelshagen [Fri, 8 Jul 2016 13:18:18 +0000 (15:18 +0200)]
man: enhance lvconvert

8 years agolibdm: fix group resource leak in dm_stats_delete_region()
Bryn M. Reeves [Thu, 7 Jul 2016 12:45:06 +0000 (13:45 +0100)]
libdm: fix group resource leak in dm_stats_delete_region()

The function _stats_remove_region_id_from_group() incorecctly set
the group_id to DM_STATS_GROUP_NOT_PRESENT _before_ the call to
_stats_group_destroy(). This will cause the destroy function to
return immediately without doing anything:

 339 static void _stats_group_destroy(struct dm_stats_group *group)
 340 {
 341         if (!_stats_group_present(group))
 342                 return;

Invalidating the ID in _stats_region_region_id_from_group() is
redundant anyway; it is rightly done as the last operation in
_stats_group_destroy (and it is not possible for anything to see
the old value between the two calls).

Remove the change to group_id to ensure that the alias and bitset
resources are correctly freed.

8 years agodmstats: ensure dm_stats_delete_region() return is checked
Bryn M. Reeves [Fri, 8 Jul 2016 10:46:13 +0000 (11:46 +0100)]
dmstats: ensure dm_stats_delete_region() return is checked

8 years agolibdm: improve comments in stats grouping functions
Bryn M. Reeves [Fri, 8 Jul 2016 10:05:38 +0000 (11:05 +0100)]
libdm: improve comments in stats grouping functions

Add more detailed comments to dm_stats_create_group() and
_stats_group_check_overlap().

8 years agolibdm: fix resource leak in dm_stats_set_alias()
Bryn M. Reeves [Fri, 8 Jul 2016 09:51:19 +0000 (10:51 +0100)]
libdm: fix resource leak in dm_stats_set_alias()

When we fail to update aux_data the newly allocated group->alias must
be freed before reinstating old_alias.

8 years agolibdm: enclose dm_stats_walk_do/while() body in do..while
Bryn M. Reeves [Thu, 7 Jul 2016 20:28:35 +0000 (21:28 +0100)]
libdm: enclose dm_stats_walk_do/while() body in do..while

The call to dm_stats_walk_start() before the do statement makes
dm_stats_walk_do() behave inconsistently depending on context;
wrap them in an additional do { } while (0) so that the macro
always expands to a valid statement.

8 years agoman: more lvcreate size rewording
David Teigland [Thu, 7 Jul 2016 22:21:05 +0000 (17:21 -0500)]
man: more lvcreate size rewording

8 years agoman: rewrite lvconvert
David Teigland [Wed, 6 Jul 2016 20:26:56 +0000 (15:26 -0500)]
man: rewrite lvconvert

Based on the new enumeration of all possible commands.

8 years agoman: more rewording for lvcreate size
David Teigland [Thu, 7 Jul 2016 18:11:43 +0000 (13:11 -0500)]
man: more rewording for lvcreate size

8 years agolvconvert: allow converting type raid1 to type linear
David Teigland [Wed, 6 Jul 2016 21:44:18 +0000 (16:44 -0500)]
lvconvert: allow converting type raid1 to type linear

The code could perform this conversion but ironically
did not recognize the standard command form, only the
the unpreferred "implication-based" command form.

"lvconvert --type linear VG/RaidLV" would fail, but
"lvconvert --mirrors 0 VG/RaidLV" would succeed.

8 years agolvconvert: allow converting type mirror to type linear
David Teigland [Wed, 6 Jul 2016 21:33:25 +0000 (16:33 -0500)]
lvconvert: allow converting type mirror to type linear

The code could perform this conversion but ironically
did not recognize the standard command form, only the
the unpreferred "implication-based" command form.

"lvconvert --type linear VG/MirrorLV" would fail, but
"lvconvert --mirrors 0 VG/MirrorLV" would succeed.

8 years agovgcreate: allow pvcreate force option
David Teigland [Wed, 6 Jul 2016 19:10:53 +0000 (14:10 -0500)]
vgcreate: allow pvcreate force option

Commit a9940bd3c92 began disallowing the -f (force) option
to apply to the implicit pvcreate.  Make it allowed again.

8 years agoman: clarify lvcreate size in extents
David Teigland [Wed, 6 Jul 2016 16:35:50 +0000 (11:35 -0500)]
man: clarify lvcreate size in extents

8 years agopost-release
Alasdair G Kergon [Wed, 6 Jul 2016 16:04:25 +0000 (17:04 +0100)]
post-release

8 years agopre-release v2_02_160
Alasdair G Kergon [Wed, 6 Jul 2016 15:55:44 +0000 (16:55 +0100)]
pre-release

8 years agolibdm: check for empty aux_data in _parse_aux_data_group()
Bryn M. Reeves [Wed, 6 Jul 2016 15:29:06 +0000 (16:29 +0100)]
libdm: check for empty aux_data in _parse_aux_data_group()

If after extracting stats arguments and group tags nothing remains
of aux_data but '-' set the region->aux_data field to the empty
string to match behaviour for non-grouped regions.

8 years agocoverity: Fixes for recent changes.
Alasdair G Kergon [Wed, 6 Jul 2016 15:09:32 +0000 (16:09 +0100)]
coverity: Fixes for recent changes.

8 years agolibdm: use log_err_once() for group histogram message
Bryn M. Reeves [Wed, 6 Jul 2016 10:16:12 +0000 (11:16 +0100)]
libdm: use log_err_once() for group histogram message

8 years agolibdm: do not permit grouping regions with histograms
Bryn M. Reeves [Wed, 6 Jul 2016 10:10:23 +0000 (11:10 +0100)]
libdm: do not permit grouping regions with histograms

Although not harmful do not allow a group containing regions with
histograms since it is not currently possible to present histogram
data aggregated for the group.

8 years agodmstats: simplify nr_areas calculation (CWE-561)
Bryn M. Reeves [Mon, 4 Jul 2016 18:25:40 +0000 (19:25 +0100)]
dmstats: simplify nr_areas calculation (CWE-561)

Eliminate dead conditional (step cannot be zero).

Fixes commit 988ca74.

8 years agodmstats: fix 'obj_type' field width
Bryn M. Reeves [Wed, 6 Jul 2016 08:37:59 +0000 (09:37 +0100)]
dmstats: fix 'obj_type' field width

The header for 'obj_type' was changed from 'Object Type' to
'ObjType': update the minimum field width to match this change.

8 years agolibdm: check non-zero io count in _average_{rd,wr}_wait_time (Coverity)
Bryn M. Reeves [Wed, 6 Jul 2016 08:20:05 +0000 (09:20 +0100)]
libdm: check non-zero io count in _average_{rd,wr}_wait_time (Coverity)

Although a non-zero value for the number of ticks spent doing IO
should imply a non-zero number of IOs in the interval test for
this explicitly to avoid a divide-by-zero in the event of bad
counter data.

8 years agolibdm: test for zero interval_ns in _utilization() (Coverity)
Bryn M. Reeves [Wed, 6 Jul 2016 08:12:51 +0000 (09:12 +0100)]
libdm: test for zero interval_ns in _utilization() (Coverity)

It's possible for interval_ns to be zero if the interval is not
set or the clock is misconfigured. Test for this before using the
value as the divisor in the utilisation calculation.

8 years agolibdm: restore missing braces in _stats_walk_end_areas
Bryn M. Reeves [Wed, 6 Jul 2016 08:04:13 +0000 (09:04 +0100)]
libdm: restore missing braces in _stats_walk_end_areas

Jumping to the end of the region table must only happen if there
are no more present, non-skipped regions, and no group walk is
configured to begin.

8 years agolibdm: fix mask leak in dm_bitset_parse_list
Bryn M. Reeves [Wed, 6 Jul 2016 07:59:09 +0000 (08:59 +0100)]
libdm: fix mask leak in dm_bitset_parse_list

If an unexpected '-' is found jump to the error branch so that the
mask is properly freed before returning.

8 years agopost-release
Alasdair G Kergon [Wed, 6 Jul 2016 00:14:33 +0000 (01:14 +0100)]
post-release

8 years agopre-release v2_02_159
Alasdair G Kergon [Tue, 5 Jul 2016 23:59:28 +0000 (00:59 +0100)]
pre-release

8 years agovgsplit: Don't skip moving internal snapshot LV.
Alasdair G Kergon [Tue, 5 Jul 2016 22:08:14 +0000 (23:08 +0100)]
vgsplit: Don't skip moving internal snapshot LV.

Also place snapshot LV handling back at the end, after all possible
origin and cow LVs got dealt with.

8 years agolibdm: cast walk flags to uint64_t when logging.
Bryn M. Reeves [Tue, 5 Jul 2016 19:45:24 +0000 (20:45 +0100)]
libdm: cast walk flags to uint64_t when logging.

Walk flags are ULL constants; cast the result to a uint64_t before
logging with a FMTx64 format specifier to avoid a compiler warning:

  warning: format ‘%lx’ expects argument of type ‘long unsigned int’,
  but argument 5 has type ‘long long unsigned int’

8 years agolibdm: ensure flags constants have ULL suffix
Bryn M. Reeves [Tue, 5 Jul 2016 19:21:49 +0000 (20:21 +0100)]
libdm: ensure flags constants have ULL suffix

The walk flags used by libdm-stats use the upper portion of a 64b
value: use the ULL suffix to ensure the compiler knows the expected
size.

8 years agodoc: document --area, --region, and --group in dmstats.8.in
Bryn M. Reeves [Tue, 5 Jul 2016 18:28:19 +0000 (19:28 +0100)]
doc: document --area, --region, and --group in dmstats.8.in

8 years agodmstats: fix <backtrace> in _display_info_cols()
Bryn M. Reeves [Tue, 5 Jul 2016 17:42:29 +0000 (18:42 +0100)]
dmstats: fix <backtrace> in _display_info_cols()

Remove a false <backtrace> in _display_info_cols(): it is not an
error if there are no regions to display.

Fixes commit e6724f03.

8 years agolibdm: fix <backtrace> in dm_stats_populate
Bryn M. Reeves [Tue, 5 Jul 2016 17:34:14 +0000 (18:34 +0100)]
libdm: fix <backtrace> in dm_stats_populate

8 years agolibdm: fix <backtrace> in dm_stats_get_nr_regions
Bryn M. Reeves [Tue, 5 Jul 2016 17:33:02 +0000 (18:33 +0100)]
libdm: fix <backtrace> in dm_stats_get_nr_regions

8 years agodmstats: rename --auxdata to --userdata
Bryn M. Reeves [Tue, 5 Jul 2016 14:54:02 +0000 (15:54 +0100)]
dmstats: rename --auxdata to --userdata

8 years agodmstats: rename 'aux_data' to 'user_data'
Bryn M. Reeves [Tue, 5 Jul 2016 14:30:31 +0000 (15:30 +0100)]
dmstats: rename 'aux_data' to 'user_data'

Make it clear that the "aux data" presented in reports is the user
data stored in the field (and does not include any library-internal
state such as group descriptors) by renaming the field to user_data
and changing the heading to "UserData".

8 years agolibdm: clarify library's use of aux_data
Bryn M. Reeves [Tue, 5 Jul 2016 14:17:44 +0000 (15:17 +0100)]
libdm: clarify library's use of aux_data

Make it clear in libdevmapper.h, and in function argument names, that
libdm-stats uses the aux_data field internally and that any values set
for user_data are appended to the library values before being stored
with a region, and similarly, that internal data fields will be stripped
prior to returning any previously stored user_data.

8 years agodmstats: replace --statstype with separate object switches
Bryn M. Reeves [Tue, 5 Jul 2016 13:08:28 +0000 (14:08 +0100)]
dmstats: replace --statstype with separate object switches

Replace --statstype=area,region,group with a separate switch for
each object type: --area, --region, --group. Omitting any object
type switch will use the defaults for the current command (regions
and groups for list, and regions, groups and areas for verbose list).

8 years agodmstats: add 'statsname' and 'obj_type' to default stats fields
Bryn M. Reeves [Tue, 5 Jul 2016 11:29:13 +0000 (12:29 +0100)]
dmstats: add 'statsname' and 'obj_type' to default stats fields

8 years agodmstats: rename 'type' field to 'obj_type'
Bryn M. Reeves [Tue, 5 Jul 2016 11:27:46 +0000 (12:27 +0100)]
dmstats: rename 'type' field to 'obj_type'

Rename the field and remove whitespace from the column heading:

  "Object Type" -> "ObjType"

8 years agodmstats: use 'statsname' and 'groupid' in default fields
Bryn M. Reeves [Tue, 5 Jul 2016 11:10:47 +0000 (12:10 +0100)]
dmstats: use 'statsname' and 'groupid' in default fields

Replace the 'name' field with 'statsname' in order to report alias
names for groups, and include the 'group_id' field between statsname
and the 'region_id' field to make it clear to the user when groups
are in use.

8 years agodmstats: convert 'delete' to dm_stats_foreach_region()
Bryn M. Reeves [Tue, 5 Jul 2016 10:26:24 +0000 (11:26 +0100)]
dmstats: convert 'delete' to dm_stats_foreach_region()

8 years agodmstats: convert 'print' to dm_stats_foreach_region()
Bryn M. Reeves [Tue, 5 Jul 2016 10:09:38 +0000 (11:09 +0100)]
dmstats: convert 'print' to dm_stats_foreach_region()

8 years agodmstats: convert 'clear' to dm_stats_foreach_region()
Bryn M. Reeves [Tue, 5 Jul 2016 09:54:23 +0000 (10:54 +0100)]
dmstats: convert 'clear' to dm_stats_foreach_region()

8 years agodoc: update dmstats.8.in for groups
Bryn M. Reeves [Wed, 22 Jun 2016 17:36:10 +0000 (18:36 +0100)]
doc: update dmstats.8.in for groups

8 years agodmstats: fix region deletion message
Bryn M. Reeves [Fri, 1 Jul 2016 13:18:38 +0000 (14:18 +0100)]
dmstats: fix region deletion message

Make the use of 64-bit format macros consistent with other usage
and end the message with a '.'.

8 years agodmstats: accept --groupid for 'dmstats delete'
Bryn M. Reeves [Fri, 1 Jul 2016 12:15:43 +0000 (13:15 +0100)]
dmstats: accept --groupid for 'dmstats delete'

Allow deletion of a group and all the regions it contains with a
single 'dmstats delete' command.

8 years agodmstats: allow --statstype to override report defults
Bryn M. Reeves [Wed, 29 Jun 2016 09:19:28 +0000 (10:19 +0100)]
dmstats: allow --statstype to override report defults

8 years agodmstats: report a list of members as a group's region_id
Bryn M. Reeves [Sun, 19 Jun 2016 20:01:50 +0000 (21:01 +0100)]
dmstats: report a list of members as a group's region_id

Instead of '-' print the member list in range notation (as stored
in aux_data).

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