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

8 years agodmstats: report groups and region summaries
Bryn M. Reeves [Sun, 19 Jun 2016 12:38:41 +0000 (13:38 +0100)]
dmstats: report groups and region summaries

Walk avaiable groups and regions (in addition to areas) and report
aggregate statistics and properties.

A new switch is added to filter the type of obects inclued in the
report:

  --statstype={all,area,region,group}

The type of the current row is also available in a new
DR_STATS_META field 'type'.

8 years agodmstats: do not walk regions if deleting a single id
Bryn M. Reeves [Sun, 19 Jun 2016 13:40:03 +0000 (14:40 +0100)]
dmstats: do not walk regions if deleting a single id

8 years agodmstats: add stats_name field
Bryn M. Reeves [Mon, 13 Jun 2016 13:28:37 +0000 (14:28 +0100)]
dmstats: add stats_name field

To allow the names used to describe statistics report objects to
change (for e.g to support groups and region and group aliases)
introduce a new "stats_name" field that evaluates to the correct
name for the object being reported.

8 years agodmstats: add group alias support
Bryn M. Reeves [Mon, 7 Mar 2016 18:16:22 +0000 (18:16 +0000)]
dmstats: add group alias support

8 years agodmstats: add 'group' and 'ungroup' commands
Bryn M. Reeves [Mon, 7 Mar 2016 18:07:57 +0000 (18:07 +0000)]
dmstats: add 'group' and 'ungroup' commands

Add a pair of commands to create and delete stats groups:

  dmstats group --regions REGIONS

  dmstats ungroup --groupid ID

REGIONS specifies a list of regions to be included in the group.
Regions are specified as a comma separated list in order of
increasing region ID. Ranges may be specified as a hypen separated
pair of values giving the first and last member of the range.

8 years agodmstats: add group_id report field type
Bryn M. Reeves [Mon, 7 Mar 2016 18:01:45 +0000 (18:01 +0000)]
dmstats: add group_id report field type

8 years agolibdm: allow deleting regions with dm_stats_delete_group()
Bryn M. Reeves [Fri, 1 Jul 2016 12:14:41 +0000 (13:14 +0100)]
libdm: allow deleting regions with dm_stats_delete_group()

Add a flag to dm_stats_delete_group() to allow optional deletion
of all regions belonging to the group being removed.

8 years agolibdm: add stats group and region iterators and properties
Bryn M. Reeves [Sun, 19 Jun 2016 12:30:46 +0000 (13:30 +0100)]
libdm: add stats group and region iterators and properties

Add support do dm_stats_walk*() to walk over the set of
available groups using the cursor embedded in the dm_stats
handle, and to obtain the type of the object at the current
stats cursor location. A set of flags is introduced to
control which objects are visited:

    DM_STATS_WALK_AREA
    DM_STATS_WALK_REGION
    DM_STATS_WALK_GROUP
    DM_STATS_WALK_ALL

A final flag suppresses visits to regions that contain only a
single area - since the aggregate of such a region is idential
to the area it contains this allows these duplicates to be
filtered out:

    DM_STATS_WALK_SKIP_SINGLE_AREA

If flags are not initialised before beginning a walk the default
set matches the behaviour of previous versions of the library.

Also accept group identifiers as immediate arguments to the
counter, metric, and property functions by adding control
flags to the region and area identifiers passed in.

Region and area properties are mapped to their equivalents for
the group (for example: group size is reported as the sum of
all regions contained in the group). Counter and metric values
are aggregated for the region or group.

8 years agolibdm: use defined constants for buffer sizes
Bryn M. Reeves [Thu, 16 Jun 2016 18:40:43 +0000 (19:40 +0100)]
libdm: use defined constants for buffer sizes

Introduce constants for the buffer sizes that libdm-stats uses:
one for messages sent to the kernel, one for rows of response data
returned, and a pair for the "start+len" range and histogram bounds
strings.

8 years agolibdm: add statistics groups
Bryn M. Reeves [Mon, 29 Feb 2016 17:52:29 +0000 (17:52 +0000)]
libdm: add statistics groups

