master - pre-release
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8ca874bc1f958c...
Commit: 8ca874bc1f958cc2138bf13cbed492de5daff0c3
Parent: bf1dfea393b5372b6fe058458c2fc25188e8181b
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: Wed Jul 6 16:55:44 2016 +0100
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: Wed Jul 6 16:55:44 2016 +0100
pre-release
---
WHATS_NEW | 3 ++-
WHATS_NEW_DM | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index f9b1426..3780a41 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
-Version 2.02.160 -
+Version 2.02.160 - 6th July 2016
================================
+ Minor fixes from coverity.
Version 2.02.159 - 6th July 2016
================================
diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM
index ed79720..de24fc1 100644
--- a/WHATS_NEW_DM
+++ b/WHATS_NEW_DM
@@ -1,5 +1,6 @@
-Version 1.02.130 -
+Version 1.02.130 - 6th July 2016
================================
+ Minor fixes from coverity.
Version 1.02.129 - 6th July 2016
================================
7 years, 10 months
master - libdm: check for empty aux_data in _parse_aux_data_group()
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bf1dfea393b537...
Commit: bf1dfea393b5372b6fe058458c2fc25188e8181b
Parent: c1a66d4fc6cd2224e3bf1f2cd08f4ee89b4ea920
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Jul 6 16:29:06 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 16:31:30 2016 +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.
---
libdm/libdm-stats.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 12c821f..e979b34 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -692,7 +692,7 @@ static int _parse_aux_data_group(struct dm_stats *dms,
}
/* separate group tag from user aux_data */
- if (strlen(end))
+ if ((strlen(end) > 1) || strncmp(end, "-", 1))
c = dm_strdup(end);
else
c = dm_strdup("");
7 years, 10 months
master - libdm: use log_err_once() for group histogram message
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a497b95db15a24...
Commit: a497b95db15a24c82f29fd8b00de5fbd1e56b1c5
Parent: 28658541daef567f0f767190c244a100ea45476f
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Jul 6 11:16:12 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 11:16:12 2016 +0100
libdm: use log_err_once() for group histogram message
---
libdm/libdm-stats.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 06aa645..12c821f 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -3179,7 +3179,7 @@ struct dm_histogram *dm_stats_get_histogram(const struct dm_stats *dms,
/* FIXME return histogram sum? Requires bounds check at group time */
if (region_id & DM_STATS_WALK_GROUP) {
- log_warn("Group histogram data is not supported");
+ log_err_once("Group histogram data is not supported");
return NULL;
}
7 years, 10 months
master - dmstats: simplify nr_areas calculation (CWE-561)
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=1faa208067df29...
Commit: 1faa208067df2989c716fff40568f3948392b186
Parent: 21b946dfb75c893827ce5caafd16cb09be4fbeeb
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Mon Jul 4 19:25:40 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 09:59:45 2016 +0100
dmstats: simplify nr_areas calculation (CWE-561)
Eliminate dead conditional (step cannot be zero).
Fixes commit 988ca74.
---
tools/dmsetup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 4d9bb07..b675625 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -4745,7 +4745,7 @@ static uint64_t _nr_areas_from_step(uint64_t len, int64_t step)
return (uint64_t)(-step);
/* --areasize - cast step to unsigned as it cannot be -ve here. */
- return (len / (step ? : len)) + !!(len % (uint64_t) step);
+ return (len / step) + !!(len % (uint64_t) step);
}
/*
7 years, 10 months
master - dmstats: fix 'obj_type' field width
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=21b946dfb75c89...
Commit: 21b946dfb75c893827ce5caafd16cb09be4fbeeb
Parent: 95ef0cdb461dfb7b7e6ac8e2484564fe0b5ec0ed
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Jul 6 09:37:59 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 09:37:59 2016 +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.
---
tools/dmsetup.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index ed03c2b..4d9bb07 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -4286,7 +4286,7 @@ FIELD_F(STATS_META, STR, "#Bins", 9, dm_stats_hist_bins, "hist_bins", "The numbe
FIELD_F(STATS_META, STR, "Histogram Bounds", 16, dm_stats_hist_bounds, "hist_bounds", "Latency histogram bin boundaries.")
FIELD_F(STATS_META, STR, "Histogram Ranges", 16, dm_stats_hist_ranges, "hist_ranges", "Latency histogram bin ranges.")
FIELD_F(STATS_META, STR, "Name", 16, dm_stats_name, "stats_name", "Stats name of current object.")
-FIELD_F(STATS_META, STR, "ObjType", 11, dm_stats_object_type, "obj_type", "Type of stats object being reported.")
+FIELD_F(STATS_META, STR, "ObjType", 7, dm_stats_object_type, "obj_type", "Type of stats object being reported.")
{0, 0, 0, 0, "", "", NULL, NULL},
/* *INDENT-ON* */
};
7 years, 10 months
master - libdm: check non-zero io count in _average_{rd, wr}_wait_time (Coverity)
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=95ef0cdb461dfb...
Commit: 95ef0cdb461dfb7b7e6ac8e2484564fe0b5ec0ed
Parent: 03e03e9c11f5731c225d6cb99a1f36d4d8b699f6
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Jul 6 09:20:05 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 09:23:13 2016 +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.
---
libdm/libdm-stats.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index c0ef38f..c669b51 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -2600,11 +2600,15 @@ static int _average_rd_wait_time(const struct dm_stats *dms, double *await,
rd_io_ticks = dm_stats_get_counter(dms, DM_STATS_READ_NSECS,
region_id, area_id);
-
nr_rd_ios = dm_stats_get_counter(dms, DM_STATS_READS_COUNT,
region_id, area_id);
- if (rd_io_ticks > 0)
+ /*
+ * If rd_io_ticks is > 0 this should imply that nr_rd_ios is
+ * also > 0 (unless a kernel bug exists). Test for both here
+ * before using the IO count as a divisor (Coverity).
+ */
+ if (rd_io_ticks > 0 && nr_rd_ios > 0)
*await = (double) rd_io_ticks / (double) nr_rd_ios;
else
*await = 0.0;
@@ -2622,7 +2626,12 @@ static int _average_wr_wait_time(const struct dm_stats *dms, double *await,
nr_wr_ios = dm_stats_get_counter(dms, DM_STATS_WRITES_COUNT,
region_id, area_id);
- if (wr_io_ticks > 0)
+ /*
+ * If wr_io_ticks is > 0 this should imply that nr_wr_ios is
+ * also > 0 (unless a kernel bug exists). Test for both here
+ * before using the IO count as a divisor (Coverity).
+ */
+ if (wr_io_ticks > 0 && nr_wr_ios > 0)
*await = (double) wr_io_ticks / (double) nr_wr_ios;
else
*await = 0.0;
7 years, 10 months
master - libdm: test for zero interval_ns in _utilization() (Coverity)
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=03e03e9c11f573...
Commit: 03e03e9c11f5731c225d6cb99a1f36d4d8b699f6
Parent: 5d3b136d38db40a6d26b8a09e7a4b504fa2f85d1
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Jul 6 09:12:51 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 09:14:43 2016 +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.
---
libdm/libdm-stats.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 057bbcc..c0ef38f 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -2656,10 +2656,19 @@ static int _utilization(const struct dm_stats *dms, double *util,
* for the last interval; do not allow a value > 100% utilization
* to be passed to a dm_make_percent() call. We expect to see these
* at startup if counters have not been cleared before the first read.
+ *
+ * A zero interval_ns is also an error since metrics cannot be
+ * calculated without a defined interval - return zero and emit a
+ * backtrace in this case.
*/
io_nsecs = dm_stats_get_counter(dms, DM_STATS_IO_NSECS,
region_id, area_id);
+ if (!interval_ns) {
+ *util = 0.0;
+ return_0;
+ }
+
io_nsecs = ((io_nsecs < interval_ns) ? io_nsecs : interval_ns);
*util = (double) io_nsecs / (double) interval_ns;
7 years, 10 months
master - libdm: restore missing braces in _stats_walk_end_areas
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5d3b136d38db40...
Commit: 5d3b136d38db40a6d26b8a09e7a4b504fa2f85d1
Parent: 69c721dd68a6ac517d7962f927f3f59f9e05d9c4
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Jul 6 09:04:13 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 09:04:13 2016 +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.
---
libdm/libdm-stats.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 07503a5..057bbcc 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -1479,11 +1479,12 @@ static void _stats_walk_end_areas(const struct dm_stats *dms, uint64_t *flags,
*cur_a = DM_STATS_WALK_REGION;
*cur_r = DM_STATS_REGION_NOT_PRESENT;
_stats_walk_next_present(dms, flags, cur_r, cur_a, cur_g);
- if (!_stats_walk_any_unskipped(dms, flags, cur_r, cur_a))
+ if (!_stats_walk_any_unskipped(dms, flags, cur_r, cur_a)) {
/* no more regions */
*flags &= ~DM_STATS_WALK_REGION;
if (!(*flags & DM_STATS_WALK_GROUP))
*cur_r = dms->max_region;
+ }
}
if (*flags & DM_STATS_WALK_REGION)
7 years, 10 months
master - libdm: fix mask leak in dm_bitset_parse_list
by Bryn Reeves
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=69c721dd68a6ac...
Commit: 69c721dd68a6ac517d7962f927f3f59f9e05d9c4
Parent: fb0a67141928dc62279ba1c8ab137c527f82a393
Author: Bryn M. Reeves <bmr(a)redhat.com>
AuthorDate: Wed Jul 6 08:59:09 2016 +0100
Committer: Bryn M. Reeves <bmr(a)redhat.com>
CommitterDate: Wed Jul 6 08:59:09 2016 +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.
---
libdm/datastruct/bitset.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libdm/datastruct/bitset.c b/libdm/datastruct/bitset.c
index 2f84ea4..3fd6a9c 100644
--- a/libdm/datastruct/bitset.c
+++ b/libdm/datastruct/bitset.c
@@ -153,7 +153,7 @@ scan:
if (c == '-') {
if (at_start || in_range)
- return_0;
+ goto_bad;
b = 0;
in_range = 1;
at_start = 1;
7 years, 10 months
v2_02_159 annotated tag has been created
by Alasdair Kergon
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=fb619c70699218...
Commit: fb619c70699218ca148890f904e53d5f2754f692
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-07-06 00:00 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-07-06 00:00 +0000
annotated tag: v2_02_159 has been created
at fb619c70699218ca148890f904e53d5f2754f692 (tag)
tagging 6022715c817953e48cfcec127e95f51a0b843ad3 (commit)
replaces v2_02_158
Release 2.02.159.
This release defines groups to facilitate the aggregation of dm
statistics, introduces a new raid0_meta segment type in preparation for
future conversions between raid types, and improves and fixes parts
of lvconvert and vgsplit.
82 files changed, 6573 insertions(+), 1253 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAld8S1sACgkQIoGRwVZ+LBePEgCeJLLRg6M1YhkoRVrzFgKE+8Ct
EigAoMgyOYxyofmg/rmgCWHbTGjPf/xn
=rfYC
-----END PGP SIGNATURE-----
Alasdair G Kergon (7):
post-release
raid: Infrastructure for raid takeover.
lvconvert: Conversions between striped and raid0.
macros: Use is_power_of_2.
raid0: Add raid0_meta segment type.
vgsplit: Don't skip moving internal snapshot LV.
pre-release
Bryn M. Reeves (40):
docs: remove obsolete note from dmstats.8.in
dmstats: fix RgStart and RgSize field widths
dmsetup: fix timestamp leak
libdm: fix histogram pool user-after-free (CWE-825)
libdm: add dm_bitset_parse_list()
libdm: rename dm_stats name, devno and uuid members
libdm: cache dm name in stats handle
libdm: add enum based counter and metric calls
libdm: rename 'region' to 'skip_region' in _stats_walk_next
libdm: add statistics groups
libdm: use defined constants for buffer sizes
libdm: add stats group and region iterators and properties
libdm: allow deleting regions with dm_stats_delete_group()
dmstats: add group_id report field type
dmstats: add 'group' and 'ungroup' commands
dmstats: add group alias support
dmstats: add stats_name field
dmstats: do not walk regions if deleting a single id
dmstats: report groups and region summaries
dmstats: report a list of members as a group's region_id
dmstats: allow --statstype to override report defults
dmstats: accept --groupid for 'dmstats delete'
dmstats: fix region deletion message
doc: update dmstats.8.in for groups
dmstats: convert 'clear' to dm_stats_foreach_region()
dmstats: convert 'print' to dm_stats_foreach_region()
dmstats: convert 'delete' to dm_stats_foreach_region()
dmstats: use 'statsname' and 'groupid' in default fields
dmstats: rename 'type' field to 'obj_type'
dmstats: add 'statsname' and 'obj_type' to default stats fields
dmstats: replace --statstype with separate object switches
libdm: clarify library's use of aux_data
dmstats: rename 'aux_data' to 'user_data'
dmstats: rename --auxdata to --userdata
libdm: fix <backtrace> in dm_stats_get_nr_regions
libdm: fix <backtrace> in dm_stats_populate
dmstats: fix <backtrace> in _display_info_cols()
doc: document --area, --region, and --group in dmstats.8.in
libdm: ensure flags constants have ULL suffix
libdm: cast walk flags to uint64_t when logging.
David Teigland (10):
lvmlockd: fix coverity report
WHATS_NEW: add recent changes
lvmetad: remove unused code for other format types
lvmetad: two phase vg_update
lvmetad: two phase vg_remove
lvconvert: rework routing of operations
lvconvert: remove unused code
lvconvert: add missing alias for a thin-pool conversion
lvconvert: add comments describing conversions
lvconvert: improve arg checks in new operation routing code
Heinz Mauelshagen (1):
vgsplit: fix moving RAID LVs to split off VG and check for LVs not to skip moving with other LV types
Peter Rajnoha (4):
coverity: fix issues detected in recent code
reporter: simplify --configreport handling for -S|--select and fix an issue reported by coverity
libdm: report: fix field width calculation when using dm_report_column_headings
libdm: do not issue 'Failed to create directory' message for failure in dm_create_dir
Tony Asleson (13):
lvmdbusd: Initial support for json output
lvmdbusd: Add hidden in for json too
lvmdbusd: Remove sorting in db layer
lvmdbusd: Correct command line args for JSON
lvmdbusd: Correct pv_seg_start -> pvseg_start
lvmdbusd: request.py, initialize _job to None
lvmdbusd: Fix hang when lvm compiled with 'enable-notify-dbus'
lvmdbusd: Remove unused imports and function parameter
lvmdbusd: Clean up ws
lvmdbusd: Remove unneeded comment
lvmdbusd: Remove WARNING for 'lvm help'
lvmdbusd: Add --nojson command line option
lvmdbustest: Comment out refresh check for LV create
Zdenek Kabelac (13):
dmeventd: thin plugin umount over 95%
thin: fix link validation for unused thin-pool
cleanup: add extra test for argc==0
cleanup: drop unused assignments
cleanup: lvchange uses display_lvname
cleanup: warns from older gcc
tests: test foreign users of thin-pool
dmeventd: improved logged messages from thin plugin
cleanup: drop unused header files
tests: try to force remove higher minor first
tests: add mke2fs.conf
tests: add line for mixing dmeventd with log
tests: using mkfs config file
7 years, 10 months