Add a grouping facility to the libdm-stats library that allows the
user to bind several regions together as a group. Groups may be
used to aggregate data from several regions for reporting, or to
select and sort among large sets of regions.

A textual descriptor ("group tag") is associated with each group
and is stored in the first group member's aux_data field. The
tag contains the group member list and an optional alias for the
group, allowing the user to assign meaningful names to groups of
regions.

These descriptors are parsed in @stats_list message responses and
populate the resulting region and area tables with the group
structure.

Groups with overlapping regions are permitted but since this will
result in some events being counted more than once a warning is
printed in this case.

Nested and overlapping groups are not currently supported and
attempting to create these configurations results in error.

8 years agolibdm: rename 'region' to 'skip_region' in _stats_walk_next
Bryn M. Reeves [Mon, 20 Jun 2016 16:12:38 +0000 (17:12 +0100)]
libdm: rename 'region' to 'skip_region' in _stats_walk_next

In libdm-stats.c 'region' usually refers to a 'struct region*'.
Rename the argument to _stats_walk_start to avoid confusion.

8 years agolibdm: add enum based counter and metric calls
Bryn M. Reeves [Mon, 29 Feb 2016 17:33:16 +0000 (17:33 +0000)]
libdm: add enum based counter and metric calls

Add a new enum based interface for accessing counter and metric
values that uses a single function for each:

uint64_t dm_stats_get_counter(const struct dm_stats *dms,
                              dm_stats_counter_t counter
                              uint64_t region_id, uint64_t area_id);

int dm_stats_get_metric(const struct dm_stats *dms, int metric,
                        uint64_t region_id, uint64_t area_id,
                        double *value);

This simplifies the implementation of value aggregation for
groups of regions. The named function interface now calls the
enum interface internally so that all new functionality is
available regardless of the method used to retrieve values.

8 years agolibdm: cache dm name in stats handle
Bryn M. Reeves [Fri, 17 Jun 2016 11:17:33 +0000 (12:17 +0100)]
libdm: cache dm name in stats handle

Cache the device-mapper name of a bound device in the dm_stats
handle.

This will be used by stats groups to report a device name or
user defined alias for groups.

8 years agolibdm: rename dm_stats name, devno and uuid members
Bryn M. Reeves [Thu, 10 Mar 2016 16:51:02 +0000 (16:51 +0000)]
libdm: rename dm_stats name, devno and uuid members

The device-mapper name, device numbers and uuid stored in the
dm_stats handle are used only to bind the handle to a specific
device in order to issue ioctls.

Rename them to "bind_*" to reflect this usage in preparation
for caching the device-mapper name of the bound device in the
dm_stats handle.

This will be used to allow optional aliases to be set for
dmstats groups.

8 years agolibdm: add dm_bitset_parse_list()
Bryn M. Reeves [Thu, 18 Feb 2016 16:14:43 +0000 (16:14 +0000)]
libdm: add dm_bitset_parse_list()

Add a function to parse a list of integer values and ranges into
a dm_bitset representation. Individual values signify that that bit
is set in the resulting mask and ranges are given as a pair of
start and end values, M-N, such that M and N are the first and
last members of the range (inclusive).

The implementation is based on the kernel's __bitmap_parselist()
that is used for cpumasks and other set configuration passed in
string form from user space.

8 years agolibdm: fix histogram pool user-after-free (CWE-825)
Bryn M. Reeves [Mon, 4 Jul 2016 17:20:09 +0000 (18:20 +0100)]
libdm: fix histogram pool user-after-free (CWE-825)

8 years agovgsplit: fix moving RAID LVs to split off VG and check for LVs not to skip moving...
Heinz Mauelshagen [Tue, 5 Jul 2016 13:39:57 +0000 (15:39 +0200)]
vgsplit: fix moving RAID LVs to split off VG and check for LVs not to skip moving with other LV types

8 years agotests: using mkfs config file
Zdenek Kabelac [Mon, 4 Jul 2016 15:39:17 +0000 (17:39 +0200)]
tests: using  mkfs config file

Use more predictable local config when creating ext4.

8 years agotests: add line for mixing dmeventd with log
Zdenek Kabelac [Mon, 4 Jul 2016 15:32:58 +0000 (17:32 +0200)]
tests: add line for mixing dmeventd with log

TODO: it might be better to log dmeventd messages with test output
just like we do with clvmd - maybe we will switch to this one
instead of extra  DMEVENTD log file in future....

8 years agotests: add mke2fs.conf
Zdenek Kabelac [Mon, 4 Jul 2016 15:28:43 +0000 (17:28 +0200)]
tests: add mke2fs.conf

Add config for mkfs to get more predicatable results
when using mkfs across variety of distributions.

In future maybe use this per all tests as default.
For now user has to specify in a test MKE2FS_CONFIG envvar to use it.

8 years agotests: try to force remove higher minor first
Zdenek Kabelac [Mon, 4 Jul 2016 13:39:44 +0000 (15:39 +0200)]
tests: try to force remove higher minor first

When force removing thin-pool we loose 'real' access to hidden device,
and if such pool is in suspended state, any thin volume cannot be
dropped. It likely should be also checked by dmsetup, but meanwhile
apply simple logic -  try to force remove first all higher minors first
with assumption we first create thin-pool and then thin volume
and there are usually not being released lower dm numbers to
get the order wrong.

8 years agocleanup: drop unused header files
Zdenek Kabelac [Mon, 4 Jul 2016 13:37:31 +0000 (15:37 +0200)]
cleanup: drop unused header files

8 years agodmeventd: improved logged messages from thin plugin
Zdenek Kabelac [Mon, 4 Jul 2016 15:30:27 +0000 (17:30 +0200)]
dmeventd: improved logged messages from thin plugin

Show better names in logged messages.

8 years agodmsetup: fix timestamp leak
Bryn M. Reeves [Wed, 29 Jun 2016 09:14:57 +0000 (10:14 +0100)]
dmsetup: fix timestamp leak

With a single report (--count=1) no timerfd is set up and the cycle
and current timestamps should be freed during the single call to
_update_interval_times().

8 years agodmstats: fix RgStart and RgSize field widths
Bryn M. Reeves [Mon, 27 Jun 2016 11:41:58 +0000 (12:41 +0100)]
dmstats: fix RgStart and RgSize field widths

8 years agodocs: remove obsolete note from dmstats.8.in
Bryn M. Reeves [Sun, 19 Jun 2016 20:48:29 +0000 (21:48 +0100)]
docs: remove obsolete note from dmstats.8.in

8 years agoraid0: Add raid0_meta segment type.
Alasdair G Kergon [Fri, 1 Jul 2016 21:20:54 +0000 (22:20 +0100)]
raid0: Add raid0_meta segment type.

8 years agolvconvert: improve arg checks in new operation routing code
David Teigland [Fri, 1 Jul 2016 15:18:05 +0000 (10:18 -0500)]
lvconvert: improve arg checks in new operation routing code

Use defines for segment types, and test args directly
instead of indirectly.

8 years agotests: test foreign users of thin-pool
Zdenek Kabelac [Thu, 30 Jun 2016 14:21:03 +0000 (16:21 +0200)]
tests: test foreign users of thin-pool

Note: dmeventd should not need any notification and automatically
try to resize again when there is some metadata change.

8 years agocleanup: warns from older gcc
Zdenek Kabelac [Mon, 27 Jun 2016 09:13:43 +0000 (11:13 +0200)]
cleanup: warns from older gcc

8 years agocleanup: lvchange uses display_lvname
Zdenek Kabelac [Thu, 30 Jun 2016 08:45:58 +0000 (10:45 +0200)]
cleanup: lvchange uses display_lvname

Convert messages to report vg/lv name consistently.

Also drop unneeded 'info_obtaned' variable since the
obtained info is not reused in any code path.

8 years agocleanup: drop unused assignments
Zdenek Kabelac [Thu, 30 Jun 2016 08:45:52 +0000 (10:45 +0200)]
cleanup: drop unused assignments

In all code paths we set a value for these variables, so drop
their initial unused assign.

8 years agocleanup: add extra test for argc==0
Zdenek Kabelac [Thu, 30 Jun 2016 08:27:10 +0000 (10:27 +0200)]
cleanup: add extra test for argc==0

Cleaup some compiler warning about posibility to allocate 0 size.

8 years agothin: fix link validation for unused thin-pool
Zdenek Kabelac [Thu, 30 Jun 2016 13:54:27 +0000 (15:54 +0200)]
thin: fix link validation for unused thin-pool

This patch fixes link validation for used thin-pool.
Udev rules correctly creates symlinks only for unused new thin-pool.
Such thin-pool can be used by foreing apps (like Docker) thus
has  /dev/vg/lv link.
However when thin-pool becomes used by thinLV - this link is no
longer exposed to user - but internal verfication missed this
and caused messages like this to be printed upon 'vgchange -ay':

The link /dev/vg/pool should have been created by udev but it was not
found. Falling back to direct link creation.

And same with 'vgchange -an':
The link /dev/vg/pool should have been removed by udev but it is still
present. Falling back to direct link removal.

This patch ensures only unused thin-pool has this link.

8 years agodmeventd: thin plugin umount over 95%
Zdenek Kabelac [Wed, 29 Jun 2016 13:56:29 +0000 (15:56 +0200)]
dmeventd: thin plugin umount over 95%

Run umount code only when either thin data or metadata are
above 95% - so if there are resize failures with 60%.
system fill keep running.

Also umount will only be tried with lvm2 LVs.
Foreign users are ATM unsuppored.

8 years agolvconvert: add comments describing conversions
David Teigland [Thu, 30 Jun 2016 17:02:43 +0000 (12:02 -0500)]
lvconvert: add comments describing conversions

8 years agomacros: Use is_power_of_2.
Alasdair G Kergon [Thu, 30 Jun 2016 16:59:44 +0000 (17:59 +0100)]
macros: Use is_power_of_2.

8 years agolvconvert: add missing alias for a thin-pool conversion
David Teigland [Thu, 30 Jun 2016 15:09:54 +0000 (10:09 -0500)]
lvconvert: add missing alias for a thin-pool conversion

The case of converting a cache volume to a thin pool missed
recognizing the --thinpool alias for --type thin-pool.

8 years agolvconvert: remove unused code
David Teigland [Wed, 29 Jun 2016 21:59:32 +0000 (16:59 -0500)]
lvconvert: remove unused code

This code became unused with the previous commit 2282f5.

8 years agolvconvert: rework routing of operations
David Teigland [Tue, 28 Jun 2016 17:24:41 +0000 (12:24 -0500)]
lvconvert: rework routing of operations

Add new logic to identify each unique operation and route
it to the correct function to perform it.  The functions
that perform the conversions remain unchanged.

This new code checks every allowed combination of LV type
and requested operation, and for each valid combination
calls the function that performs that conversion.

The first stage of option validation which checks for
incompatible combinations of command line options, is done
done before process_each is called.  This is unchanged.
(This new code will allow that first stage validation to
be simplified in a future commit.)

The second stage of checking options against the specific
LV type is done by this new code.  For each valid combination
of operation + LV type, the new code calls an existing
function that implements it.

With this in place, the ad hoc checks for valid combinations
of LV types and operations can be removed from the existing
code in a future commit.

(The #if 0 is used to keep the patch clean, and the
disabled code will be removed by a following patch.)

8 years agolibdm: do not issue 'Failed to create directory' message for failure in dm_create_dir
Peter Rajnoha [Wed, 29 Jun 2016 13:58:14 +0000 (15:58 +0200)]
libdm: do not issue 'Failed to create directory' message for failure in dm_create_dir

There are detailed messages inside _create_dir_recursive that
dm_create_dir calls (except EROFS which where the message is not
generated, like anywhere else in the code).

8 years agolvconvert: Conversions between striped and raid0.
Alasdair G Kergon [Tue, 28 Jun 2016 22:44:15 +0000 (23:44 +0100)]
lvconvert: Conversions between striped and raid0.

8 years agolvmdbustest: Comment out refresh check for LV create
Tony Asleson [Tue, 28 Jun 2016 18:36:32 +0000 (13:36 -0500)]
lvmdbustest: Comment out refresh check for LV create

When we test Vg.LvCreateRaid some of the hidden LVs volume type go from
'I' to 'i' between the time it takes us to create the LV and
the time it takes to call into refresh to verify the service is up to date.
This is a fairly rare occurance.

8 years agolvmdbusd: Add --nojson command line option
Tony Asleson [Tue, 28 Jun 2016 18:32:39 +0000 (13:32 -0500)]
lvmdbusd: Add --nojson command line option

Add ability to not use the JSON output even if available.

8 years agolvmdbusd: Remove WARNING for 'lvm help'
Tony Asleson [Tue, 28 Jun 2016 17:52:31 +0000 (12:52 -0500)]
lvmdbusd: Remove WARNING for 'lvm help'

We call 'lvm help' to find out if fullreport is supported.  Lvm
dumps help to stderr.  Common code prints a warning if we exit
with 0, but have something in stderr so we are skipping the warning
message.

8 years agolvmdbusd: Remove unneeded comment
Tony Asleson [Tue, 28 Jun 2016 17:45:55 +0000 (12:45 -0500)]
lvmdbusd: Remove unneeded comment

8 years agolvmdbusd: Clean up ws
Tony Asleson [Tue, 28 Jun 2016 17:45:28 +0000 (12:45 -0500)]
lvmdbusd: Clean up ws

8 years agolvmdbusd: Remove unused imports and function parameter
Tony Asleson [Tue, 28 Jun 2016 17:44:45 +0000 (12:44 -0500)]
lvmdbusd: Remove unused imports and function parameter

8 years agolvmdbusd: Fix hang when lvm compiled with 'enable-notify-dbus'
Tony Asleson [Tue, 28 Jun 2016 17:07:21 +0000 (12:07 -0500)]
lvmdbusd: Fix hang when lvm compiled with 'enable-notify-dbus'

The following operations would hang if lvm was compiled with
'enable-notify-dbus' and the client specified -1 for the timeout:

* LV snapshot merge
* VG move
* LV move

This was caused because the implementation of these three dbus methods is
different.  Most of the dbus method calls are executed by gathering information
needed to fulfill it, placing that information on a thread safe queue and
returning.  The results later to be returned to the client with callbacks.
With this approach we can process an arbitrary number of commands without any
of them blocking other dbus commands.  However, the 3 dbus methods listed
above did not utilize this functionality because they were implemented with a
separate thread that handles the fork & exec of lvm.  This is done because these
operations can be very slow to complete.  However, because of this the lvm
command that we were waiting on is trying to call back into the dbus service to
notify it that something changed.  Because the code was blocking the process
that handles the incoming dbus activity the lvm command blocked.  We were stuck
until the client timed-out the connection, which then causes the service to
unblock and continue.  If the client did not have a timeout, we would have been
hung indefinitely.

The fix is to always utilize the worker queue on all dbus methods.  We need to
ensure that lvm is tested with 'enable-notify-dbus' enabled and disabled.

8 years agolvmdbusd: request.py, initialize _job to None
Tony Asleson [Tue, 28 Jun 2016 16:45:05 +0000 (11:45 -0500)]
lvmdbusd: request.py, initialize _job to None

_job is a job object, not a boolean so initialize it to None instead.

8 years agolvmdbusd: Correct pv_seg_start -> pvseg_start
Tony Asleson [Mon, 27 Jun 2016 22:07:20 +0000 (17:07 -0500)]
lvmdbusd: Correct pv_seg_start -> pvseg_start

Code was using the incorrect column names for pvseg_start which only
became apparent when utilizing the JSON.

8 years agolvmdbusd: Correct command line args for JSON
Tony Asleson [Mon, 27 Jun 2016 22:04:44 +0000 (17:04 -0500)]
lvmdbusd: Correct command line args for JSON

Use the updated syntax.

8 years agolvmdbusd: Remove sorting in db layer
Tony Asleson [Mon, 6 Jun 2016 20:08:20 +0000 (15:08 -0500)]
lvmdbusd: Remove sorting in db layer

When using the JSON this does not yield a totally sorted list as we don't
have a complete set of LVs, so remove this sort.

8 years agolvmdbusd: Add hidden in for json too
Tony Asleson [Fri, 3 Jun 2016 21:52:17 +0000 (16:52 -0500)]
lvmdbusd: Add hidden in for json too

8 years agolvmdbusd: Initial support for json output
Tony Asleson [Fri, 3 Jun 2016 18:18:21 +0000 (13:18 -0500)]
lvmdbusd: Initial support for json output

8 years agoraid: Infrastructure for raid takeover.
Alasdair G Kergon [Tue, 28 Jun 2016 01:42:30 +0000 (02:42 +0100)]
raid: Infrastructure for raid takeover.

8 years agolvmetad: two phase vg_remove
David Teigland [Wed, 8 Jun 2016 21:02:45 +0000 (16:02 -0500)]
lvmetad: two phase vg_remove

Apply the same idea as vg_update.
Before doing the VG remove on disk, invalidate
the VG in lvmetad.  After the VG is removed,
remove the VG in lvmetad.  If the command fails
after removing the VG on disk, but before removing
the VG metadata from lvmetad, then a subsequent
command will see the INVALID flag and not use the
stale metadata from lvmetad.

8 years agolvmetad: two phase vg_update
David Teigland [Wed, 8 Jun 2016 19:42:03 +0000 (14:42 -0500)]
lvmetad: two phase vg_update

Previously, a command sent lvmetad new VG metadata in vg_commit().
In vg_commit(), devices are suspended, so any memory allocation
done by the command while sending to lvmetad, or by lvmetad while
updating its cache could deadlock if memory reclaim was triggered.

Now lvmetad is updated in unlock_vg(), after devices are resumed.
The new method for updating VG metadata in lvmetad is in two phases:

1. In vg_write(), before devices are suspended, the command sends
   lvmetad a short message ("set_vg_info") telling it what the new
   VG seqno will be.  lvmetad sees that the seqno is newer than
   the seqno of its cached VG, so it sets the INVALID flag for the
   cached VG.  If sending the message to lvmetad fails, the command
   fails before the metadata is committed and the change is not made.
   If sending the message succeeds, vg_commit() is called.

2. In unlock_vg(), after devices are resumed, the command sends
   lvmetad the standard vg_update message with the new metadata.
   lvmetad sees that the seqno in the new metadata matches the
   seqno it saved from set_vg_info, and knows it has the latest
   copy, so it clears the INVALID flag for the cached VG.

If a command fails between 1 and 2 (after committing the VG on disk,
but before sending lvmetad the new metadata), the cached VG retains
the INVALID flag in lvmetad.  A subsequent command will read the
cached VG from lvmetad, see the INVALID flag, ignore the cached
copy, read the VG from disk instead, update the lvmetad copy
with the latest copy from disk, (this clears the INVALID flag
in lvmetad), and use the correct VG metadata for the command.

(This INVALID mechanism already existed for use by lvmlockd.)

8 years agolvmetad: remove unused code for other format types
David Teigland [Tue, 7 Jun 2016 21:09:45 +0000 (16:09 -0500)]
lvmetad: remove unused code for other format types

lvmetad is no longer used at all with the lvm1 format,
so the text format is the only one that uses lvmetad.

8 years agoWHATS_NEW: add recent changes
David Teigland [Mon, 27 Jun 2016 16:10:58 +0000 (11:10 -0500)]
WHATS_NEW: add recent changes

8 years agolvmlockd: fix coverity report
David Teigland [Mon, 27 Jun 2016 16:02:07 +0000 (11:02 -0500)]
lvmlockd: fix coverity report

8 years agolibdm: report: fix field width calculation when using dm_report_column_headings
Peter Rajnoha [Mon, 27 Jun 2016 12:27:43 +0000 (14:27 +0200)]
libdm: report: fix field width calculation when using dm_report_column_headings

This fixes commit 0ba5f4b8e977a6f2f45f95777da508b42d84c01a which moved
field recalculation (field width and sort position) from
dm_report_object to dm_report_output but it didn't handle the case when
dm_report_column_headings was used separately to report headings (before
dm_report_outpout call) and hence we ended up with intial widths for
fields in the headings.

If we're using dm_report_column_headings, we need to recalculate
fields if we haven't done so yet, the same way as we do in
dm_report_output.

8 years agoreporter: simplify --configreport handling for -S|--select and fix an issue reported...
Peter Rajnoha [Mon, 27 Jun 2016 08:14:17 +0000 (10:14 +0200)]
reporter: simplify --configreport handling for -S|--select and fix an issue reported by coverity

Simplify code around _do_get_report_selection - remove "expected_idxs[]"
argument which is superfluous and add "allow_single" switch instead to
allow for recognition of "--configreport <report_name> -S" as well as
single "-S" if needed.

Null pointer dereferences  (FORWARD_NULL) /safe/guest2/covscan/LVM2.2.02.158/tools/reporter.c: 961 in _do_report_get_selection()
Null pointer dereferences  (FORWARD_NULL) Dereferencing null pointer "single_args".

8 years agocoverity: fix issues detected in recent code
Peter Rajnoha [Mon, 27 Jun 2016 08:12:41 +0000 (10:12 +0200)]
coverity: fix issues detected in recent code

Uninitialized variables  (UNINIT) /safe/guest2/covscan/LVM2.2.02.158/tools/toollib.c: 3520 in _process_pvs_in_vgs()
Uninitialized variables  (UNINIT) Using uninitialized value "do_report_ret_code".

Null pointer dereferences  (REVERSE_INULL) /safe/guest2/covscan/LVM2.2.02.158/libdm/libdm-report.c: 4745 in dm_report_output()
Null pointer dereferences  (REVERSE_INULL) Null-checking "rh" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.

Incorrect expression  (MISSING_COMMA) /safe/guest2/covscan/LVM2.2.02.158/lib/log/log.c: 280 in _get_log_level_name()
Incorrect expression  (MISSING_COMMA) In the initialization of "log_level_names", a suspicious concatenated string ""noticeinfo"" is produced.

Null pointer dereferences  (FORWARD_NULL) /safe/guest2/covscan/LVM2.2.02.158/tools/reporter.c: 816 in_get_report_options()
Null pointer dereferences  (FORWARD_NULL) Comparing "mem" to null implies that "mem" might be null.

8 years agopost-release
Alasdair G Kergon [Sat, 25 Jun 2016 19:47:49 +0000 (20:47 +0100)]
post-release

8 years agopre-release v2_02_158
Alasdair G Kergon [Sat, 25 Jun 2016 19:35:14 +0000 (20:35 +0100)]
pre-release

8 years agodoc: Resync kernel docs.
Alasdair G Kergon [Sat, 25 Jun 2016 18:59:49 +0000 (19:59 +0100)]
doc: Resync kernel docs.

8 years agoman: lvs: move doc about --all so it's ordered alphabetically in the man page
Peter Rajnoha [Fri, 24 Jun 2016 12:56:43 +0000 (14:56 +0200)]
man: lvs: move doc about --all so it's ordered alphabetically in the man page

8 years agoman: document --configreport, --logonly, --reportformat
Peter Rajnoha [Fri, 24 Jun 2016 12:51:20 +0000 (14:51 +0200)]
man: document --configreport, --logonly, --reportformat

8 years agocommands: help: add missing --reportformat references
Peter Rajnoha [Fri, 24 Jun 2016 12:49:13 +0000 (14:49 +0200)]
commands: help: add missing --reportformat references

8 years agocommands: fix typo in arg assignment
Peter Rajnoha [Fri, 24 Jun 2016 09:10:10 +0000 (11:10 +0200)]
commands: fix typo in arg assignment

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