From f30b2134bbad031482a7a5abc8a82dbf17bfee79 Mon Sep 17 00:00:00 2001 From: basebuilder_pel7ppc64bebuilder0 Date: Sun, 3 Jun 2018 10:30:48 +0200 Subject: [PATCH] lvm2 package update Signed-off-by: basebuilder_pel7ppc64bebuilder0 --- ...-stripesize-when-creating-cache-pool.patch | 38 + SOURCES/lvm2-2_02_131-dmstats-fixups.patch | 521 +++ ...ool-when-activating-without-messages.patch | 29 + ...re-while-scanning-the-vg-for-lvmetad.patch | 28 + ...ix-vgimportclone-cache_dir-path-name.patch | 37 + ...stent-cache-if-configuration-changed.patch | 49 + ...vm2-2_02_131-standardise-error-paths.patch | 2169 +++++++++ ...identifiers-handles-more-complex-lvs.patch | 66 + ...n-thin-pool-before-creating-new-thin.patch | 51 + ...writethrough-mode-for-cleaner-policy.patch | 30 + ...-of-full-thin-pool-causing-data-loss.patch | 204 + ...ng-processing-during-auto-activation.patch | 74 + ...vices-if-scanning-for-lvmetad-update.patch | 37 + ...2_155-fix-flushing-for-mirror-target.patch | 77 + ...rt-of-thin-pool-to-raid-while-active.patch | 32 + ...onvert-repair-for-cache-raid-volumes.patch | 27 + ...167-fix-raid4-coversion-from-striped.patch | 532 +++ ...conversion-on-non-supporting-kernels.patch | 303 ++ ...d-add-mutex-protection-for-cpg_-call.patch | 49 + ...-missing-null-in-daemon_reply_simple.patch | 50 + ...-2_02_169-lvcreate-fix-striped-limit.patch | 34 + ...ult-allow-changes-with-duplicate-pvs.patch | 30 + ...BLKS_BADCSUM-for-signature-detection.patch | 104 + ...for-dm_tree_node_size_changed-symbol.patch | 21 + .../lvm2-lvmlockd-tech-preview-warning.patch | 27 + ...path-device-handling-from-udev-rules.patch | 18 + ...ix-for-lvconvert-repair-for-raid-lvs.patch | 323 ++ SOURCES/lvm2-rhel7.patch | 18 + .../lvm2-set-default-preferred_names.patch | 30 + SPECS/lvm2.spec | 3989 +++++++++++++++++ 30 files changed, 8997 insertions(+) create mode 100755 SOURCES/lvm2-2_02_131-disallow-usage-of-stripe-and-stripesize-when-creating-cache-pool.patch create mode 100755 SOURCES/lvm2-2_02_131-dmstats-fixups.patch create mode 100755 SOURCES/lvm2-2_02_131-do-not-check-for-full-thin-pool-when-activating-without-messages.patch create mode 100755 SOURCES/lvm2-2_02_131-fix-vg-metadata-comparison-failure-while-scanning-the-vg-for-lvmetad.patch create mode 100755 SOURCES/lvm2-2_02_131-fix-vgimportclone-cache_dir-path-name.patch create mode 100755 SOURCES/lvm2-2_02_131-ignore-persistent-cache-if-configuration-changed.patch create mode 100755 SOURCES/lvm2-2_02_131-standardise-error-paths.patch create mode 100755 SOURCES/lvm2-2_02_131-swapping-of-lv-identifiers-handles-more-complex-lvs.patch create mode 100755 SOURCES/lvm2-2_02_133-check-for-space-in-thin-pool-before-creating-new-thin.patch create mode 100755 SOURCES/lvm2-2_02_133-enforce-writethrough-mode-for-cleaner-policy.patch create mode 100755 SOURCES/lvm2-2_02_135-fix-resize-of-full-thin-pool-causing-data-loss.patch create mode 100755 SOURCES/lvm2-2_02_140-restore-background-polling-processing-during-auto-activation.patch create mode 100755 SOURCES/lvm2-2_02_142-do-not-check-for-suspended-devices-if-scanning-for-lvmetad-update.patch create mode 100755 SOURCES/lvm2-2_02_155-fix-flushing-for-mirror-target.patch create mode 100644 SOURCES/lvm2-2_02_167-disable-lvconvert-of-thin-pool-to-raid-while-active.patch create mode 100644 SOURCES/lvm2-2_02_167-fix-inability-of-lvconvert-repair-for-cache-raid-volumes.patch create mode 100644 SOURCES/lvm2-2_02_167-fix-raid4-coversion-from-striped.patch create mode 100644 SOURCES/lvm2-2_02_167-prevent-raid4-creation-and-conversion-on-non-supporting-kernels.patch create mode 100644 SOURCES/lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch create mode 100644 SOURCES/lvm2-2_02_169-fix-segfault-in-lvmetad-from-missing-null-in-daemon_reply_simple.patch create mode 100644 SOURCES/lvm2-2_02_169-lvcreate-fix-striped-limit.patch create mode 100644 SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch create mode 100644 SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch create mode 100644 SOURCES/lvm2-fix-libdm-versioning-for-dm_tree_node_size_changed-symbol.patch create mode 100755 SOURCES/lvm2-lvmlockd-tech-preview-warning.patch create mode 100755 SOURCES/lvm2-remove-mpath-device-handling-from-udev-rules.patch create mode 100644 SOURCES/lvm2-revert-fix-for-lvconvert-repair-for-raid-lvs.patch create mode 100644 SOURCES/lvm2-rhel7.patch create mode 100644 SOURCES/lvm2-set-default-preferred_names.patch create mode 100644 SPECS/lvm2.spec diff --git a/SOURCES/lvm2-2_02_131-disallow-usage-of-stripe-and-stripesize-when-creating-cache-pool.patch b/SOURCES/lvm2-2_02_131-disallow-usage-of-stripe-and-stripesize-when-creating-cache-pool.patch new file mode 100755 index 00000000..6dcfefd5 --- /dev/null +++ b/SOURCES/lvm2-2_02_131-disallow-usage-of-stripe-and-stripesize-when-creating-cache-pool.patch @@ -0,0 +1,38 @@ + WHATS_NEW | 1 + + tools/lvcreate.c | 5 ++++- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 5260321..1147dad 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.131 - + ===================================== ++ Disallow usage of --stripe and --stripesize when creating cache pool. + Swapping of LV identifiers handles more complex LVs. + Fix VG metadata comparison failure while scanning the VG for lvmetad. + Ignore persistent cache if configuration changed. (2.02.127) +diff --git a/tools/lvcreate.c b/tools/lvcreate.c +index 364a16a..7bba761 100644 +--- a/tools/lvcreate.c ++++ b/tools/lvcreate.c +@@ -770,7 +770,8 @@ static int _lvcreate_params(struct cmd_context *cmd, + CACHE_POOL_ARGS, + LVCREATE_ARGS, + POOL_ARGS, +- SIZE_ARGS, ++ extents_ARG, ++ size_ARG, + cache_ARG, + chunksize_ARG, + -1)) +@@ -1096,6 +1097,8 @@ static int _determine_cache_argument(struct volume_group *vg, + } + /* FIXME How to handle skip flag? */ + if (arg_from_list_is_set(cmd, "is unsupported with cache conversion", ++ stripes_ARG, ++ stripesize_ARG, + setactivationskip_ARG, + ignoreactivationskip_ARG, + -1)) diff --git a/SOURCES/lvm2-2_02_131-dmstats-fixups.patch b/SOURCES/lvm2-2_02_131-dmstats-fixups.patch new file mode 100755 index 00000000..be12a797 --- /dev/null +++ b/SOURCES/lvm2-2_02_131-dmstats-fixups.patch @@ -0,0 +1,521 @@ + libdm/libdm-stats.c | 223 ++++++++++++++++++++++++++++++---------------------- + tools/dmsetup.c | 1 + + 2 files changed, 131 insertions(+), 93 deletions(-) + +diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c +index 93c7760..ee62fe6 100644 +--- a/libdm/libdm-stats.c ++++ b/libdm/libdm-stats.c +@@ -144,17 +144,24 @@ struct dm_stats *dm_stats_create(const char *program_id) + return_NULL; + + /* FIXME: better hint. */ +- if (!(dms->mem = dm_pool_create("stats_pool", 4096))) +- goto_bad; ++ if (!(dms->mem = dm_pool_create("stats_pool", 4096))) { ++ dm_free(dms); ++ return_NULL; ++ } + + if (!(dms->hist_mem = dm_pool_create("histogram_pool", hist_hint))) +- return_0; ++ goto_bad; + + if (!program_id || !strlen(program_id)) + dms->program_id = _program_id_from_proc(); + else + dms->program_id = dm_strdup(program_id); + ++ if (!dms->program_id) { ++ dm_pool_destroy(dms->hist_mem); ++ goto_bad; ++ } ++ + dms->major = -1; + dms->minor = -1; + dms->name = NULL; +@@ -171,6 +178,7 @@ struct dm_stats *dm_stats_create(const char *program_id) + return dms; + + bad: ++ dm_pool_destroy(dms->mem); + dm_free(dms); + return NULL; + } +@@ -186,15 +194,15 @@ static int _stats_region_present(const struct dm_stats_region *region) + static void _stats_histograms_destroy(struct dm_pool *mem, + struct dm_stats_region *region) + { +- uint64_t n; +- + /* Unpopulated handle. */ + if (!region->counters) + return; + +- for (n = _nr_areas_region(region) - 1; n; n--) +- if (region->counters[n].histogram) +- dm_pool_free(mem, region->counters[n].histogram); ++ /* ++ * Only the first histogram needs to be freed explicitly. ++ */ ++ if (region->counters[0].histogram) ++ dm_pool_free(mem, region->counters[0].histogram); + } + + static void _stats_region_destroy(struct dm_stats_region *region) +@@ -316,11 +324,54 @@ int dm_stats_driver_supports_histogram(void) + return _stats_check_precise_timestamps(NULL); + } + ++static int _fill_hist_arg(char *hist_arg, size_t hist_len, uint64_t scale, ++ struct dm_histogram *bounds) ++{ ++ int i, l, len = 0, nr_bins; ++ char *arg = hist_arg; ++ uint64_t value; ++ ++ nr_bins = bounds->nr_bins; ++ ++ for (i = 0; i < nr_bins; i++) { ++ value = bounds->bins[i].upper / scale; ++ if ((l = dm_snprintf(arg, hist_len - len, FMTu64"%s", value, ++ (i == (nr_bins - 1)) ? "" : ",")) < 0) ++ return_0; ++ len += l; ++ arg += l; ++ } ++ return 1; ++} ++ ++static void *_get_hist_arg(struct dm_histogram *bounds, uint64_t scale, ++ size_t *len) ++{ ++ struct dm_histogram_bin *entry, *bins; ++ size_t hist_len = 1; /* terminating '\0' */ ++ double value; ++ ++ entry = bins = bounds->bins; ++ ++ entry += bounds->nr_bins - 1; ++ while(entry >= bins) { ++ value = (double) (entry--)->upper; ++ /* Use lround to avoid size_t -> double cast warning. */ ++ hist_len += 1 + (size_t) lround(log10(value / scale)); ++ if (entry != bins) ++ hist_len++; /* ',' */ ++ } ++ ++ *len = hist_len; ++ ++ return dm_zalloc(hist_len); ++} ++ + static char *_build_histogram_arg(struct dm_histogram *bounds, int *precise) + { + struct dm_histogram_bin *entry, *bins; +- size_t hist_len = 1, len = 0; +- char *hist_arg, *arg = NULL; ++ size_t hist_len; ++ char *hist_arg; + uint64_t scale; + + entry = bins = bounds->bins; +@@ -331,53 +382,37 @@ static char *_build_histogram_arg(struct dm_histogram *bounds, int *precise) + return NULL; + } + ++ /* Validate entries and set *precise if precision < 1ms. */ + entry += bounds->nr_bins - 1; +- while(entry >= bins) { +- double value; ++ while (entry >= bins) { + if (entry != bins) { + if (entry->upper < (entry - 1)->upper) { + log_error("Histogram boundaries must be in " + "order of increasing magnitude."); + return 0; + } +- hist_len++; /* ',' */ + } + + /* + * Only enable precise_timestamps automatically if any + * value in the histogram bounds uses precision < 1ms. + */ +- if (!*precise && (entry->upper % NSEC_PER_MSEC)) ++ if (((entry--)->upper % NSEC_PER_MSEC) && !*precise) + *precise = 1; +- +- value = (double) (entry--)->upper; +- /* Use lround to avoid size_t -> double cast warning. */ +- hist_len += 1 + (size_t) lround(log10(value)); + } + +- if (!(hist_arg = dm_zalloc(hist_len))) { ++ scale = (*precise) ? 1 : NSEC_PER_MSEC; ++ ++ /* Calculate hist_len and allocate a character buffer. */ ++ if (!(hist_arg = _get_hist_arg(bounds, scale, &hist_len))) { + log_error("Could not allocate memory for histogram argument."); + return 0; + } + +- arg = hist_arg; +- +- if (*precise) +- scale = 1; +- else +- scale = (*precise) ? 1 : NSEC_PER_MSEC; ++ /* Fill hist_arg with boundary strings. */ ++ if (!_fill_hist_arg(hist_arg, hist_len, scale, bounds)) ++ goto_bad; + +- for (entry = bins; entry < (bins + bounds->nr_bins); entry++) { +- uint64_t value; +- ssize_t l = 0; +- int last = !(entry < (bins + bounds->nr_bins - 1)); +- value = entry->upper / scale; +- if ((l = dm_snprintf(arg, hist_len - len, FMTu64"%s", value, +- (last) ? "" : ",")) < 0) +- goto_bad; +- len += (size_t) l; +- arg += (size_t) l; +- } + return hist_arg; + + bad: +@@ -419,13 +454,13 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + const char *histogram) + { + static const char *_valid_chars = "0123456789,"; +- uint64_t scale = region->timescale; ++ uint64_t scale = region->timescale, this_val = 0; + struct dm_pool *mem = dms->hist_mem; + struct dm_histogram_bin cur; + struct dm_histogram hist; + int nr_bins = 1; +- const char *c, *v; +- char *p; ++ const char *c, *v, *val_start; ++ char *p, *endptr = NULL; + + /* Advance past "histogram:". */ + histogram = strchr(histogram, ':'); +@@ -466,9 +501,8 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + histogram); + goto bad; + } else { +- const char *val_start = c; +- char *endptr = NULL; +- uint64_t this_val = 0; ++ val_start = c; ++ endptr = NULL; + + this_val = strtoull(val_start, &endptr, 10); + if (!endptr) { +@@ -592,11 +626,11 @@ static int _stats_parse_list_region(struct dm_stats *dms, + + static int _stats_parse_list(struct dm_stats *dms, const char *resp) + { +- struct dm_pool *mem = dms->mem; +- struct dm_stats_region cur; + uint64_t max_region = 0, nr_regions = 0; ++ struct dm_stats_region cur, fill; ++ struct dm_pool *mem = dms->mem; + FILE *list_rows; +- /* FIXME: determine correct maximum line length based on kernel format */ ++ /* FIXME: use correct maximum line length for kernel format */ + char line[256]; + + if (!resp) { +@@ -631,7 +665,6 @@ static int _stats_parse_list(struct dm_stats *dms, const char *resp) + + /* handle holes in the list of region_ids */ + if (cur.region_id > max_region) { +- struct dm_stats_region fill; + memset(&fill, 0, sizeof(fill)); + fill.region_id = DM_STATS_REGION_NOT_PRESENT; + do { +@@ -707,54 +740,51 @@ static int _stats_parse_histogram(struct dm_pool *mem, char *hist_str, + struct dm_histogram **histogram, + struct dm_stats_region *region) + { ++ struct dm_histogram hist, *bounds = region->bounds; + static const char *_valid_chars = "0123456789:"; + int nr_bins = region->bounds->nr_bins; +- struct dm_histogram hist, *bounds = region->bounds; ++ const char *c, *v, *val_start; + struct dm_histogram_bin cur; +- uint64_t sum = 0; +- const char *c, *v; ++ uint64_t sum = 0, this_val; ++ char *endptr = NULL; + int bin = 0; + + c = hist_str; + +- dm_pool_begin_object(mem, sizeof(cur)); ++ if (!dm_pool_begin_object(mem, sizeof(cur))) ++ return_0; + + hist.nr_bins = nr_bins; + +- dm_pool_grow_object(mem, &hist, sizeof(hist)); ++ if (!dm_pool_grow_object(mem, &hist, sizeof(hist))) ++ goto_bad; + + do { + memset(&cur, 0, sizeof(cur)); + for (v = _valid_chars; *v; v++) + if (*c == *v) + break; +- if (!*v) { +- stack; ++ if (!*v) + goto badchar; +- } + +- if (*c == ',') { +- log_error("Invalid histogram: %s", hist_str); +- return 0; +- } else { +- const char *val_start = c; +- char *endptr = NULL; +- uint64_t this_val = 0; ++ if (*c == ',') ++ goto badchar; ++ else { ++ val_start = c; ++ endptr = NULL; + + this_val = strtoull(val_start, &endptr, 10); + if (!endptr) { + log_error("Could not parse histogram value."); +- return 0; ++ goto bad; + } + c = endptr; /* Advance to colon, or end. */ + + if (*c == ':') + c++; +- else if (*c & (*c != '\n')) { ++ else if (*c & (*c != '\n')) + /* Expected ':', '\n', or NULL. */ +- stack; + goto badchar; +- } + + if (*c == ':') + c++; +@@ -763,7 +793,8 @@ static int _stats_parse_histogram(struct dm_pool *mem, char *hist_str, + cur.count = this_val; + sum += this_val; + +- dm_pool_grow_object(mem, &cur, sizeof(cur)); ++ if (!dm_pool_grow_object(mem, &cur, sizeof(cur))) ++ goto_bad; + + bin++; + } +@@ -778,6 +809,8 @@ static int _stats_parse_histogram(struct dm_pool *mem, char *hist_str, + + badchar: + log_error("Invalid character in histogram data: '%c' (0x%x)", *c, *c); ++bad: ++ dm_pool_abandon_object(mem); + return 0; + } + +@@ -786,8 +819,8 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, + uint64_t timescale) + { + struct dm_histogram *hist = NULL; +- struct dm_stats_counters cur; + struct dm_pool *mem = dms->mem; ++ struct dm_stats_counters cur; + FILE *stats_rows = NULL; + uint64_t start, len; + char row[256]; +@@ -1040,12 +1073,12 @@ static int _stats_create_region(struct dm_stats *dms, uint64_t *region_id, + int precise, const char *hist_arg, + const char *program_id, const char *aux_data) + { +- struct dm_task *dmt = NULL; +- char msg[1024], range[64]; + const char *err_fmt = "Could not prepare @stats_create %s."; + const char *precise_str = PRECISE_ARG; + const char *resp, *opt_args = NULL; +- int r = 0, nr_opt = 0; /* number of optional args. */ ++ char msg[1024], range[64], *endptr = NULL; ++ struct dm_task *dmt = NULL; ++ int r = 0, nr_opt = 0; + + if (!_stats_bound(dms)) + return_0; +@@ -1105,7 +1138,6 @@ static int _stats_create_region(struct dm_stats *dms, uint64_t *region_id, + } + + if (region_id) { +- char *endptr = NULL; + *region_id = strtoull(resp, &endptr, 10); + if (resp == endptr) + goto_out; +@@ -1195,11 +1227,11 @@ static struct dm_task *_stats_print_region(struct dm_stats *dms, + uint64_t region_id, unsigned start_line, + unsigned num_lines, unsigned clear) + { +- struct dm_task *dmt = NULL; + /* @stats_print[_clear] [ ] */ + const char *clear_str = "_clear", *lines_fmt = "%u %u"; + const char *msg_fmt = "@stats_print%s " FMTu64 " %s"; + const char *err_fmt = "Could not prepare @stats_print %s."; ++ struct dm_task *dmt = NULL; + char msg[1024], lines[64]; + + if (start_line || num_lines) +@@ -1292,6 +1324,8 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id, + uint64_t region_id) + { + int all_regions = (region_id == DM_STATS_REGIONS_ALL); ++ struct dm_task *dmt = NULL; /* @stats_print task */ ++ const char *resp; + + if (!_stats_bound(dms)) + return_0; +@@ -1311,9 +1345,6 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id, + + dm_stats_walk_start(dms); + do { +- struct dm_task *dmt = NULL; /* @stats_print task */ +- const char *resp; +- + region_id = (all_regions) + ? dm_stats_get_current_region(dms) : region_id; + +@@ -1967,10 +1998,12 @@ static struct dm_histogram *_alloc_dm_histogram(int nr_bins) + struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str) + { + static const char *_valid_chars = "0123456789,muns"; +- struct dm_histogram *dmh; ++ uint64_t this_val = 0, mult = 1; ++ const char *c, *v, *val_start; + struct dm_histogram_bin *cur; +- const char *c, *v; ++ struct dm_histogram *dmh; + int nr_entries = 1; ++ char *endptr; + + c = bounds_str; + +@@ -2003,9 +2036,8 @@ struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str) + bounds_str); + goto bad; + } else { +- const char *val_start = c; +- char *endptr = NULL; +- uint64_t this_val = 0, mult = 1; ++ val_start = c; ++ endptr = NULL; + + this_val = strtoull(val_start, &endptr, 10); + if (!endptr) { +@@ -2058,10 +2090,10 @@ bad: + + struct dm_histogram *dm_histogram_bounds_from_uint64(const uint64_t *bounds) + { +- struct dm_histogram *dmh; ++ const uint64_t *entry = bounds; + struct dm_histogram_bin *cur; ++ struct dm_histogram *dmh; + int nr_entries = 1; +- const uint64_t *entry = bounds; + + if (!bounds || !bounds[0]) { + log_error("Could not parse empty histogram bounds array"); +@@ -2113,6 +2145,7 @@ void dm_histogram_bounds_destroy(struct dm_histogram *bounds) + */ + static void _scale_bound_value_to_suffix(uint64_t *bound, const char **suffix) + { ++ *suffix = "ns"; + if (!(*bound % NSEC_PER_SEC)) { + *bound /= NSEC_PER_SEC; + *suffix = "s"; +@@ -2191,12 +2224,14 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin, + int width, int flags) + { + int minwidth, bounds, values, start, last; +- uint64_t lower, upper; /* bounds of the current bin. */ ++ uint64_t lower, upper, val_u64; /* bounds of the current bin. */ + /* Use the histogram pool for string building. */ + struct dm_pool *mem = dmh->dms->hist_mem; + char buf[64], bounds_buf[64]; + const char *sep = ""; ++ int bounds_width; + ssize_t len = 0; ++ float val_flt; + + bounds = flags & DM_HISTOGRAM_BOUNDS_MASK; + values = flags & DM_HISTOGRAM_VALUES; +@@ -2222,12 +2257,11 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin, + /* Set bounds string to the empty string. */ + bounds_buf[0] = '\0'; + +- dm_pool_begin_object(mem, 64); ++ if (!dm_pool_begin_object(mem, 64)) ++ return_0; + + for (bin = start; bin <= last; bin++) { + if (bounds) { +- int bounds_width; +- + /* Default bounds width depends on time suffixes. */ + bounds_width = (!(flags & DM_HISTOGRAM_SUFFIX)) + ? BOUND_WIDTH_NOSUFFIX +@@ -2260,15 +2294,14 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin, + + if (flags & DM_HISTOGRAM_PERCENT) { + dm_percent_t pr; +- float value; + pr = dm_histogram_get_bin_percent(dmh, bin); +- value = dm_percent_to_float(pr); ++ val_flt = dm_percent_to_float(pr); + len = dm_snprintf(buf, sizeof(buf), "%s%*.2f%%%s", +- bounds_buf, width, value, sep); ++ bounds_buf, width, val_flt, sep); + } else if (values) { +- uint64_t value = dmh->bins[bin].count; ++ val_u64 = dmh->bins[bin].count; + len = dm_snprintf(buf, sizeof(buf), "%s%*"PRIu64"%s", +- bounds_buf, width, value, sep); ++ bounds_buf, width, val_u64, sep); + } else if (bounds) + len = dm_snprintf(buf, sizeof(buf), "%s%s", bounds_buf, + sep); +@@ -2277,9 +2310,13 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin, + goto_bad; + + width = minwidth; /* re-set histogram column width. */ +- dm_pool_grow_object(mem, buf, (size_t) len); ++ if (!dm_pool_grow_object(mem, buf, (size_t) len)) ++ goto_bad; + } +- dm_pool_grow_object(mem, "\0", 1); ++ ++ if (!dm_pool_grow_object(mem, "\0", 1)) ++ goto_bad; ++ + return (const char *) dm_pool_end_object(mem); + + bad: +diff --git a/tools/dmsetup.c b/tools/dmsetup.c +index 61ad5a9..8b7ad74 100644 +--- a/tools/dmsetup.c ++++ b/tools/dmsetup.c +@@ -4674,6 +4674,7 @@ static int _do_stats_create_regions(struct dm_stats *dms, + return_0; + + if (!(dmt = dm_task_create(DM_DEVICE_TABLE))) { ++ dm_histogram_bounds_destroy(bounds); + dm_stats_destroy(dms); + return_0; + } diff --git a/SOURCES/lvm2-2_02_131-do-not-check-for-full-thin-pool-when-activating-without-messages.patch b/SOURCES/lvm2-2_02_131-do-not-check-for-full-thin-pool-when-activating-without-messages.patch new file mode 100755 index 00000000..42cd4ecf --- /dev/null +++ b/SOURCES/lvm2-2_02_131-do-not-check-for-full-thin-pool-when-activating-without-messages.patch @@ -0,0 +1,29 @@ + WHATS_NEW_DM | 4 ++++ + libdm/libdm-deptree.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletion(-) + +diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM +index b509d68..9e30786 100644 +--- a/WHATS_NEW_DM ++++ b/WHATS_NEW_DM +@@ -1,3 +1,7 @@ ++Version 1.02.108 - ++===================================== ++ Do not check for full thin pool when activating without messages (1.02.107). ++ + Version 1.02.107 - 5th September 2015 + ===================================== + Parse thin-pool status with one single routine internally. +diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c +index d40362d..7b7ca5b 100644 +--- a/libdm/libdm-deptree.c ++++ b/libdm/libdm-deptree.c +@@ -1633,7 +1633,7 @@ static int _node_send_messages(struct dm_tree_node *dnode, + return 0; + } + +- if (!send) ++ if (!have_messages || !send) + return 1; /* transaction_id is matching */ + + dm_list_iterate_items(tmsg, &seg->thin_messages) { diff --git a/SOURCES/lvm2-2_02_131-fix-vg-metadata-comparison-failure-while-scanning-the-vg-for-lvmetad.patch b/SOURCES/lvm2-2_02_131-fix-vg-metadata-comparison-failure-while-scanning-the-vg-for-lvmetad.patch new file mode 100755 index 00000000..b5374a9c --- /dev/null +++ b/SOURCES/lvm2-2_02_131-fix-vg-metadata-comparison-failure-while-scanning-the-vg-for-lvmetad.patch @@ -0,0 +1,28 @@ + WHATS_NEW | 1 + + lib/cache/lvmetad.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 5de648c..9ddecbc 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.131 - + ===================================== ++ Fix VG metadata comparison failure while scanning the VG for lvmetad. + Ignore persistent cache if configuration changed. (2.02.127) + + Version 2.02.130 - 5th September 2015 +diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c +index b2e2f55..0fff65a 100644 +--- a/lib/cache/lvmetad.c ++++ b/lib/cache/lvmetad.c +@@ -1174,7 +1174,7 @@ static struct volume_group *lvmetad_pvscan_vg(struct cmd_context *cmd, struct vo + if (!vgmeta_ret) { + vgmeta_ret = vgmeta; + } else { +- if (!compare_config(vgmeta_ret->root, vgmeta->root)) { ++ if (compare_config(vgmeta_ret->root, vgmeta->root)) { + log_error("VG metadata comparison failed"); + dm_config_destroy(vgmeta); + dm_config_destroy(vgmeta_ret); diff --git a/SOURCES/lvm2-2_02_131-fix-vgimportclone-cache_dir-path-name.patch b/SOURCES/lvm2-2_02_131-fix-vgimportclone-cache_dir-path-name.patch new file mode 100755 index 00000000..cdc432db --- /dev/null +++ b/SOURCES/lvm2-2_02_131-fix-vgimportclone-cache_dir-path-name.patch @@ -0,0 +1,37 @@ + WHATS_NEW | 1 + + scripts/vgimportclone.sh | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index f41475c..1718c29 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.131 - + ===================================== ++ Fix vgimportclone cache_dir path name (2.02.115). + Disallow usage of --stripe and --stripesize when creating cache pool. + Swapping of LV identifiers handles more complex LVs. + Fix VG metadata comparison failure while scanning the VG for lvmetad. +diff --git a/scripts/vgimportclone.sh b/scripts/vgimportclone.sh +index 388d14c..af8cf5c 100755 +--- a/scripts/vgimportclone.sh ++++ b/scripts/vgimportclone.sh +@@ -1,7 +1,7 @@ + #!/bin/bash + + # Copyright (C) 2009 Chris Procter All rights reserved. +-# Copyright (C) 2009 Red Hat, Inc. All rights reserved. ++# Copyright (C) 2009-2015 Red Hat, Inc. All rights reserved. + # + # This file is part of LVM2. + # +@@ -239,7 +239,7 @@ LVMCONF=${TMP_LVM_SYSTEM_DIR}/lvm.conf + + CMD_CONFIG_LINE="devices { \ + scan = [ \"${TMP_LVM_SYSTEM_DIR}\" ] \ +- cache_dir = \"$TMP_LVM_SYSTEM_DIR}/cache\" ++ cache_dir = \"${TMP_LVM_SYSTEM_DIR}/cache\" + global_filter = [ \"a|.*|\" ] \ + ${FILTER} + } \ diff --git a/SOURCES/lvm2-2_02_131-ignore-persistent-cache-if-configuration-changed.patch b/SOURCES/lvm2-2_02_131-ignore-persistent-cache-if-configuration-changed.patch new file mode 100755 index 00000000..05ae6f89 --- /dev/null +++ b/SOURCES/lvm2-2_02_131-ignore-persistent-cache-if-configuration-changed.patch @@ -0,0 +1,49 @@ + WHATS_NEW | 4 ++++ + tools/lvmcmdline.c | 8 +++++++- + 2 files changed, 11 insertions(+), 1 deletion(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index e74fd55..5de648c 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,3 +1,7 @@ ++Version 2.02.131 - ++===================================== ++ Ignore persistent cache if configuration changed. (2.02.127) ++ + Version 2.02.130 - 5th September 2015 + ===================================== + Fix use of uninitialized device status if reading outdated .cache record. +diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c +index b7809c7..d3bace7 100644 +--- a/tools/lvmcmdline.c ++++ b/tools/lvmcmdline.c +@@ -1478,6 +1478,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) + char *arg_new, *arg; + int i; + int skip_hyphens; ++ int refresh_done = 0; + + init_error_message_produced(0); + +@@ -1554,6 +1555,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) + log_error("Updated config file invalid. Aborting."); + return ECMD_FAILED; + } ++ refresh_done = 1; + } + + if (!_prepare_profiles(cmd)) +@@ -1562,7 +1564,11 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) + if (!cmd->initialized.connections && !_cmd_no_meta_proc(cmd) && !init_connections(cmd)) + return_ECMD_FAILED; + +- if (!cmd->initialized.filters && !_cmd_no_meta_proc(cmd) && !init_filters(cmd, 1)) ++ /* Note: Load persistent cache only if we haven't refreshed toolcontext! ++ * If toolcontext has been refreshed, it means config has changed ++ * and we can't rely on persistent cache anymore. ++ */ ++ if (!cmd->initialized.filters && !_cmd_no_meta_proc(cmd) && !init_filters(cmd, !refresh_done)) + return_ECMD_FAILED; + + if (arg_count(cmd, readonly_ARG)) diff --git a/SOURCES/lvm2-2_02_131-standardise-error-paths.patch b/SOURCES/lvm2-2_02_131-standardise-error-paths.patch new file mode 100755 index 00000000..72485e71 --- /dev/null +++ b/SOURCES/lvm2-2_02_131-standardise-error-paths.patch @@ -0,0 +1,2169 @@ +commit fb8220fb6961e563d6a760a70bd1e1b27a62bde0 +Author: Alasdair G Kergon +Date: Sat Sep 5 23:56:30 2015 +0100 + + style: Standardise some error paths. +--- + daemons/cmirrord/functions.c | 4 +- + daemons/lvmetad/lvmetad-core.c | 2 +- + lib/metadata/metadata.c | 3 +- + libdm/libdm-file.c | 4 +- + libdm/libdm-report.c | 2 +- + libdm/libdm-stats.c | 197 +++++++++-------- + liblvm/lvm_pv.c | 5 +- + tools/dmsetup.c | 475 +++++++++++++++++++++-------------------- + 8 files changed, 355 insertions(+), 337 deletions(-) + +diff --git a/daemons/cmirrord/functions.c b/daemons/cmirrord/functions.c +index 61b3e11..4f36cc6 100644 +--- a/daemons/cmirrord/functions.c ++++ b/daemons/cmirrord/functions.c +@@ -1445,7 +1445,7 @@ static int disk_status_info(struct log_c *lc, struct dm_ulog_request *rq) + char *data = (char *)rq->data; + struct stat statbuf; + +- if(fstat(lc->disk_fd, &statbuf)) { ++ if (fstat(lc->disk_fd, &statbuf)) { + rq->error = -errno; + return -errno; + } +@@ -1508,7 +1508,7 @@ static int disk_status_table(struct log_c *lc, struct dm_ulog_request *rq) + char *data = (char *)rq->data; + struct stat statbuf; + +- if(fstat(lc->disk_fd, &statbuf)) { ++ if (fstat(lc->disk_fd, &statbuf)) { + rq->error = -errno; + return -errno; + } +diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c +index 19e8723..89aaaf8 100644 +--- a/daemons/lvmetad/lvmetad-core.c ++++ b/daemons/lvmetad/lvmetad-core.c +@@ -578,7 +578,7 @@ static void mark_outdated_pv(lvmetad_state *s, const char *vgid, const char *pvi + !(cft_vgid = make_text_node(outdated_pvs, "vgid", dm_pool_strdup(outdated_pvs->mem, vgid), + outdated_pvs->root, NULL))) + abort(); +- if(!dm_hash_insert(s->vgid_to_outdated_pvs, cft_vgid->v->v.str, outdated_pvs)) ++ if (!dm_hash_insert(s->vgid_to_outdated_pvs, cft_vgid->v->v.str, outdated_pvs)) + abort(); + DEBUGLOG(s, "created outdated_pvs list for VG %s", vgid); + } +diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c +index 8757331..b45f850 100644 +--- a/lib/metadata/metadata.c ++++ b/lib/metadata/metadata.c +@@ -319,10 +319,11 @@ static struct pv_list *_copy_pvl(struct dm_pool *pvmem, struct pv_list *pvl_from + if (!(pvl_to->pv = dm_pool_alloc(pvmem, sizeof(*pvl_to->pv)))) + goto_bad; + +- if(!_copy_pv(pvmem, pvl_to->pv, pvl_from->pv)) ++ if (!_copy_pv(pvmem, pvl_to->pv, pvl_from->pv)) + goto_bad; + + return pvl_to; ++ + bad: + dm_pool_free(pvmem, pvl_to); + return NULL; +diff --git a/libdm/libdm-file.c b/libdm/libdm-file.c +index 52f9d45..e4beddd 100644 +--- a/libdm/libdm-file.c ++++ b/libdm/libdm-file.c +@@ -119,8 +119,8 @@ int dm_create_lockfile(const char *lockfile) + char buffer[50]; + int retries = 0; + +- if((fd = open(lockfile, O_CREAT | O_WRONLY, +- (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) { ++ if ((fd = open(lockfile, O_CREAT | O_WRONLY, ++ (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH))) < 0) { + log_error("Cannot open lockfile [%s], error was [%s]", + lockfile, strerror(errno)); + return 0; +diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c +index 6416f18..10ab7df 100644 +--- a/libdm/libdm-report.c ++++ b/libdm/libdm-report.c +@@ -4195,7 +4195,7 @@ static void _destroy_rows(struct dm_report *rh) + * pool allocation this will also free all subsequently allocated + * rows from the report and any associated string data. + */ +- if(rh->first_row) ++ if (rh->first_row) + dm_pool_free(rh->mem, rh->first_row); + rh->first_row = NULL; + dm_list_init(&rh->rows); +diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c +index 736aae5..93c7760 100644 +--- a/libdm/libdm-stats.c ++++ b/libdm/libdm-stats.c +@@ -105,7 +105,7 @@ static char *_program_id_from_proc(void) + + if (!fgets(buf, sizeof(buf), comm)) { + log_error("Could not read from %s", PROC_SELF_COMM); +- if(fclose(comm)) ++ if (fclose(comm)) + stack; + return NULL; + } +@@ -145,7 +145,7 @@ struct dm_stats *dm_stats_create(const char *program_id) + + /* FIXME: better hint. */ + if (!(dms->mem = dm_pool_create("stats_pool", 4096))) +- goto_out; ++ goto_bad; + + if (!(dms->hist_mem = dm_pool_create("histogram_pool", hist_hint))) + return_0; +@@ -169,7 +169,8 @@ struct dm_stats *dm_stats_create(const char *program_id) + dms->regions = NULL; + + return dms; +-out: ++ ++bad: + dm_free(dms); + return NULL; + } +@@ -354,7 +355,7 @@ static char *_build_histogram_arg(struct dm_histogram *bounds, int *precise) + hist_len += 1 + (size_t) lround(log10(value)); + } + +- if(!(hist_arg = dm_zalloc(hist_len))) { ++ if (!(hist_arg = dm_zalloc(hist_len))) { + log_error("Could not allocate memory for histogram argument."); + return 0; + } +@@ -373,14 +374,16 @@ static char *_build_histogram_arg(struct dm_histogram *bounds, int *precise) + value = entry->upper / scale; + if ((l = dm_snprintf(arg, hist_len - len, FMTu64"%s", value, + (last) ? "" : ",")) < 0) +- goto out; ++ goto_bad; + len += (size_t) l; + arg += (size_t) l; + } + return hist_arg; +-out: ++ ++bad: + log_error("Could not build histogram arguments."); + dm_free(hist_arg); ++ + return NULL; + } + +@@ -392,16 +395,17 @@ static struct dm_task *_stats_send_message(struct dm_stats *dms, char *msg) + return_0; + + if (!_set_stats_device(dms, dmt)) +- goto_out; ++ goto_bad; + + if (!dm_task_set_message(dmt, msg)) +- goto_out; ++ goto_bad; + + if (!dm_task_run(dmt)) +- goto_out; ++ goto_bad; + + return dmt; +-out: ++ ++bad: + dm_task_destroy(dmt); + return NULL; + } +@@ -425,7 +429,7 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + + /* Advance past "histogram:". */ + histogram = strchr(histogram, ':'); +- if(!histogram) { ++ if (!histogram) { + log_error("Could not parse histogram description."); + return 0; + } +@@ -444,21 +448,23 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + hist.region = region; + hist.dms = dms; + +- if(!dm_pool_grow_object(mem, &hist, sizeof(hist))) +- goto_out; ++ if (!dm_pool_grow_object(mem, &hist, sizeof(hist))) ++ goto_bad; + + c = histogram; + do { +- for(v = _valid_chars; *v; v++) ++ for (v = _valid_chars; *v; v++) + if (*c == *v) + break; +- if(!*v) ++ if (!*v) { ++ stack; + goto badchar; ++ } + + if (*c == ',') { + log_error("Invalid histogram description: %s", + histogram); +- goto out; ++ goto bad; + } else { + const char *val_start = c; + char *endptr = NULL; +@@ -467,15 +473,17 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + this_val = strtoull(val_start, &endptr, 10); + if (!endptr) { + log_error("Could not parse histogram boundary."); +- goto out; ++ goto bad; + } + + c = endptr; /* Advance to units, comma, or end. */ + + if (*c == ',') + c++; +- else if (*c || (*c == ' ')) /* Expected ',' or NULL. */ ++ else if (*c || (*c == ' ')) { /* Expected ',' or NULL. */ ++ stack; + goto badchar; ++ } + + if (*c == ',') + c++; +@@ -484,7 +492,7 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + cur.count = 0; + + if (!dm_pool_grow_object(mem, &cur, sizeof(cur))) +- goto_out; ++ goto_bad; + + nr_bins++; + } +@@ -493,7 +501,7 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + /* final upper bound. */ + cur.upper = UINT64_MAX; + if (!dm_pool_grow_object(mem, &cur, sizeof(cur))) +- goto_out; ++ goto_bad; + + region->bounds = dm_pool_end_object(mem); + +@@ -507,7 +515,7 @@ static int _stats_parse_histogram_spec(struct dm_stats *dms, + + badchar: + log_error("Invalid character in histogram: '%c' (0x%x)", *c, *c); +-out: ++bad: + dm_pool_abandon_object(mem); + return 0; + } +@@ -614,12 +622,12 @@ static int _stats_parse_list(struct dm_stats *dms, const char *resp) + return_0; + + if (!dm_pool_begin_object(mem, 1024)) +- goto_out; ++ goto_bad; + + while(fgets(line, sizeof(line), list_rows)) { + + if (!_stats_parse_list_region(dms, &cur, line)) +- goto_out; ++ goto_bad; + + /* handle holes in the list of region_ids */ + if (cur.region_id > max_region) { +@@ -628,12 +636,12 @@ static int _stats_parse_list(struct dm_stats *dms, const char *resp) + fill.region_id = DM_STATS_REGION_NOT_PRESENT; + do { + if (!dm_pool_grow_object(mem, &fill, sizeof(fill))) +- goto_out; ++ goto_bad; + } while (max_region++ < (cur.region_id - 1)); + } + + if (!dm_pool_grow_object(mem, &cur, sizeof(cur))) +- goto_out; ++ goto_bad; + + max_region++; + nr_regions++; +@@ -647,10 +655,12 @@ static int _stats_parse_list(struct dm_stats *dms, const char *resp) + stack; + + return 1; +-out: +- if(fclose(list_rows)) ++ ++bad: ++ if (fclose(list_rows)) + stack; + dm_pool_abandon_object(mem); ++ + return 0; + } + +@@ -675,17 +685,17 @@ int dm_stats_list(struct dm_stats *dms, const char *program_id) + } + + if (!(dmt = _stats_send_message(dms, msg))) +- return 0; ++ return_0; + + if (!_stats_parse_list(dms, dm_task_get_message_response(dmt))) { + log_error("Could not parse @stats_list response."); +- goto out; ++ goto bad; + } + + dm_task_destroy(dmt); + return 1; + +-out: ++bad: + dm_task_destroy(dmt); + return 0; + } +@@ -715,15 +725,17 @@ static int _stats_parse_histogram(struct dm_pool *mem, char *hist_str, + + do { + memset(&cur, 0, sizeof(cur)); +- for(v = _valid_chars; *v; v++) ++ for (v = _valid_chars; *v; v++) + if (*c == *v) + break; +- if(!*v) ++ if (!*v) { ++ stack; + goto badchar; ++ } + + if (*c == ',') { + log_error("Invalid histogram: %s", hist_str); +- goto out; ++ return 0; + } else { + const char *val_start = c; + char *endptr = NULL; +@@ -732,15 +744,17 @@ static int _stats_parse_histogram(struct dm_pool *mem, char *hist_str, + this_val = strtoull(val_start, &endptr, 10); + if (!endptr) { + log_error("Could not parse histogram value."); +- goto out; ++ return 0; + } + c = endptr; /* Advance to colon, or end. */ + + if (*c == ':') + c++; +- else if (*c & (*c != '\n')) ++ else if (*c & (*c != '\n')) { + /* Expected ':', '\n', or NULL. */ ++ stack; + goto badchar; ++ } + + if (*c == ':') + c++; +@@ -764,7 +778,6 @@ static int _stats_parse_histogram(struct dm_pool *mem, char *hist_str, + + badchar: + log_error("Invalid character in histogram data: '%c' (0x%x)", *c, *c); +-out: + return 0; + } + +@@ -788,7 +801,7 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, + region->start = UINT64_MAX; + + if (!dm_pool_begin_object(mem, 512)) +- goto_out; ++ goto_bad; + + /* + * dm_task_get_message_response() returns a 'const char *' but +@@ -796,7 +809,7 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, + */ + stats_rows = fmemopen((char *)resp, strlen(resp), "r"); + if (!stats_rows) +- goto_out; ++ goto_bad; + + /* + * Output format for each step-sized area of a region: +@@ -844,7 +857,7 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, + &cur.total_read_nsecs, &cur.total_write_nsecs); + if (r != 15) { + log_error("Could not parse @stats_print row."); +- goto out; ++ goto bad; + } + + /* scale time values up if needed */ +@@ -862,7 +875,7 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, + char *hist_str = strchr(row, ':'); + if (!hist_str) { + log_error("Could not parse histogram value."); +- goto out; ++ goto bad; + } + /* Find space preceding histogram. */ + while (hist_str && *(hist_str - 1) != ' ') +@@ -874,15 +887,15 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, + */ + if (!_stats_parse_histogram(dms->hist_mem, hist_str, + &hist, region)) +- goto out; ++ goto_bad; + hist->dms = dms; + hist->region = region; + } + + cur.histogram = hist; + +- if(!dm_pool_grow_object(mem, &cur, sizeof(cur))) +- goto_out; ++ if (!dm_pool_grow_object(mem, &cur, sizeof(cur))) ++ goto_bad; + + if (region->start == UINT64_MAX) { + region->start = start; +@@ -899,12 +912,12 @@ static int _stats_parse_region(struct dm_stats *dms, const char *resp, + + return 1; + +-out: +- ++bad: + if (stats_rows) +- if(fclose(stats_rows)) ++ if (fclose(stats_rows)) + stack; + dm_pool_abandon_object(mem); ++ + return 0; + } + +@@ -1017,7 +1030,7 @@ int dm_stats_get_region_nr_histogram_bins(const struct dm_stats *dms, + ? dms->cur_region : region_id ; + + if (!dms->regions[region_id].bounds) +- return 0; ++ return_0; + + return dms->regions[region_id].bounds->nr_bins; + } +@@ -1083,7 +1096,7 @@ static int _stats_create_region(struct dm_stats *dms, uint64_t *region_id, + } + + if (!(dmt = _stats_send_message(dms, msg))) +- goto out; ++ goto_out; + + resp = dm_task_get_message_response(dmt); + if (!resp) { +@@ -1101,9 +1114,10 @@ static int _stats_create_region(struct dm_stats *dms, uint64_t *region_id, + r = 1; + + out: +- if(dmt) ++ if (dmt) + dm_task_destroy(dmt); + dm_free((void *) opt_args); ++ + return r; + } + +@@ -1116,9 +1130,8 @@ int dm_stats_create_region(struct dm_stats *dms, uint64_t *region_id, + int r = 0; + + /* Nanosecond counters and histograms both need precise_timestamps. */ +- if ((precise || bounds) +- && !_stats_check_precise_timestamps(dms)) +- return 0; ++ if ((precise || bounds) && !_stats_check_precise_timestamps(dms)) ++ return_0; + + if (bounds) { + /* _build_histogram_arg enables precise if vals < 1ms. */ +@@ -1129,6 +1142,7 @@ int dm_stats_create_region(struct dm_stats *dms, uint64_t *region_id, + r = _stats_create_region(dms, region_id, start, len, step, + precise, hist_arg, program_id, aux_data); + dm_free(hist_arg); ++ + out: + return r; + } +@@ -1143,17 +1157,15 @@ int dm_stats_delete_region(struct dm_stats *dms, uint64_t region_id) + + if (!dm_snprintf(msg, sizeof(msg), "@stats_delete " FMTu64, region_id)) { + log_error("Could not prepare @stats_delete message."); +- goto out; ++ return 0; + } + + dmt = _stats_send_message(dms, msg); + if (!dmt) +- goto_out; ++ return_0; + dm_task_destroy(dmt); +- return 1; + +-out: +- return 0; ++ return 1; + } + + int dm_stats_clear_region(struct dm_stats *dms, uint64_t region_id) +@@ -1166,17 +1178,17 @@ int dm_stats_clear_region(struct dm_stats *dms, uint64_t region_id) + + if (!dm_snprintf(msg, sizeof(msg), "@stats_clear " FMTu64, region_id)) { + log_error("Could not prepare @stats_clear message."); +- goto out; ++ return 0; + } + + dmt = _stats_send_message(dms, msg); ++ + if (!dmt) +- goto_out; ++ return_0; ++ + dm_task_destroy(dmt); +- return 1; + +-out: +- return 0; ++ return 1; + } + + static struct dm_task *_stats_print_region(struct dm_stats *dms, +@@ -1194,22 +1206,19 @@ static struct dm_task *_stats_print_region(struct dm_stats *dms, + if (!dm_snprintf(lines, sizeof(lines), + lines_fmt, start_line, num_lines)) { + log_error(err_fmt, "row specification"); +- goto out; ++ return NULL; + } + + if (!dm_snprintf(msg, sizeof(msg), msg_fmt, (clear) ? clear_str : "", + region_id, (start_line || num_lines) ? lines : "")) { + log_error(err_fmt, "message"); +- goto out; ++ return NULL; + } + + if (!(dmt = _stats_send_message(dms, msg))) +- goto out; ++ return_NULL; + + return dmt; +- +-out: +- return NULL; + } + + char *dm_stats_print_region(struct dm_stats *dms, uint64_t region_id, +@@ -1226,7 +1235,7 @@ char *dm_stats_print_region(struct dm_stats *dms, uint64_t region_id, + start_line, num_lines, clear); + + if (!dmt) +- return 0; ++ return_0; + + resp = dm_pool_strdup(dms->mem, dm_task_get_message_response(dmt)); + dm_task_destroy(dmt); +@@ -1245,7 +1254,7 @@ void dm_stats_buffer_destroy(struct dm_stats *dms, char *buffer) + uint64_t dm_stats_get_nr_regions(const struct dm_stats *dms) + { + if (!dms || !dms->regions) +- return 0; ++ return_0; + return dms->nr_regions; + } + +@@ -1255,10 +1264,10 @@ uint64_t dm_stats_get_nr_regions(const struct dm_stats *dms) + int dm_stats_region_present(const struct dm_stats *dms, uint64_t region_id) + { + if (!dms->regions) +- return 0; ++ return_0; + + if (region_id > dms->max_region) +- return 0; ++ return_0; + + return _stats_region_present(&dms->regions[region_id]); + } +@@ -1293,12 +1302,12 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id, + + if (all_regions && !dm_stats_list(dms, program_id)) { + log_error("Could not parse @stats_list response."); +- goto out; ++ goto bad; + } + + /* successful list but no regions registered */ + if (!dms->nr_regions) +- return 0; ++ return_0; + + dm_stats_walk_start(dms); + do { +@@ -1310,12 +1319,12 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id, + + /* obtain all lines and clear counter values */ + if (!(dmt = _stats_print_region(dms, region_id, 0, 0, 1))) +- goto_out; ++ goto_bad; + + resp = dm_task_get_message_response(dmt); + if (!_dm_stats_populate_region(dms, region_id, resp)) { + dm_task_destroy(dmt); +- goto_out; ++ goto_bad; + } + + dm_task_destroy(dmt); +@@ -1325,7 +1334,7 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id, + + return 1; + +-out: ++bad: + _stats_regions_destroy(dms); + dms->regions = NULL; + return 0; +@@ -1620,10 +1629,10 @@ int dm_stats_get_service_time(const struct dm_stats *dms, double *svctm, + double tput; + + if (!dm_stats_get_throughput(dms, &tput, region_id, area_id)) +- return 0; ++ return_0; + + if (!dm_stats_get_utilization(dms, &util, region_id, area_id)) +- return 0; ++ return_0; + + /* avoid NAN with zero counter values */ + if ( (uint64_t) tput == 0 || (uint64_t) util == 0) { +@@ -1973,23 +1982,26 @@ struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str) + c = bounds_str; + + if (!(dmh = _alloc_dm_histogram(nr_entries))) +- return 0; ++ return_0; + + dmh->nr_bins = nr_entries; + + cur = dmh->bins; + + do { +- for(v = _valid_chars; *v; v++) ++ for (v = _valid_chars; *v; v++) + if (*c == *v) + break; +- if(!*v) ++ ++ if (!*v) { ++ stack; + goto badchar; ++ } + + if (*c == ',') { + log_error("Empty histogram bin not allowed: %s", + bounds_str); +- goto out; ++ goto bad; + } else { + const char *val_start = c; + char *endptr = NULL; +@@ -1998,7 +2010,7 @@ struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str) + this_val = strtoull(val_start, &endptr, 10); + if (!endptr) { + log_error("Could not parse histogram bound."); +- goto out; ++ goto bad; + } + c = endptr; /* Advance to units, comma, or end. */ + +@@ -2012,13 +2024,17 @@ struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str) + mult = NSEC_PER_USEC; + else if (*c == 'n') + mult = 1; +- else ++ else { ++ stack; + goto badchar; ++ } + c += 2; /* Advance over 'ms', 'us', or 'ns'. */ + } else if (*c == ',') + c++; +- else if (*c) /* Expected ',' or NULL. */ ++ else if (*c) { /* Expected ',' or NULL. */ ++ stack; + goto badchar; ++ } + + if (*c == ',') + c++; +@@ -2035,7 +2051,7 @@ struct dm_histogram *dm_histogram_bounds_from_string(const char *bounds_str) + + badchar: + log_error("Invalid character in histogram: %c", *c); +-out: ++bad: + dm_free(dmh); + return NULL; + } +@@ -2121,7 +2137,7 @@ static int _make_bounds_string(char *buf, size_t size, uint64_t lower, + int bounds = flags & DM_HISTOGRAM_BOUNDS_MASK; + + if (!bounds) +- return 0; ++ return_0; + + *buf = '\0'; + +@@ -2258,14 +2274,15 @@ const char *dm_histogram_to_string(const struct dm_histogram *dmh, int bin, + sep); + + if (len < 0) +- goto_out; ++ goto_bad; + + width = minwidth; /* re-set histogram column width. */ + dm_pool_grow_object(mem, buf, (size_t) len); + } + dm_pool_grow_object(mem, "\0", 1); + return (const char *) dm_pool_end_object(mem); +-out: ++ ++bad: + dm_pool_abandon_object(mem); + return NULL; + } +diff --git a/liblvm/lvm_pv.c b/liblvm/lvm_pv.c +index 24b2732..5933e0a 100644 +--- a/liblvm/lvm_pv.c ++++ b/liblvm/lvm_pv.c +@@ -155,9 +155,8 @@ static struct dm_list *_lvm_list_pvs(lvm_t libh) + } else { + dm_list_init(&rc->pvslist); + dm_list_init(&rc->vgslist); +- if( !get_pvs_perserve_vg(cmd, &rc->pvslist, &rc->vgslist) ) { +- return NULL; +- } ++ if (!get_pvs_perserve_vg(cmd, &rc->pvslist, &rc->vgslist)) ++ return_NULL; + + /* + * If we have no PVs we still need to have access to cmd +diff --git a/tools/dmsetup.c b/tools/dmsetup.c +index 8983e18..61ad5a9 100644 +--- a/tools/dmsetup.c ++++ b/tools/dmsetup.c +@@ -327,7 +327,7 @@ static int _parse_line(struct dm_task *dmt, char *buffer, const char *file, + *comment = '\0'; + + if (!dm_task_add_target(dmt, start, size, ttype, ptr)) +- return 0; ++ return_0; + + return 1; + } +@@ -364,11 +364,11 @@ static int _parse_file(struct dm_task *dmt, const char *file) + while (getline(&buffer, &buffer_size, fp) > 0) + #endif + if (!_parse_line(dmt, buffer, file ? : "on stdin", ++line)) +- goto out; ++ goto_out; + + r = 1; + +- out: ++out: + memset(buffer, 0, buffer_size); + #ifndef HAVE_GETLINE + dm_free(buffer); +@@ -421,33 +421,33 @@ static struct dm_task *_get_deps_task(int major, int minor) + struct dm_info info; + + if (!(dmt = dm_task_create(DM_DEVICE_DEPS))) +- return NULL; ++ return_NULL; + + if (!dm_task_set_major(dmt, major) || + !dm_task_set_minor(dmt, minor)) +- goto err; ++ goto_bad; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto err; ++ goto_bad; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto err; ++ goto_bad; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto err; ++ goto_bad; + + if (!_task_run(dmt)) +- goto err; ++ goto_bad; + + if (!dm_task_get_info(dmt, &info)) +- goto err; ++ goto_bad; + + if (!info.exists) +- goto err; ++ goto_bad; + + return dmt; + +- err: ++bad: + dm_task_destroy(dmt); + return NULL; + } +@@ -581,7 +581,7 @@ static int _do_timerfd_wait(void) + ssize_t bytes; + + if (_timer_fd < 0) +- return 0; ++ return_0; + + /* read on timerfd returns a uint64_t in host byte order. */ + bytes = read(_timer_fd, &expired, sizeof(expired)); +@@ -646,9 +646,9 @@ static int _do_usleep_wait(void) + */ + if (!_last_sleep && !_now) { + if (!(_last_sleep = dm_timestamp_alloc())) +- goto_out; ++ return_0; + if (!(_now = dm_timestamp_alloc())) +- goto_out; ++ return_0; + dm_timestamp_get(_now); + this_interval = _interval; + log_error("Using "FMTu64" as first interval.", this_interval); +@@ -673,17 +673,15 @@ static int _do_usleep_wait(void) + log_error("Report interval interrupted by signal."); + if (errno == EINVAL) + log_error("Report interval too short."); +- goto out; ++ return_0; + } + +- if(_count == 2) { ++ if (_count == 2) { + dm_timestamp_destroy(_last_sleep); + dm_timestamp_destroy(_now); + } + + return 1; +-out: +- return 0; + } + + static int _start_timer(void) +@@ -838,7 +836,7 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info) + dm_stats_bind_devno(obj.stats, info->major, info->minor); + + if (!dm_stats_populate(obj.stats, _program_id, DM_STATS_REGIONS_ALL)) +- goto out; ++ goto_out; + + /* Update timestamps and handle end-of-interval accounting. */ + _update_interval_times(); +@@ -856,11 +854,11 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info) + dm_stats_bind_devno(obj.stats, info->major, info->minor); + + if (!dm_stats_list(obj.stats, _program_id)) +- goto out; ++ goto_out; + + /* No regions to report */ + if (!dm_stats_get_nr_regions(obj.stats)) +- goto out; ++ goto_out; + } + + /* +@@ -879,7 +877,7 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info) + } dm_stats_walk_while(obj.stats); + r = 1; + +- out: ++out: + if (obj.deps_task) + dm_task_destroy(obj.deps_task); + if (obj.split_name) +@@ -938,7 +936,7 @@ static int _display_info(struct dm_task *dmt) + struct dm_info info; + + if (!dm_task_get_info(dmt, &info)) +- return 0; ++ return_0; + + if (!_switches[COLS_ARG]) + _display_info_long(dmt, &info); +@@ -953,14 +951,14 @@ static int _set_task_device(struct dm_task *dmt, const char *name, int optional) + { + if (name) { + if (!dm_task_set_name(dmt, name)) +- return 0; ++ return_0; + } else if (_switches[UUID_ARG]) { + if (!dm_task_set_uuid(dmt, _uuid)) +- return 0; ++ return_0; + } else if (_switches[MAJOR_ARG] && _switches[MINOR_ARG]) { + if (!dm_task_set_major(dmt, _int_args[MAJOR_ARG]) || + !dm_task_set_minor(dmt, _int_args[MINOR_ARG])) +- return 0; ++ return_0; + } else if (!optional) { + fprintf(stderr, "No device specified.\n"); + return 0; +@@ -972,15 +970,15 @@ static int _set_task_device(struct dm_task *dmt, const char *name, int optional) + static int _set_task_add_node(struct dm_task *dmt) + { + if (!dm_task_set_add_node(dmt, DEFAULT_DM_ADD_NODE)) +- return 0; ++ return_0; + + if (_switches[ADD_NODE_ON_RESUME_ARG] && + !dm_task_set_add_node(dmt, DM_ADD_NODE_ON_RESUME)) +- return 0; ++ return_0; + + if (_switches[ADD_NODE_ON_CREATE_ARG] && + !dm_task_set_add_node(dmt, DM_ADD_NODE_ON_CREATE)) +- return 0; ++ return_0; + + return 1; + } +@@ -1014,35 +1012,35 @@ static int _load(CMD_ARGS) + file = argv[0]; + + if (!(dmt = dm_task_create(DM_DEVICE_RELOAD))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (!_switches[NOTABLE_ARG] && !_parse_file(dmt, file)) +- goto out; ++ goto_out; + + if (_switches[READ_ONLY] && !dm_task_set_ro(dmt)) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + r = 1; + + if (_switches[VERBOSE_ARG]) + r = _display_info(dmt); + +- out: ++out: + dm_task_destroy(dmt); + + return r; +@@ -1060,45 +1058,45 @@ static int _create(CMD_ARGS) + file = argv[1]; + + if (!(dmt = dm_task_create(DM_DEVICE_CREATE))) +- return 0; ++ return_0; + + if (!dm_task_set_name(dmt, argv[0])) +- goto out; ++ goto_out; + + if (_switches[UUID_ARG] && !dm_task_set_uuid(dmt, _uuid)) +- goto out; ++ goto_out; + + if (!_switches[NOTABLE_ARG] && !_parse_file(dmt, file)) +- goto out; ++ goto_out; + + if (_switches[READ_ONLY] && !dm_task_set_ro(dmt)) +- goto out; ++ goto_out; + + if (_switches[MAJOR_ARG] && !dm_task_set_major(dmt, _int_args[MAJOR_ARG])) +- goto out; ++ goto_out; + + if (_switches[MINOR_ARG] && !dm_task_set_minor(dmt, _int_args[MINOR_ARG])) +- goto out; ++ goto_out; + + if (_switches[UID_ARG] && !dm_task_set_uid(dmt, _int_args[UID_ARG])) +- goto out; ++ goto_out; + + if (_switches[GID_ARG] && !dm_task_set_gid(dmt, _int_args[GID_ARG])) +- goto out; ++ goto_out; + + if (_switches[MODE_ARG] && !dm_task_set_mode(dmt, _int_args[MODE_ARG])) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[READAHEAD_ARG] && + !dm_task_set_read_ahead(dmt, _int_args[READAHEAD_ARG], + _read_ahead_flags)) +- goto out; ++ goto_out; + + if (_switches[NOTABLE_ARG]) + dm_udev_set_sync_support(0); +@@ -1108,10 +1106,10 @@ static int _create(CMD_ARGS) + DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_set_task_add_node(dmt)) +- goto out; ++ goto_out; + + if (_udev_cookie) + cookie = _udev_cookie; +@@ -1121,11 +1119,11 @@ static int _create(CMD_ARGS) + + if (!dm_task_set_cookie(dmt, &cookie, udev_flags) || + !_task_run(dmt)) +- goto out; ++ goto_out; + + r = 1; + +- out: ++out: + if (!_udev_cookie) + (void) dm_udev_wait(cookie); + +@@ -1144,26 +1142,26 @@ static int _do_rename(const char *name, const char *new_name, const char *new_uu + uint16_t udev_flags = 0; + + if (!(dmt = dm_task_create(DM_DEVICE_RENAME))) +- return 0; ++ return_0; + + /* FIXME Kernel doesn't support uuid or device number here yet */ + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (new_uuid) { + if (!dm_task_set_newuuid(dmt, new_uuid)) +- goto out; ++ goto_out; + } else if (!new_name || !dm_task_set_newname(dmt, new_name)) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (_switches[NOUDEVRULES_ARG]) + udev_flags |= DM_UDEV_DISABLE_DM_RULES_FLAG | +@@ -1177,11 +1175,11 @@ static int _do_rename(const char *name, const char *new_name, const char *new_uu + + if (!dm_task_set_cookie(dmt, &cookie, udev_flags) || + !_task_run(dmt)) +- goto out; ++ goto_out; + + r = 1; + +- out: ++out: + if (!_udev_cookie) + (void) dm_udev_wait(cookie); + +@@ -1210,14 +1208,14 @@ static int _message(CMD_ARGS) + char *endptr; + + if (!(dmt = dm_task_create(DM_DEVICE_TARGET_MSG))) +- return 0; ++ return_0; + + if (_switches[UUID_ARG] || _switches[MAJOR_ARG]) { + if (!_set_task_device(dmt, NULL, 0)) +- goto out; ++ goto_out; + } else { + if (!_set_task_device(dmt, argv[0], 0)) +- goto out; ++ goto_out; + argc--; + argv++; + } +@@ -1228,7 +1226,7 @@ static int _message(CMD_ARGS) + goto out; + } + if (!dm_task_set_sector(dmt, sector)) +- goto out; ++ goto_out; + + argc--; + argv++; +@@ -1255,19 +1253,19 @@ static int _message(CMD_ARGS) + dm_free(str); + + if (!i) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + if ((response = dm_task_get_message_response(dmt))) { + if (!*response || response[strlen(response) - 1] == '\n') +@@ -1278,7 +1276,7 @@ static int _message(CMD_ARGS) + + r = 1; + +- out: ++out: + dm_task_destroy(dmt); + + return r; +@@ -1290,37 +1288,37 @@ static int _setgeometry(CMD_ARGS) + struct dm_task *dmt; + + if (!(dmt = dm_task_create(DM_DEVICE_SET_GEOMETRY))) +- return 0; ++ return_0; + + if (_switches[UUID_ARG] || _switches[MAJOR_ARG]) { + if (!_set_task_device(dmt, NULL, 0)) +- goto out; ++ goto_out; + } else { + if (!_set_task_device(dmt, argv[0], 0)) +- goto out; ++ goto_out; + argc--; + argv++; + } + + if (!dm_task_set_geometry(dmt, argv[0], argv[1], argv[2], argv[3])) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + /* run the task */ + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + r = 1; + +- out: ++out: + dm_task_destroy(dmt); + + return r; +@@ -1373,7 +1371,7 @@ static int _udevflags(CMD_ARGS) + 0}; + + if (!(cookie = _get_cookie_value(argv[0]))) +- return 0; ++ return_0; + + flags = cookie >> DM_UDEV_FLAGS_SHIFT; + +@@ -1405,7 +1403,7 @@ static int _udevcomplete(CMD_ARGS) + uint32_t cookie; + + if (!(cookie = _get_cookie_value(argv[0]))) +- return 0; ++ return_0; + + /* + * Strip flags from the cookie and use cookie magic instead. +@@ -1519,7 +1517,7 @@ static int _udevcreatecookie(CMD_ARGS) + uint32_t cookie; + + if (!dm_udev_create_cookie(&cookie)) +- return 0; ++ return_0; + + if (cookie) + printf("0x%08" PRIX32 "\n", cookie); +@@ -1530,7 +1528,7 @@ static int _udevcreatecookie(CMD_ARGS) + static int _udevreleasecookie(CMD_ARGS) + { + if (argv[0] && !(_udev_cookie = _get_cookie_value(argv[0]))) +- return 0; ++ return_0; + + if (!_udev_cookie) { + log_error("No udev transaction cookie given."); +@@ -1686,7 +1684,7 @@ static int _version(CMD_ARGS) + printf("Library version: %s\n", version); + + if (!dm_driver_version(version, sizeof(version))) +- return 0; ++ return_0; + + printf("Driver version: %s\n", version); + +@@ -1710,37 +1708,37 @@ static int _simple(int task, const char *name, uint32_t event_nr, int display) + struct dm_task *dmt; + + if (!(dmt = dm_task_create(task))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (event_nr && !dm_task_set_event_nr(dmt, event_nr)) +- goto out; ++ goto_out; + + if (_switches[NOFLUSH_ARG] && !dm_task_no_flush(dmt)) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[NOLOCKFS_ARG] && !dm_task_skip_lockfs(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + /* FIXME: needs to coperate with udev */ + if (!_set_task_add_node(dmt)) +- goto out; ++ goto_out; + + if (_switches[READAHEAD_ARG] && + !dm_task_set_read_ahead(dmt, _int_args[READAHEAD_ARG], + _read_ahead_flags)) +- goto out; ++ goto_out; + + if (_switches[NOUDEVRULES_ARG]) + udev_flags |= DM_UDEV_DISABLE_DM_RULES_FLAG | +@@ -1753,7 +1751,7 @@ static int _simple(int task, const char *name, uint32_t event_nr, int display) + udev_flags |= DM_UDEV_DISABLE_LIBRARY_FALLBACK; + + if (udev_wait_flag && !dm_task_set_cookie(dmt, &cookie, udev_flags)) +- goto out; ++ goto_out; + + if (_switches[RETRY_ARG] && task == DM_DEVICE_REMOVE) + dm_task_retry_remove(dmt); +@@ -1763,7 +1761,7 @@ static int _simple(int task, const char *name, uint32_t event_nr, int display) + + r = _task_run(dmt); + +- out: ++out: + if (!_udev_cookie && udev_wait_flag) + (void) dm_udev_wait(cookie); + +@@ -1817,19 +1815,19 @@ static int _process_all(const struct command *cmd, const char *subcommand, int a + struct dm_task *dmt; + + if (!(dmt = dm_task_create(DM_DEVICE_LIST))) +- return 0; ++ return_0; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) { + r = 0; +- goto out; ++ goto_out; + } + + if (!(names = dm_task_get_names(dmt))) { + r = 0; +- goto out; ++ goto_out; + } + + if (!names->dev) { +@@ -1845,7 +1843,7 @@ static int _process_all(const struct command *cmd, const char *subcommand, int a + next = names->next; + } while (next); + +- out: ++out: + dm_task_destroy(dmt); + return r; + } +@@ -1859,25 +1857,25 @@ static uint64_t _get_device_size(const char *name) + void *next = NULL; + + if (!(dmt = dm_task_create(DM_DEVICE_TABLE))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + if (!dm_task_get_info(dmt, &info) || !info.exists) +- goto out; ++ goto_out; + + do { + next = dm_get_next_target(dmt, next, &start, &length, +@@ -1885,7 +1883,7 @@ static uint64_t _get_device_size(const char *name) + size += length; + } while (next); + +- out: ++out: + dm_task_destroy(dmt); + return size; + } +@@ -1902,37 +1900,37 @@ static int _error_device(CMD_ARGS) + size = _get_device_size(name); + + if (!(dmt = dm_task_create(DM_DEVICE_RELOAD))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto error; ++ goto_bad; + + if (!dm_task_add_target(dmt, UINT64_C(0), size, "error", "")) +- goto error; ++ goto_bad; + + if (_switches[READ_ONLY] && !dm_task_set_ro(dmt)) +- goto error; ++ goto_bad; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto error; ++ goto_bad; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto error; ++ goto_bad; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto error; ++ goto_bad; + + if (!_task_run(dmt)) +- goto error; ++ goto_bad; + + if (!_simple(DM_DEVICE_RESUME, name, 0, 0)) { + _simple(DM_DEVICE_CLEAR, name, 0, 0); +- goto error; ++ goto_bad; + } + + r = 1; + +-error: ++bad: + dm_task_destroy(dmt); + return r; + } +@@ -2013,14 +2011,14 @@ static int _exec_command(const char *name) + pid_t pid; + + if (argc < 0) +- return 0; ++ return_0; + + if (!dm_mknodes(name)) +- return 0; ++ return_0; + + n = snprintf(path, sizeof(path), "%s/%s", dm_dir(), name); + if (n < 0 || n > (int) sizeof(path) - 1) +- return 0; ++ return_0; + + if (!argc) { + c = _command_to_exec; +@@ -2038,7 +2036,7 @@ static int _exec_command(const char *name) + + if (!argc) { + argc = -1; +- return 0; ++ return_0; + } + + if (argc == ARGS_MAX) { +@@ -2093,28 +2091,28 @@ static int _status(CMD_ARGS) + ls_only = 1; + + if (!(dmt = dm_task_create(cmdno))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (_switches[NOFLUSH_ARG] && !dm_task_no_flush(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + if (!dm_task_get_info(dmt, &info) || !info.exists) +- goto out; ++ goto_out; + + if (!name) + name = dm_task_get_name(dmt); +@@ -2163,11 +2161,11 @@ static int _status(CMD_ARGS) + printf("\n"); + + if (matched && _switches[EXEC_ARG] && _command_to_exec && !_exec_command(name)) +- goto out; ++ goto_out; + + r = 1; + +- out: ++out: + dm_task_destroy(dmt); + return r; + } +@@ -2181,13 +2179,13 @@ static int _targets(CMD_ARGS) + struct dm_versions *last_target; + + if (!(dmt = dm_task_create(DM_DEVICE_LIST_VERSIONS))) +- return 0; ++ return_0; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + target = dm_task_get_versions(dmt); + +@@ -2203,7 +2201,7 @@ static int _targets(CMD_ARGS) + + r = 1; + +- out: ++out: + dm_task_destroy(dmt); + return r; + } +@@ -2224,26 +2222,26 @@ static int _info(CMD_ARGS) + } + + if (!(dmt = dm_task_create(DM_DEVICE_INFO))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + r = _display_info(dmt); + +- out: ++out: + dm_task_destroy(dmt); + return r; + } +@@ -2268,28 +2266,28 @@ static int _deps(CMD_ARGS) + } + + if (!(dmt = dm_task_create(DM_DEVICE_DEPS))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (_switches[NOOPENCOUNT_ARG] && !dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[INACTIVE_ARG] && !dm_task_query_inactive_table(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + if (!dm_task_get_info(dmt, &info)) +- goto out; ++ goto_out; + + if (!(deps = dm_task_get_deps(dmt))) +- goto out; ++ goto_out; + + if (!info.exists) { + printf("Device does not exist.\n"); +@@ -2322,7 +2320,7 @@ static int _deps(CMD_ARGS) + + r = 1; + +- out: ++out: + dm_task_destroy(dmt); + return r; + } +@@ -2670,7 +2668,7 @@ static int _add_dep(CMD_ARGS) + { + if (names && + !dm_tree_add_dev(_dtree, (unsigned) MAJOR(names->dev), (unsigned) MINOR(names->dev))) +- return 0; ++ return_0; + + return 1; + } +@@ -2684,10 +2682,10 @@ static int _build_whole_deptree(const struct command *cmd) + return 1; + + if (!(_dtree = dm_tree_create())) +- return 0; ++ return_0; + + if (!_process_all(cmd, NULL, 0, NULL, 0, _add_dep)) +- return 0; ++ return_0; + + return 1; + } +@@ -2695,7 +2693,7 @@ static int _build_whole_deptree(const struct command *cmd) + static int _display_tree(CMD_ARGS) + { + if (!_build_whole_deptree(cmd)) +- return 0; ++ return_0; + + _display_tree_walk_children(dm_tree_find_node(_dtree, 0, 0), 0); + +@@ -2732,7 +2730,7 @@ static int _show_units(void) + { + /* --nosuffix overrides --units */ + if (_switches[NOSUFFIX_ARG]) +- return 0; ++ return_0; + + return (_int_args[UNITS_ARG]) ? 1 : 0; + } +@@ -2944,8 +2942,10 @@ static int _dm_info_devno_disp(struct dm_report *rh, struct dm_pool *mem, + + if (private) { + if (!dm_device_get_name(info->major, info->minor, +- 1, buf, PATH_MAX)) ++ 1, buf, PATH_MAX)) { ++ stack; + goto out_abandon; ++ } + } + else { + if (dm_snprintf(buf, sizeof(buf), "%d:%d", +@@ -4375,7 +4375,7 @@ static int _report_init(const struct command *cmd, const char *subcommand) + if (!(_report = dm_report_init_with_selection(&_report_type, _report_types, + _report_fields, options, separator, flags, keys, + selection, NULL, NULL))) +- goto out; ++ goto_out; + + if ((_report_type & DR_TREE) && !_build_whole_deptree(cmd)) { + err("Internal device dependency tree creation failed."); +@@ -4431,19 +4431,19 @@ static int _mangle(CMD_ARGS) + } + + if (!(dmt = dm_task_create(DM_DEVICE_STATUS))) +- return 0; ++ return_0; + + if (!(_set_task_device(dmt, name, 0))) +- goto out; ++ goto_out; + + if (!_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + if (!dm_task_get_info(dmt, &info) || !info.exists) +- goto out; ++ goto_out; + + uuid = dm_task_get_uuid(dmt); + +@@ -4465,15 +4465,15 @@ static int _mangle(CMD_ARGS) + + if (target_format == DM_STRING_MANGLING_NONE) { + if (!(new_name = dm_task_get_name_unmangled(dmt))) +- goto out; ++ goto_out; + if (!(new_uuid = dm_task_get_uuid_unmangled(dmt))) +- goto out; ++ goto_out; + } + else { + if (!(new_name = dm_task_get_name_mangled(dmt))) +- goto out; ++ goto_out; + if (!(new_uuid = dm_task_get_uuid_mangled(dmt))) +- goto out; ++ goto_out; + } + + /* We can't rename the UUID, the device must be reactivated manually. */ +@@ -4508,13 +4508,13 @@ static int _stats(CMD_ARGS); + static int _bind_stats_device(struct dm_stats *dms, const char *name) + { + if (name && !dm_stats_bind_name(dms, name)) +- return 0; ++ return_0; + else if (_switches[UUID_ARG] && !dm_stats_bind_uuid(dms, _uuid)) +- return 0; ++ return_0; + else if (_switches[MAJOR_ARG] && _switches[MINOR_ARG] + && !dm_stats_bind_devno(dms, _int_args[MAJOR_ARG], + _int_args[MINOR_ARG])) +- return 0; ++ return_0; + + return 1; + } +@@ -4524,10 +4524,10 @@ static int _stats_clear_regions(struct dm_stats *dms, uint64_t region_id) + int allregions = (region_id == DM_STATS_REGIONS_ALL); + + if (!dm_stats_list(dms, NULL)) +- goto_out; ++ return_0; + + if (!dm_stats_get_nr_regions(dms)) +- goto done; ++ return 1; + + dm_stats_walk_do(dms) { + if (allregions) +@@ -4535,21 +4535,18 @@ static int _stats_clear_regions(struct dm_stats *dms, uint64_t region_id) + + if (!dm_stats_region_present(dms, region_id)) { + log_error("No such region: %"PRIu64".", region_id); +- goto out; ++ return 0; + } + if (!dm_stats_clear_region(dms, region_id)) { + log_error("Clearing statistics region %"PRIu64" failed.", + region_id); +- goto out; ++ return 0; + } + log_info("Cleared statistics region %"PRIu64".", region_id); + dm_stats_walk_next_region(dms); + } dm_stats_walk_while(dms); +-done: +- return 1; + +-out: +- return 0; ++ return 1; + } + + static int _stats_clear(CMD_ARGS) +@@ -4611,7 +4608,7 @@ static int _size_from_string(char *argptr, uint64_t *size, const char *name) + uint64_t factor; + char *endptr = NULL, unit_type; + if (!argptr) +- return 0; ++ return_0; + + *size = strtoull(argptr, &endptr, 10); + if (endptr == argptr) { +@@ -4674,30 +4671,30 @@ static int _do_stats_create_regions(struct dm_stats *dms, + void *next = NULL; + + if (histogram && !(bounds = dm_histogram_bounds_from_string(histogram))) +- return 0; ++ return_0; + + if (!(dmt = dm_task_create(DM_DEVICE_TABLE))) { + dm_stats_destroy(dms); +- return 0; ++ return_0; + } + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (!dm_task_no_open_count(dmt)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + if (!dm_task_get_info(dmt, &info) || !info.exists) +- goto out; ++ goto_out; + + if (!(devname = dm_task_get_name(dmt))) +- goto out; ++ goto_out; + + do { + uint64_t segment_start, segment_len; +@@ -4797,7 +4794,7 @@ static int _stats_create(CMD_ARGS) + if (_switches[AREA_SIZE_ARG]) + if (!_size_from_string(_string_args[AREA_SIZE_ARG], + &area_size, "areasize")) +- return 0; ++ return_0; + + areas = (areas) ? areas : 1; + /* bytes to sectors or -(areas): promote to signed before conversion */ +@@ -4806,7 +4803,7 @@ static int _stats_create(CMD_ARGS) + if (_switches[START_ARG]) { + if (!_size_from_string(_string_args[START_ARG], + &start, "start")) +- return 0; ++ return_0; + } + + /* bytes to sectors */ +@@ -4815,7 +4812,7 @@ static int _stats_create(CMD_ARGS) + if (_switches[LENGTH_ARG]) { + if (!_size_from_string(_string_args[LENGTH_ARG], + &len, "length")) +- return 0; ++ return_0; + } + + /* bytes to sectors */ +@@ -4831,13 +4828,13 @@ static int _stats_create(CMD_ARGS) + + dms = dm_stats_create(DM_STATS_PROGRAM_ID); + if (!_bind_stats_device(dms, name)) +- goto_out; ++ goto_bad; + + if (_switches[PRECISE_ARG]) { + if (!dm_stats_driver_supports_precise()) { + log_error("Using --precise requires driver version " + "4.32.0 or later."); +- goto out; ++ goto bad; + } + } + +@@ -4845,7 +4842,7 @@ static int _stats_create(CMD_ARGS) + if (!dm_stats_driver_supports_histogram()) { + log_error("Using --bounds requires driver version " + "4.32.0 or later."); +- goto out; ++ goto bad; + } + } + +@@ -4857,7 +4854,7 @@ static int _stats_create(CMD_ARGS) + _switches[SEGMENTS_ARG], + program_id, aux_data); + +-out: ++bad: + dm_stats_destroy(dms); + return 0; + } +@@ -4869,6 +4866,7 @@ static int _stats_delete(CMD_ARGS) + char *name = NULL; + const char *program_id = DM_STATS_PROGRAM_ID; + int allregions = _switches[ALL_REGIONS_ARG]; ++ int r = 0; + + /* delete does not use a report */ + if (_report) { +@@ -4908,9 +4906,11 @@ static int _stats_delete(CMD_ARGS) + if (allregions && !dm_stats_list(dms, program_id)) + goto_out; + +- if (allregions && !dm_stats_get_nr_regions(dms)) ++ if (allregions && !dm_stats_get_nr_regions(dms)) { + /* no regions present */ +- goto done; ++ r = 1; ++ goto out; ++ } + + dm_stats_walk_do(dms) { + if (_switches[ALL_REGIONS_ARG]) +@@ -4923,13 +4923,11 @@ static int _stats_delete(CMD_ARGS) + dm_stats_walk_next_region(dms); + } dm_stats_walk_while(dms); + +-done: +- dm_stats_destroy(dms); +- return 1; ++ r = 1; + + out: + dm_stats_destroy(dms); +- return 0; ++ return r; + } + + static int _stats_print(CMD_ARGS) +@@ -4939,6 +4937,7 @@ static int _stats_print(CMD_ARGS) + uint64_t region_id; + unsigned clear = (unsigned) _switches[CLEAR_ARG]; + int allregions = _switches[ALL_REGIONS_ARG]; ++ int r = 0; + + /* print does not use a report */ + if (_report) { +@@ -4969,8 +4968,10 @@ static int _stats_print(CMD_ARGS) + if (!dm_stats_list(dms, NULL)) + goto_out; + +- if (allregions && !dm_stats_get_nr_regions(dms)) +- goto done; ++ if (allregions && !dm_stats_get_nr_regions(dms)) { ++ r = 1; ++ goto out; ++ } + + dm_stats_walk_do(dms) { + if (_switches[ALL_REGIONS_ARG]) +@@ -4994,13 +4995,11 @@ static int _stats_print(CMD_ARGS) + + } dm_stats_walk_while(dms); + +-done: +- dm_stats_destroy(dms); +- return 1; ++ r = 1; + + out: + dm_stats_destroy(dms); +- return 0; ++ return r; + } + + static int _stats_report(CMD_ARGS) +@@ -5028,25 +5027,27 @@ static int _stats_report(CMD_ARGS) + } + + if (!(dmt = dm_task_create(DM_DEVICE_INFO))) +- return 0; ++ return_0; + + if (!_set_task_device(dmt, name, 0)) +- goto out; ++ goto_out; + + if (_switches[CHECKS_ARG] && !dm_task_enable_checks(dmt)) +- goto out; ++ goto_out; + + if (!_task_run(dmt)) +- goto out; ++ goto_out; + + r = _display_info(dmt); + +- out: ++out: + dm_task_destroy(dmt); ++ + if (!r && _report) { + dm_report_free(_report); + _report = NULL; + } ++ + return r; + } + +@@ -5321,7 +5322,7 @@ static int _stats(CMD_ARGS) + */ + if (!stats_cmd->fn(stats_cmd, subcommand, argc, argv, NULL, + multiple_devices)) +- return 0; ++ return_0; + + return 1; + } +@@ -5418,35 +5419,35 @@ static char *parse_loop_device_name(const char *dev, const char *dev_dir) + char *device = NULL; + + if (!(buf = dm_malloc(PATH_MAX))) +- return NULL; ++ return_NULL; + + if (dev[0] == '/') { + if (!(device = _get_abspath(dev))) +- goto error; ++ goto_bad; + + if (strncmp(device, dev_dir, strlen(dev_dir))) +- goto error; ++ goto_bad; + + /* If dev_dir does not end in a slash, ensure that the + following byte in the device string is "/". */ + if (dev_dir[strlen(dev_dir) - 1] != '/' && + device[strlen(dev_dir)] != '/') +- goto error; ++ goto_bad; + + if (!dm_strncpy(buf, strrchr(device, '/') + 1, PATH_MAX)) +- goto error; ++ goto_bad; + dm_free(device); + } else { + /* check for device number */ + if (strncmp(dev, "loop", sizeof("loop") - 1)) +- goto error; ++ goto_bad; + + if (!dm_strncpy(buf, dev, PATH_MAX)) +- goto error; ++ goto_bad; + } + + return buf; +-error: ++bad: + dm_free(device); + dm_free(buf); + +@@ -5476,10 +5477,10 @@ static int _loop_table(char *table, size_t tlen, char *file, + } + + if (fd < 0) +- goto error; ++ goto_bad; + + if (fstat(fd, &fbuf)) +- goto error; ++ goto_bad; + + size = (fbuf.st_size - off); + sectors = size >> SECTOR_SHIFT; +@@ -5491,7 +5492,7 @@ static int _loop_table(char *table, size_t tlen, char *file, + + #ifdef HAVE_SYS_STATVFS_H + if (fstatvfs(fd, &fsbuf)) +- goto error; ++ goto_bad; + + /* FIXME Fragment size currently unused */ + blksize = fsbuf.f_frsize; +@@ -5502,18 +5503,18 @@ static int _loop_table(char *table, size_t tlen, char *file, + + if (dm_snprintf(table, tlen, "%llu %llu loop %s %llu\n", 0ULL, + (long long unsigned)sectors, file, (long long unsigned)off) < 0) +- return 0; ++ return_0; + + if (_switches[VERBOSE_ARG] > 1) + fprintf(stderr, "Table: %s\n", table); + + return 1; + +-error: ++bad: + if (fd > -1 && close(fd)) + log_sys_error("close", file); + +- return 0; ++ return_0; + } + + static int _process_losetup_switches(const char *base, int *argcp, char ***argvp, +@@ -5536,7 +5537,7 @@ static int _process_losetup_switches(const char *base, int *argcp, char ***argvp + while ((c = GETOPTLONG_FN(*argcp, *argvp, "ade:fo:v", + long_options, NULL)) != -1 ) { + if (c == ':' || c == '?') +- return 0; ++ return_0; + if (c == 'a') + show_all++; + if (c == 'd') +@@ -5836,7 +5837,7 @@ static int _process_switches(int *argcp, char ***argvp, const char *dev_dir) + _string_args[AUX_DATA_ARG] = optarg; + } + if (c == ':' || c == '?') +- return 0; ++ return_0; + if (c == 'h' || ind == HELP_ARG) + _switches[HELP_ARG]++; + if (ind == BOUNDS_ARG) { +@@ -6201,7 +6202,7 @@ unknown: + + #ifdef UDEV_SYNC_SUPPORT + if (!_set_up_udev_support(dev_dir)) +- goto out; ++ goto_out; + #endif + + /* +@@ -6215,7 +6216,7 @@ unknown: + subcommand = (char *) ""; + + if (_switches[COLS_ARG] && !_report_init(cmd, subcommand)) +- goto out; ++ goto_out; + + if (_switches[COUNT_ARG]) + _count = ((uint32_t)_int_args[COUNT_ARG]) ? : UINT32_MAX; diff --git a/SOURCES/lvm2-2_02_131-swapping-of-lv-identifiers-handles-more-complex-lvs.patch b/SOURCES/lvm2-2_02_131-swapping-of-lv-identifiers-handles-more-complex-lvs.patch new file mode 100755 index 00000000..9a7541ff --- /dev/null +++ b/SOURCES/lvm2-2_02_131-swapping-of-lv-identifiers-handles-more-complex-lvs.patch @@ -0,0 +1,66 @@ + WHATS_NEW | 1 + + tools/lvconvert.c | 4 ++-- + tools/lvconvert_poll.c | 13 +++++++++---- + 3 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 9ddecbc..5260321 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.131 - + ===================================== ++ Swapping of LV identifiers handles more complex LVs. + Fix VG metadata comparison failure while scanning the VG for lvmetad. + Ignore persistent cache if configuration changed. (2.02.127) + +diff --git a/tools/lvconvert.c b/tools/lvconvert.c +index 2bffb07..919537a 100644 +--- a/tools/lvconvert.c ++++ b/tools/lvconvert.c +@@ -2489,14 +2489,14 @@ deactivate_pmslv: + if (!detach_pool_metadata_lv(first_seg(pool_lv), &mlv)) + return_0; + ++ /* Swap _pmspare and _tmeta name */ + if (!swap_lv_identifiers(cmd, mlv, pmslv)) + return_0; + +- /* Used _pmspare will become _tmeta */ + if (!attach_pool_metadata_lv(first_seg(pool_lv), pmslv)) + return_0; + +- /* Used _tmeta will become visible _meta%d */ ++ /* Used _tmeta (now _pmspare) becomes _meta%d */ + if (!lv_rename_update(cmd, mlv, pms_path, 0)) + return_0; + +diff --git a/tools/lvconvert_poll.c b/tools/lvconvert_poll.c +index e3a3709..1b230bc 100644 +--- a/tools/lvconvert_poll.c ++++ b/tools/lvconvert_poll.c +@@ -44,15 +44,20 @@ int swap_lv_identifiers(struct cmd_context *cmd, + struct logical_volume *a, struct logical_volume *b) + { + union lvid lvid; +- const char *name; ++ const char *aname = a->name, *bname = b->name; + + lvid = a->lvid; + a->lvid = b->lvid; + b->lvid = lvid; + +- name = a->name; +- a->name = b->name; +- if (!lv_rename_update(cmd, b, name, 0)) ++ /* rename temporarily to 'unused' name */ ++ if (!lv_rename_update(cmd, a, "pmove_tmeta", 0)) ++ return_0; ++ /* name rename 'b' to unused name of 'a' */ ++ if (!lv_rename_update(cmd, b, aname, 0)) ++ return_0; ++ /* finish name swapping */ ++ if (!lv_rename_update(cmd, a, bname, 0)) + return_0; + + return 1; diff --git a/SOURCES/lvm2-2_02_133-check-for-space-in-thin-pool-before-creating-new-thin.patch b/SOURCES/lvm2-2_02_133-check-for-space-in-thin-pool-before-creating-new-thin.patch new file mode 100755 index 00000000..a02d919b --- /dev/null +++ b/SOURCES/lvm2-2_02_133-check-for-space-in-thin-pool-before-creating-new-thin.patch @@ -0,0 +1,51 @@ + WHATS_NEW | 4 ++++ + lib/metadata/lv_manip.c | 23 ++++++++++++++++++----- + 2 files changed, 22 insertions(+), 5 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 1718c29..0fa6bb6 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,3 +1,7 @@ ++Version 2.02.133 - ++====================================== ++ Check for enough space in thin-pool in command before creating new thin. ++ + Version 2.02.131 - + ===================================== + Fix vgimportclone cache_dir path name (2.02.115). +diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c +index 88c516b..32aa666 100644 +--- a/lib/metadata/lv_manip.c ++++ b/lib/metadata/lv_manip.c +@@ -7038,12 +7038,25 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, + } + } + +- if (seg_is_thin_volume(lp) && +- lv_is_new_thin_pool(pool_lv)) { ++ if (seg_is_thin_volume(lp)) { + thin_pool_was_active = lv_is_active(pool_lv); +- if (!check_new_thin_pool(pool_lv)) +- return_NULL; +- /* New pool is now inactive */ ++ if (lv_is_new_thin_pool(pool_lv)) { ++ if (!check_new_thin_pool(pool_lv)) ++ return_NULL; ++ /* New pool is now inactive */ ++ } else { ++ if (!activate_lv_excl_local(cmd, pool_lv)) { ++ log_error("Aborting. Failed to locally activate thin pool %s.", ++ display_lvname(pool_lv)); ++ return 0; ++ } ++ if (!pool_below_threshold(first_seg(pool_lv))) { ++ log_error("Cannot create new thin volume, free space in " ++ "thin pool %s reached threshold.", ++ display_lvname(pool_lv)); ++ return NULL; ++ } ++ } + } + + if (seg_is_cache(lp) && diff --git a/SOURCES/lvm2-2_02_133-enforce-writethrough-mode-for-cleaner-policy.patch b/SOURCES/lvm2-2_02_133-enforce-writethrough-mode-for-cleaner-policy.patch new file mode 100755 index 00000000..58a3359a --- /dev/null +++ b/SOURCES/lvm2-2_02_133-enforce-writethrough-mode-for-cleaner-policy.patch @@ -0,0 +1,30 @@ + WHATS_NEW_DM | 4 ++++ + libdm/libdm-deptree.c | 3 ++- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM +index 9e30786..71b25ba 100644 +--- a/WHATS_NEW_DM ++++ b/WHATS_NEW_DM +@@ -1,3 +1,7 @@ ++Version 1.02.110 - ++====================================== ++ Enforce writethrough mode for cleaner policy. ++ + Version 1.02.108 - + ===================================== + Do not check for full thin pool when activating without messages (1.02.107). +diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c +index 7b7ca5b..fc79e33 100644 +--- a/libdm/libdm-deptree.c ++++ b/libdm/libdm-deptree.c +@@ -3456,7 +3456,8 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node, + return_0; + + seg->data_block_size = data_block_size; +- seg->flags = feature_flags; ++ /* Enforce WriteThough mode for cleaner policy */ ++ seg->flags = (strcmp(policy_name, "cleaner") == 0) ? DM_CACHE_FEATURE_WRITETHROUGH : feature_flags; + seg->policy_name = policy_name; + + /* FIXME: better validation missing */ diff --git a/SOURCES/lvm2-2_02_135-fix-resize-of-full-thin-pool-causing-data-loss.patch b/SOURCES/lvm2-2_02_135-fix-resize-of-full-thin-pool-causing-data-loss.patch new file mode 100755 index 00000000..e2970802 --- /dev/null +++ b/SOURCES/lvm2-2_02_135-fix-resize-of-full-thin-pool-causing-data-loss.patch @@ -0,0 +1,204 @@ +commit 8aa13d867d8c707450bb1de1479e18a3bbbc324a +Author: Peter Rajnoha +Date: Tue Dec 1 13:10:31 2015 +0100 + + bz1274676 +--- + lib/activate/dev_manager.c | 11 ++++-- + libdm/.exported_symbols.Base | 1 - + libdm/.exported_symbols.DM_1_02_107 | 1 + + libdm/libdevmapper.h | 5 +++ + libdm/libdm-deptree.c | 25 ++++++++++++-- + test/shell/lvextend-thin-bz1274676.sh | 63 +++++++++++++++++++++++++++++++++++ + 6 files changed, 100 insertions(+), 6 deletions(-) + +diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c +index c8e9589..e1f547f 100644 +--- a/lib/activate/dev_manager.c ++++ b/lib/activate/dev_manager.c +@@ -3277,7 +3277,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv, + break; + case SUSPEND: + dm_tree_skip_lockfs(root); +- if (!dm->flush_required && lv_is_mirror(lv) && !lv_is_pvmove(lv)) ++ if (!dm->flush_required && !lv_is_pvmove(lv)) + dm_tree_use_no_flush_suspend(root); + /* Fall through */ + case SUSPEND_WITH_LOCKFS: +@@ -3296,7 +3296,14 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv, + if (!dm_tree_preload_children(root, dlid, DLID_SIZE)) + goto_out; + +- if (dm_tree_node_size_changed(root)) ++ if ((dm_tree_node_size_changed(root) < 0)) ++ dm->flush_required = 1; ++ ++ /* Currently keep the code require flush for any ++ * non 'thin pool/volume, mirror' or with any size change */ ++ if (!lv_is_thin_volume(lv) && ++ !lv_is_thin_pool(lv) && ++ (!lv_is_mirror(lv) || dm_tree_node_size_changed(root))) + dm->flush_required = 1; + + if (action == ACTIVATE) { +diff --git a/libdm/.exported_symbols.Base b/libdm/.exported_symbols.Base +index f9c3cb1..27fef53 100644 +--- a/libdm/.exported_symbols.Base ++++ b/libdm/.exported_symbols.Base +@@ -262,7 +262,6 @@ dm_tree_node_set_thin_external_origin + dm_tree_node_set_thin_pool_discard + dm_tree_node_set_thin_pool_error_if_no_space + dm_tree_node_set_udev_flags +-dm_tree_node_size_changed + dm_tree_preload_children + dm_tree_retry_remove + dm_tree_set_cookie +diff --git a/libdm/.exported_symbols.DM_1_02_107 b/libdm/.exported_symbols.DM_1_02_107 +index 89d3464..0c7b7af 100644 +--- a/libdm/.exported_symbols.DM_1_02_107 ++++ b/libdm/.exported_symbols.DM_1_02_107 +@@ -13,3 +13,4 @@ dm_stats_create_region + dm_stats_driver_supports_histogram + dm_stats_get_histogram + dm_stats_get_region_nr_histogram_bins ++dm_tree_node_size_changed +diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h +index 098fa85..8d4b096 100644 +--- a/libdm/libdevmapper.h ++++ b/libdm/libdevmapper.h +@@ -1252,6 +1252,11 @@ const char *dm_tree_node_get_name(const struct dm_tree_node *node); + const char *dm_tree_node_get_uuid(const struct dm_tree_node *node); + const struct dm_info *dm_tree_node_get_info(const struct dm_tree_node *node); + void *dm_tree_node_get_context(const struct dm_tree_node *node); ++/* ++ * Returns 0 when node size and its children is unchanged. ++ * Returns 1 when node or any of its children has increased size. ++ * Rerurns -1 when node or any of its children has reduced size. ++ */ + int dm_tree_node_size_changed(const struct dm_tree_node *dnode); + + /* +diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c +index fc79e33..0584079 100644 +--- a/libdm/libdm-deptree.c ++++ b/libdm/libdm-deptree.c +@@ -220,7 +220,7 @@ struct load_properties { + uint32_t read_ahead_flags; + + unsigned segment_count; +- unsigned size_changed; ++ int size_changed; + struct dm_list segs; + + const char *new_name; +@@ -2768,7 +2768,8 @@ static int _load_node(struct dm_tree_node *dnode) + + existing_table_size = dm_task_get_existing_table_size(dmt); + if ((dnode->props.size_changed = +- (existing_table_size == seg_start) ? 0 : 1)) { ++ (existing_table_size == seg_start) ? 0 : ++ (existing_table_size > seg_start) ? -1 : 1)) { + /* + * Kernel usually skips size validation on zero-length devices + * now so no need to preload them. +@@ -2864,8 +2865,10 @@ int dm_tree_preload_children(struct dm_tree_node *dnode, + } + + /* Propagate device size change change */ +- if (child->props.size_changed) ++ if (child->props.size_changed > 0 && !dnode->props.size_changed) + dnode->props.size_changed = 1; ++ else if (child->props.size_changed < 0) ++ dnode->props.size_changed = -1; + + /* Resume device immediately if it has parents and its size changed */ + if (!dm_tree_node_num_children(child, 1) || !child->props.size_changed) +@@ -4190,3 +4193,19 @@ void dm_tree_node_set_callback(struct dm_tree_node *dnode, + dnode->callback = cb; + dnode->callback_data = data; + } ++ ++/* ++ * Backward compatible dm_tree_node_size_changed() implementations. ++ * ++ * Keep these at the end of the file to avoid adding clutter around the ++ * current dm_tree_node_size_changed() version. ++ */ ++#if defined(__GNUC__) ++int dm_tree_node_size_changed_base(const struct dm_tree_node *dnode); ++DM_EXPORT_SYMBOL_BASE(dm_tree_node_size_changed); ++int dm_tree_node_size_changed_base(const struct dm_tree_node *dnode) ++{ ++ /* Base does not make difference between smaller and bigger */ ++ return dm_tree_node_size_changed(dnode) ? 1 : 0; ++} ++#endif +diff --git a/test/shell/lvextend-thin-bz1274676.sh b/test/shell/lvextend-thin-bz1274676.sh +new file mode 100644 +index 0000000..facace0 +--- /dev/null ++++ b/test/shell/lvextend-thin-bz1274676.sh +@@ -0,0 +1,63 @@ ++#!/bin/bash ++# Copyright (C) 2015 Red Hat, Inc. All rights reserved. ++# ++# This copyrighted material is made available to anyone wishing to use, ++# modify, copy, or redistribute it subject to the terms and conditions ++# of the GNU General Public License v.2. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program; if not, write to the Free Software Foundation, ++# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++# ensure there is no data loss during thin-pool resize ++ ++export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false} ++ ++. lib/inittest ++ ++test -e LOCAL_LVMPOLLD && skip ++ ++which md5sum || skip ++ ++aux have_thin 1 0 0 || skip ++ ++aux prepare_pvs 2 20 ++ ++vgcreate -s 512K $vg $(< DEVICES) ++ ++lvcreate -L1M -V2M -n $lv1 -T $vg/pool ++ ++# just ensure we check what we need to check ++check lv_field $vg/pool size "1.00m" ++check lv_field $vg/$lv1 size "2.00m" ++ ++# prepare 2097152 file content ++seq 0 315465 > 2M ++md5sum 2M | cut -f 1 -d ' ' | tee MD5 ++dd if=2M of="$DM_DEV_DIR/mapper/$vg-$lv1" bs=512K conv=fdatasync 2>&1 >log & ++#dd if=2M of="$DM_DEV_DIR/mapper/$vg-$lv1" bs=2M oflag=direct & ++ ++# give it some time to fill thin-volume ++# eventually loop to wait for 100% full pool... ++sleep .1 ++lvs -a $vg ++ ++# this must not 'block & wait' on suspending flush ++# if it waits on thin-pool's target timeout ++# it will harm queued data ++lvextend -L+512k $vg/pool ++lvextend -L+512k $vg/pool ++ ++# collect 'dd' result ++wait ++cat log ++ ++lvs -a $vg ++ ++dd if="$DM_DEV_DIR/mapper/$vg-$lv1" of=2M-2 iflag=direct ++md5sum 2M-2 | cut -f 1 -d ' ' | tee MD5-2 ++ ++# these 2 are supposed to match ++diff MD5 MD5-2 ++ ++vgremove -f $vg diff --git a/SOURCES/lvm2-2_02_140-restore-background-polling-processing-during-auto-activation.patch b/SOURCES/lvm2-2_02_140-restore-background-polling-processing-during-auto-activation.patch new file mode 100755 index 00000000..0ef7cb7e --- /dev/null +++ b/SOURCES/lvm2-2_02_140-restore-background-polling-processing-during-auto-activation.patch @@ -0,0 +1,74 @@ + WHATS_NEW | 4 ++++ + tools/pvscan.c | 9 +++++++++ + tools/tools.h | 2 ++ + tools/vgchange.c | 4 ++-- + 4 files changed, 17 insertions(+), 2 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 945b282..8c87a92 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -2,6 +2,10 @@ Version 2.02.142 - + ==================================== + Do not check for suspended devices if scanning for lvmetad update. + ++Version 2.02.140 - ++=================================== ++ Restore background polling processing during auto-activation (2.02.119). ++ + Version 2.02.133 - + ====================================== + Check for enough space in thin-pool in command before creating new thin. +diff --git a/tools/pvscan.c b/tools/pvscan.c +index 3adb91c..b3b5911 100644 +--- a/tools/pvscan.c ++++ b/tools/pvscan.c +@@ -154,6 +154,15 @@ static int _auto_activation_handler(struct cmd_context *cmd, + goto out; + } + ++ /* ++ * After sucessfull activation we need to initialise polling ++ * for all activated LVs in a VG. Possible enhancement would ++ * be adding --poll y|n cmdline option for pvscan and call ++ * init_background_polling routine in autoactivation handler. ++ */ ++ if (!(vgchange_background_polling(vg->cmd, vg))) ++ goto_out; ++ + r = 1; + + out: +diff --git a/tools/tools.h b/tools/tools.h +index 4ed893f..634b101 100644 +--- a/tools/tools.h ++++ b/tools/tools.h +@@ -183,4 +183,6 @@ int mirror_remove_missing(struct cmd_context *cmd, + int vgchange_activate(struct cmd_context *cmd, struct volume_group *vg, + activation_change_t activate); + ++int vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg); ++ + #endif +diff --git a/tools/vgchange.c b/tools/vgchange.c +index 1d3c64a..d572220 100644 +--- a/tools/vgchange.c ++++ b/tools/vgchange.c +@@ -174,7 +174,7 @@ static int _vgchange_monitoring(struct cmd_context *cmd, struct volume_group *vg + return r; + } + +-static int _vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg) ++int vgchange_background_polling(struct cmd_context *cmd, struct volume_group *vg) + { + int polled; + +@@ -999,7 +999,7 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name, + + if (!arg_count(cmd, refresh_ARG) && + background_polling()) +- if (!_vgchange_background_polling(cmd, vg)) ++ if (!vgchange_background_polling(cmd, vg)) + return_ECMD_FAILED; + + if (arg_is_set(cmd, lockstart_ARG)) { diff --git a/SOURCES/lvm2-2_02_142-do-not-check-for-suspended-devices-if-scanning-for-lvmetad-update.patch b/SOURCES/lvm2-2_02_142-do-not-check-for-suspended-devices-if-scanning-for-lvmetad-update.patch new file mode 100755 index 00000000..6e6fb410 --- /dev/null +++ b/SOURCES/lvm2-2_02_142-do-not-check-for-suspended-devices-if-scanning-for-lvmetad-update.patch @@ -0,0 +1,37 @@ + WHATS_NEW | 4 ++++ + lib/filters/filter-usable.c | 9 +-------- + 2 files changed, 5 insertions(+), 8 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 0fa6bb6..945b282 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,3 +1,7 @@ ++Version 2.02.142 - ++==================================== ++ Do not check for suspended devices if scanning for lvmetad update. ++ + Version 2.02.133 - + ====================================== + Check for enough space in thin-pool in command before creating new thin. +diff --git a/lib/filters/filter-usable.c b/lib/filters/filter-usable.c +index 9377661..b24a30c 100644 +--- a/lib/filters/filter-usable.c ++++ b/lib/filters/filter-usable.c +@@ -126,15 +126,8 @@ static int _passes_usable_filter(struct dev_filter *f, struct device *dev) + break; + case FILTER_MODE_PRE_LVMETAD: + ucp.check_empty = 1; +- /* +- * If we're scanning for lvmetad update, +- * we don't want to hang on blocked/suspended devices. +- * When the device is unblocked/resumed, surely, +- * there's going to be a CHANGE event so the device +- * gets scanned via udev rule anyway after resume. +- */ + ucp.check_blocked = 1; +- ucp.check_suspended = 1; ++ ucp.check_suspended = 0; + ucp.check_error_target = 1; + ucp.check_reserved = 1; + break; diff --git a/SOURCES/lvm2-2_02_155-fix-flushing-for-mirror-target.patch b/SOURCES/lvm2-2_02_155-fix-flushing-for-mirror-target.patch new file mode 100755 index 00000000..5ecd0a8a --- /dev/null +++ b/SOURCES/lvm2-2_02_155-fix-flushing-for-mirror-target.patch @@ -0,0 +1,77 @@ + WHATS_NEW | 4 ++++ + lib/activate/activate.c | 10 ++++++++++ + lib/activate/dev_manager.c | 13 +++++++------ + 3 files changed, 21 insertions(+), 6 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 8c87a92..6441cc1 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,3 +1,7 @@ ++Version 2.02.155 - ++==================================== ++ Fix flushing for mirror target. ++ + Version 2.02.142 - + ==================================== + Do not check for suspended devices if scanning for lvmetad update. +diff --git a/lib/activate/activate.c b/lib/activate/activate.c +index 7d2adf1..8b0fcb3 100644 +--- a/lib/activate/activate.c ++++ b/lib/activate/activate.c +@@ -1900,6 +1900,16 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s, + } + } + ++ /* Flush is ATM required for the tested cases ++ * NOTE: Mirror repair requires noflush for proper repair! ++ * TODO: Relax this limiting condition further */ ++ if (!flush_required && ++ (lv_is_pvmove(ondisk_lv) || ++ (!lv_is_mirror(ondisk_lv) && !lv_is_thin_pool(ondisk_lv) && !lv_is_thin_volume(ondisk_lv)))) { ++ log_debug("Requiring flush for LV %s.", display_lvname(ondisk_lv)); ++ flush_required = 1; ++ } ++ + if (!monitor_dev_for_events(cmd, ondisk_lv, laopts, 0)) + /* FIXME Consider aborting here */ + stack; +diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c +index e1f547f..c95dfbe 100644 +--- a/lib/activate/dev_manager.c ++++ b/lib/activate/dev_manager.c +@@ -3277,7 +3277,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv, + break; + case SUSPEND: + dm_tree_skip_lockfs(root); +- if (!dm->flush_required && !lv_is_pvmove(lv)) ++ if (!dm->flush_required) + dm_tree_use_no_flush_suspend(root); + /* Fall through */ + case SUSPEND_WITH_LOCKFS: +@@ -3298,12 +3298,11 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv, + + if ((dm_tree_node_size_changed(root) < 0)) + dm->flush_required = 1; +- + /* Currently keep the code require flush for any +- * non 'thin pool/volume, mirror' or with any size change */ +- if (!lv_is_thin_volume(lv) && +- !lv_is_thin_pool(lv) && +- (!lv_is_mirror(lv) || dm_tree_node_size_changed(root))) ++ * non 'thin pool/volume' and size increase */ ++ else if (!lv_is_thin_volume(lv) && ++ !lv_is_thin_pool(lv) && ++ dm_tree_node_size_changed(root)) + dm->flush_required = 1; + + if (action == ACTIVATE) { +@@ -3347,6 +3346,8 @@ int dev_manager_activate(struct dev_manager *dm, const struct logical_volume *lv + int dev_manager_preload(struct dev_manager *dm, const struct logical_volume *lv, + struct lv_activate_opts *laopts, int *flush_required) + { ++ dm->flush_required = *flush_required; ++ + if (!_tree_action(dm, lv, laopts, PRELOAD)) + return_0; + diff --git a/SOURCES/lvm2-2_02_167-disable-lvconvert-of-thin-pool-to-raid-while-active.patch b/SOURCES/lvm2-2_02_167-disable-lvconvert-of-thin-pool-to-raid-while-active.patch new file mode 100644 index 00000000..3301d1bf --- /dev/null +++ b/SOURCES/lvm2-2_02_167-disable-lvconvert-of-thin-pool-to-raid-while-active.patch @@ -0,0 +1,32 @@ + WHATS_NEW | 4 ++++ + lib/metadata/raid_manip.c | 5 +++++ + 2 files changed, 9 insertions(+) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 977e578..5cbf4ec 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,3 +1,7 @@ ++Version 2.02.167 - ++====================================== ++ Disable lvconvert of thin pool to raid while active. ++ + Version 2.02.166 - 26th September 2016 + ====================================== + Fix lvm2-activation-generator to read all LVM2 config sources. (2.02.155) +diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c +index e5fdf4f..5fc520e 100644 +--- a/lib/metadata/raid_manip.c ++++ b/lib/metadata/raid_manip.c +@@ -776,6 +776,11 @@ static int _raid_add_images_without_commit(struct logical_volume *lv, + return 0; + } + ++ if (lv_is_active(lv_lock_holder(lv)) && (old_count == 1) && (lv_is_thin_pool_data(lv) || lv_is_thin_pool_metadata(lv))) { ++ log_error("Can't add image to active thin pool LV %s yet. Deactivate first.", display_lvname(lv)); ++ return 0; ++ } ++ + if (!archive(lv->vg)) + return_0; + diff --git a/SOURCES/lvm2-2_02_167-fix-inability-of-lvconvert-repair-for-cache-raid-volumes.patch b/SOURCES/lvm2-2_02_167-fix-inability-of-lvconvert-repair-for-cache-raid-volumes.patch new file mode 100644 index 00000000..8dc2754a --- /dev/null +++ b/SOURCES/lvm2-2_02_167-fix-inability-of-lvconvert-repair-for-cache-raid-volumes.patch @@ -0,0 +1,27 @@ +@@ -, +, @@ + convert internal LV" +--- + tools/lvconvert.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) +--- a/tools/lvconvert.c ++++ a/tools/lvconvert.c +@@ -243,6 +243,7 @@ static int _lvconvert_name_params(struct lvconvert_params *lp, + !strstr(lp->lv_name, "_tmeta") && + !strstr(lp->lv_name, "_cdata") && + !strstr(lp->lv_name, "_cmeta") && ++ !strstr(lp->lv_name, "_corig") && + !apply_lvname_restrictions(lp->lv_name)) + return_0; + +@@ -4440,7 +4441,8 @@ static int _lvconvert(struct cmd_context *cmd, struct logical_volume *lv, + !lv_is_thin_pool_metadata(lv) && + !lv_is_thin_pool_data(lv) && + !lv_is_used_cache_pool(lv) && +- !lv_is_raid_image(lv)) { ++ !lv_is_raid_image(lv) && ++ !(lv_is_raid(lv) && strstr(lv->name, "_corig"))) { + log_error("Cannot convert internal LV %s.", display_lvname(lv)); + ret = 0; + goto out; +-- + diff --git a/SOURCES/lvm2-2_02_167-fix-raid4-coversion-from-striped.patch b/SOURCES/lvm2-2_02_167-fix-raid4-coversion-from-striped.patch new file mode 100644 index 00000000..11dd7db4 --- /dev/null +++ b/SOURCES/lvm2-2_02_167-fix-raid4-coversion-from-striped.patch @@ -0,0 +1,532 @@ + WHATS_NEW | 2 + + lib/metadata/raid_manip.c | 277 +++++++++++++++++++++++++++++++--- + test/shell/lvconvert-raid-takeover.sh | 53 ++++++- + tools/lvconvert.c | 24 +-- + 4 files changed, 314 insertions(+), 42 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 5cbf4ec..6a0c311 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,7 @@ + Version 2.02.167 - + ====================================== ++ Add direct striped -> raid4 conversion ++ Fix raid4 parity image pair position on conversions from striped/raid0* + Disable lvconvert of thin pool to raid while active. + + Version 2.02.166 - 26th September 2016 +diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c +index 5fc520e..e5fd195 100644 +--- a/lib/metadata/raid_manip.c ++++ b/lib/metadata/raid_manip.c +@@ -2459,7 +2459,7 @@ static struct lv_segment *_convert_striped_to_raid0(struct logical_volume *lv, + 0 /* chunk_size */, + 0 /* seg->region_size */, 0u /* extents_copied */ , + NULL /* pvmove_source_seg */))) { +- log_error("Failed to allocate new raid0 segement for LV %s.", display_lvname(lv)); ++ log_error("Failed to allocate new raid0 segment for LV %s.", display_lvname(lv)); + return NULL; + } + +@@ -2519,42 +2519,51 @@ static struct possible_takeover_reshape_type _possible_takeover_reshape_types[] + { .current_types = SEG_STRIPED_TARGET, /* linear, i.e. seg->area_count = 1 */ + .possible_types = SEG_RAID1, + .current_areas = 1, +- .options = ALLOW_NONE }, ++ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */ + { .current_types = SEG_STRIPED_TARGET, /* linear, i.e. seg->area_count = 1 */ + .possible_types = SEG_RAID0|SEG_RAID0_META, + .current_areas = 1, + .options = ALLOW_STRIPE_SIZE }, +- { .current_types = SEG_STRIPED_TARGET, /* striped, i.e. seg->area_count > 1 */ ++ { .current_types = SEG_STRIPED_TARGET, /* striped -> raid0*, i.e. seg->area_count > 1 */ + .possible_types = SEG_RAID0|SEG_RAID0_META, + .current_areas = ~0U, + .options = ALLOW_NONE }, ++ { .current_types = SEG_STRIPED_TARGET, /* striped -> raid4 , i.e. seg->area_count > 1 */ ++ .possible_types = SEG_RAID4, ++ .current_areas = ~0U, ++ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */ + /* raid0* -> */ + { .current_types = SEG_RAID0|SEG_RAID0_META, /* seg->area_count = 1 */ + .possible_types = SEG_RAID1, + .current_areas = 1, ++ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */ ++ { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0* -> striped, i.e. seg->area_count > 1 */ ++ .possible_types = SEG_STRIPED_TARGET, ++ .current_areas = ~0U, + .options = ALLOW_NONE }, +- { .current_types = SEG_RAID0|SEG_RAID0_META, /* seg->area_count > 1 */ +- .possible_types = SEG_RAID4, ++ { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0* -> raid0*, i.e. seg->area_count > 1 */ ++ .possible_types = SEG_RAID0_META|SEG_RAID0, + .current_areas = ~0U, + .options = ALLOW_NONE }, +- { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0 striped, i.e. seg->area_count > 0 */ ++ { .current_types = SEG_RAID0|SEG_RAID0_META, /* raid0* -> raid4, i.e. seg->area_count > 1 */ ++ .possible_types = SEG_RAID4, ++ .current_areas = ~0U, ++ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */ ++ /* raid4 -> -> */ ++ { .current_types = SEG_RAID4, /* raid4 ->striped/raid0*, i.e. seg->area_count > 1 */ + .possible_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META, + .current_areas = ~0U, + .options = ALLOW_NONE }, +- /* raid1 -> */ ++ /* raid1 -> mirror */ + { .current_types = SEG_RAID1, +- .possible_types = SEG_RAID1|SEG_MIRROR, ++ .possible_types = SEG_MIRROR, + .current_areas = ~0U, +- .options = ALLOW_NONE }, ++ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */ + /* mirror -> raid1 with arbitrary number of legs */ + { .current_types = SEG_MIRROR, +- .possible_types = SEG_MIRROR|SEG_RAID1, +- .current_areas = ~0U, +- .options = ALLOW_NONE }, +- { .current_types = SEG_RAID4, +- .possible_types = SEG_STRIPED_TARGET|SEG_RAID0|SEG_RAID0_META, ++ .possible_types = SEG_RAID1, + .current_areas = ~0U, +- .options = ALLOW_NONE }, ++ .options = ALLOW_NONE }, /* FIXME: ALLOW_REGION_SIZE */ + + /* END */ + { .current_types = 0 } +@@ -2861,9 +2870,176 @@ static int _raid1_to_mirrored_wrapper(TAKEOVER_FN_ARGS) + allocate_pvs, 1, &removal_lvs); + } + ++/* ++ * HM Helper: (raid0_meta -> raid4) ++ * ++ * To convert raid0_meta to raid4, which involves shifting the ++ * parity device to lv segment area 0 and thus changing MD ++ * array roles, detach the MetaLVs and reload as raid0 in ++ * order to wipe them then reattach and set back to raid0_meta. ++ */ ++static int _clear_meta_lvs(struct logical_volume *lv) ++{ ++ uint32_t s; ++ struct lv_segment *seg = first_seg(lv); ++ struct lv_segment_area *tmp_areas; ++ const struct segment_type *tmp_segtype; ++ struct dm_list meta_lvs; ++ struct lv_list *lvl_array, *lvl; ++ ++ /* Reject non-raid0_meta segment types cautiously */ ++ if (!seg_is_raid0_meta(seg) || ++ !seg->meta_areas) ++ return_0; ++ ++ if (!(lvl_array = dm_pool_alloc(lv->vg->vgmem, seg->area_count * sizeof(*lvl_array)))) ++ return_0; ++ ++ dm_list_init(&meta_lvs); ++ tmp_areas = seg->meta_areas; ++ ++ /* Extract all MetaLVs listing them on @meta_lvs */ ++ log_debug_metadata("Extracting all MetaLVs of %s to activate as raid0", ++ display_lvname(lv)); ++ if (!_extract_image_component_sublist(seg, RAID_META, 0, seg->area_count, &meta_lvs, 0)) ++ return_0; ++ ++ /* Memorize meta areas and segtype to set again after initializing. */ ++ seg->meta_areas = NULL; ++ tmp_segtype = seg->segtype; ++ ++ if (!(seg->segtype = get_segtype_from_flag(lv->vg->cmd, SEG_RAID0)) || ++ !lv_update_and_reload(lv)) ++ return_0; ++ ++ /* ++ * Now deactivate the MetaLVs before clearing, so ++ * that _clear_lvs() will activate them visible. ++ */ ++ log_debug_metadata("Deactivating pulled out MetaLVs of %s before initializing.", ++ display_lvname(lv)); ++ dm_list_iterate_items(lvl, &meta_lvs) ++ if (!deactivate_lv(lv->vg->cmd, lvl->lv)) ++ return_0; ++ ++ log_debug_metadata("Clearing allocated raid0_meta metadata LVs for conversion to raid4"); ++ if (!_clear_lvs(&meta_lvs)) { ++ log_error("Failed to initialize metadata LVs"); ++ return 0; ++ } ++ ++ /* Set memorized meta areas and raid0_meta segtype */ ++ seg->meta_areas = tmp_areas; ++ seg->segtype = tmp_segtype; ++ ++ log_debug_metadata("Adding metadata LVs back into %s", display_lvname(lv)); ++ s = 0; ++ dm_list_iterate_items(lvl, &meta_lvs) { ++ lv_set_hidden(lvl->lv); ++ if (!set_lv_segment_area_lv(seg, s++, lvl->lv, 0, RAID_META)) ++ return 0; ++ } ++ ++ return 1; ++} ++ ++/* ++ * HM Helper: (raid0* <-> raid4) ++ * ++ * Rename SubLVs (pairs) allowing to shift names w/o collisions with active ones. ++ */ ++#define SLV_COUNT 2 ++static int _rename_area_lvs(struct logical_volume *lv, const char *suffix) ++{ ++ uint32_t s; ++ size_t sz = strlen("rimage") + (suffix ? strlen(suffix) : 0) + 1; ++ char *sfx[SLV_COUNT] = { NULL, NULL }; ++ struct lv_segment *seg = first_seg(lv); ++ ++ /* Create _generate_raid_name() suffixes w/ or w/o passed in @suffix */ ++ for (s = 0; s < SLV_COUNT; s++) ++ if (!(sfx[s] = dm_pool_alloc(lv->vg->cmd->mem, sz)) || ++ dm_snprintf(sfx[s], sz, suffix ? "%s%s" : "%s", s ? "rmeta" : "rimage", suffix) < 0) ++ return_0; ++ ++ /* Change names (temporarily) to be able to shift numerical name suffixes */ ++ for (s = 0; s < seg->area_count; s++) { ++ if (!(seg_lv(seg, s)->name = _generate_raid_name(lv, sfx[0], s))) ++ return_0; ++ if (seg->meta_areas && ++ !(seg_metalv(seg, s)->name = _generate_raid_name(lv, sfx[1], s))) ++ return_0; ++ } ++ ++ for (s = 0; s < SLV_COUNT; s++) ++ dm_pool_free(lv->vg->cmd->mem, sfx[s]); ++ ++ return 1; ++} ++ ++/* ++ * HM Helper: (raid0* <-> raid4) ++ * ++ * Switch area LVs in lv segment @seg indexed by @s1 and @s2 ++ */ ++static void _switch_area_lvs(struct lv_segment *seg, uint32_t s1, uint32_t s2) ++{ ++ struct logical_volume *lvt; ++ ++ lvt = seg_lv(seg, s1); ++ seg_lv(seg, s1) = seg_lv(seg, s2); ++ seg_lv(seg, s2) = lvt; ++ ++ /* Be cautious */ ++ if (seg->meta_areas) { ++ lvt = seg_metalv(seg, s1); ++ seg_metalv(seg, s1) = seg_metalv(seg, s2); ++ seg_metalv(seg, s2) = lvt; ++ } ++} ++ ++/* ++ * HM Helper: ++ * ++ * shift range of area LVs in @seg in range [ @s1, @s2 ] up if @s1 < @s2, ++ * else down bubbling the parity SubLVs up/down whilst shifting. ++ */ ++static void _shift_area_lvs(struct lv_segment *seg, uint32_t s1, uint32_t s2) ++{ ++ uint32_t s; ++ ++ if (s1 < s2) ++ /* Forward shift n+1 -> n */ ++ for (s = s1; s < s2; s++) ++ _switch_area_lvs(seg, s, s + 1); ++ else ++ /* Reverse shift n-1 -> n */ ++ for (s = s1; s > s2; s--) ++ _switch_area_lvs(seg, s, s - 1); ++} ++ ++/* ++ * Switch position of first and last area lv within ++ * @lv to move parity SubLVs from end to end. ++ * ++ * Direction depends on segment type raid4 / raid0_meta. ++ */ ++static int _shift_parity_dev(struct lv_segment *seg) ++{ ++ if (seg_is_raid0_meta(seg)) ++ _shift_area_lvs(seg, seg->area_count - 1, 0); ++ else if (seg_is_raid4(seg)) ++ _shift_area_lvs(seg, 0, seg->area_count - 1); ++ else ++ return 0; ++ ++ return 1; ++} ++ + /* raid45 -> raid0* / striped */ + static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS) + { ++ int rename_sublvs = 0; + struct lv_segment *seg = first_seg(lv); + struct dm_list removal_lvs; + +@@ -2879,10 +3055,39 @@ static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS) + if (!_raid_in_sync(lv)) + return 0; + ++ if (!yes && yes_no_prompt("Are you sure you want to convert \"%s\" LV %s to \"%s\" " ++ "type using all resilience? [y/n]: ", ++ lvseg_name(seg), display_lvname(lv), new_segtype->name) == 'n') { ++ log_error("Logical volume %s NOT converted to \"%s\"", ++ display_lvname(lv), new_segtype->name); ++ return 0; ++ } ++ if (sigint_caught()) ++ return_0; ++ + /* Archive metadata */ + if (!archive(lv->vg)) + return_0; + ++ /* ++ * raid4 (which actually gets mapped to raid5/dedicated first parity disk) ++ * needs shifting of SubLVs to move the parity SubLV pair in the first area ++ * to the last one before conversion to raid0[_meta]/striped to allow for ++ * SubLV removal from the end of the areas arrays. ++ */ ++ if (seg_is_raid4(seg)) { ++ /* Shift parity SubLV pair "PDD..." -> "DD...P" to be able to remove it off the end */ ++ if (!_shift_parity_dev(seg)) ++ return 0; ++ ++ if (segtype_is_any_raid0(new_segtype) && ++ !(rename_sublvs = _rename_area_lvs(lv, "_"))) { ++ log_error("Failed to rename %s LV %s MetaLVs", lvseg_name(seg), display_lvname(lv)); ++ return 0; ++ } ++ ++ } ++ + /* Remove meta and data LVs requested */ + if (!_lv_raid_change_image_count(lv, new_image_count, allocate_pvs, &removal_lvs, 0, 0)) + return 0; +@@ -2902,7 +3107,19 @@ static int _raid456_to_raid0_or_striped_wrapper(TAKEOVER_FN_ARGS) + + seg->region_size = 0; + +- return _lv_update_reload_fns_reset_eliminate_lvs(lv, &removal_lvs); ++ if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, &removal_lvs)) ++ return_0; ++ ++ if (rename_sublvs) { ++ if (!_rename_area_lvs(lv, NULL)) { ++ log_error("Failed to rename %s LV %s MetaLVs", lvseg_name(seg), display_lvname(lv)); ++ return 0; ++ } ++ if (!lv_update_and_reload(lv)) ++ return_0; ++ } ++ ++ return 1; + } + + static int _striped_to_raid0_wrapper(struct logical_volume *lv, +@@ -2930,6 +3147,9 @@ static int _striped_to_raid0_wrapper(struct logical_volume *lv, + static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS) + { + struct lv_segment *seg = first_seg(lv); ++ struct dm_list removal_lvs; ++ ++ dm_list_init(&removal_lvs); + + if (seg_is_raid10(seg)) + return _takeover_unsupported_yet(lv, new_stripes, new_segtype); +@@ -2944,6 +3164,13 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS) + return 0; + } + ++ /* FIXME: restricted to raid4 for the time being... */ ++ if (!segtype_is_raid4(new_segtype)) { ++ /* Can't convert striped/raid0* to e.g. raid10_offset */ ++ log_error("Can't convert %s to %s", display_lvname(lv), new_segtype->name); ++ return 0; ++ } ++ + /* Archive metadata */ + if (!archive(lv->vg)) + return_0; +@@ -2961,7 +3188,10 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS) + log_debug_metadata("Adding metadata LVs to %s", display_lvname(lv)); + if (!_raid0_add_or_remove_metadata_lvs(lv, 1 /* update_and_reload */, allocate_pvs, NULL)) + return 0; +- } ++ /* raid0_meta -> raid4 needs clearing of MetaLVs in order to avoid raid disk role cahnge issues in the kernel */ ++ } else if (segtype_is_raid4(new_segtype) && ++ !_clear_meta_lvs(lv)) ++ return 0; + + /* Add the additional component LV pairs */ + log_debug_metadata("Adding %" PRIu32 " component LV pair(s) to %s", new_image_count - lv_raid_image_count(lv), +@@ -2969,8 +3199,9 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS) + if (!_lv_raid_change_image_count(lv, new_image_count, allocate_pvs, NULL, 0, 1)) + return 0; + +- if (!segtype_is_raid4(new_segtype)) { +- /* Can't convert striped/raid0* to e.g. raid10_offset */ ++ if (segtype_is_raid4(new_segtype) && ++ (!_shift_parity_dev(seg) || ++ !_rename_area_lvs(lv, "_"))) { + log_error("Can't convert %s to %s", display_lvname(lv), new_segtype->name); + return 0; + } +@@ -2987,6 +3218,14 @@ static int _striped_or_raid0_to_raid45610_wrapper(TAKEOVER_FN_ARGS) + if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, NULL)) + return_0; + ++ if (segtype_is_raid4(new_segtype)) { ++ /* We had to rename SubLVs because of collision free sgifting, rename back... */ ++ if (!_rename_area_lvs(lv, NULL)) ++ return 0; ++ if (!lv_update_and_reload(lv)) ++ return_0; ++ } ++ + return 1; + } + +diff --git a/test/shell/lvconvert-raid-takeover.sh b/test/shell/lvconvert-raid-takeover.sh +index 19a65d3..0140e22 100644 +--- a/test/shell/lvconvert-raid-takeover.sh ++++ b/test/shell/lvconvert-raid-takeover.sh +@@ -78,22 +78,58 @@ aux wait_for_sync $vg $lv1 + # Clean up + lvremove --yes $vg/$lv1 + +-# Create 3-way raid0 +-lvcreate -y -aey --type raid0 -i 3 -L 64M -n $lv1 $vg +-check lv_field $vg/$lv1 segtype "raid0" ++# Create 3-way striped ++lvcreate -y -aey --type striped -i 3 -L 64M -n $lv1 $vg ++check lv_field $vg/$lv1 segtype "striped" + check lv_field $vg/$lv1 stripes 3 + echo y | mkfs -t ext4 /dev/mapper/$vg-$lv1 + fsck -fn /dev/mapper/$vg-$lv1 + +-# Convert raid0 -> raid4 ++# Create 3-way raid0 ++lvcreate -y -aey --type raid0 -i 3 -L 64M -n $lv2 $vg ++check lv_field $vg/$lv2 segtype "raid0" ++check lv_field $vg/$lv2 stripes 3 ++echo y | mkfs -t ext4 /dev/mapper/$vg-$lv2 ++fsck -fn /dev/mapper/$vg-$lv2 ++ ++# Create 3-way raid0_meta ++lvcreate -y -aey --type raid0_meta -i 3 -L 64M -n $lv3 $vg ++check lv_field $vg/$lv3 segtype "raid0_meta" ++check lv_field $vg/$lv3 stripes 3 ++echo y | mkfs -t ext4 /dev/mapper/$vg-$lv3 ++fsck -fn /dev/mapper/$vg-$lv3 ++ ++# Create 3-way raid4 ++lvcreate -y -aey --type raid4 -i 3 -L 64M -n $lv4 $vg ++check lv_field $vg/$lv4 segtype "raid4" ++check lv_field $vg/$lv4 stripes 4 ++echo y | mkfs -t ext4 /dev/mapper/$vg-$lv4 ++fsck -fn /dev/mapper/$vg-$lv4 ++aux wait_for_sync $vg $lv4 ++fsck -fn /dev/mapper/$vg-$lv4 ++ ++# Convert raid4 -> striped (correct raid4 mapping test!) ++lvconvert -y --ty striped $vg/$lv4 ++check lv_field $vg/$lv4 segtype "striped" ++check lv_field $vg/$lv4 stripes 3 ++fsck -fn /dev/mapper/$vg-$lv4 ++ ++# Convert striped -> raid4 + lvconvert -y --ty raid4 $vg/$lv1 +-lvchange --refresh $vg/$lv1 + check lv_field $vg/$lv1 segtype "raid4" + check lv_field $vg/$lv1 stripes 4 + fsck -fn /dev/mapper/$vg-$lv1 + aux wait_for_sync $vg $lv1 + fsck -fn /dev/mapper/$vg-$lv1 + ++# Convert raid0 -> raid4 ++lvconvert -y --ty raid4 $vg/$lv2 ++check lv_field $vg/$lv2 segtype "raid4" ++check lv_field $vg/$lv2 stripes 4 ++fsck -fn /dev/mapper/$vg-$lv2 ++aux wait_for_sync $vg $lv2 ++fsck -fn /dev/mapper/$vg-$lv2 ++ + # Convert raid4 -> raid0_meta + lvconvert -y --ty raid0_meta $vg/$lv1 + check lv_field $vg/$lv1 segtype "raid0_meta" +@@ -116,11 +152,16 @@ fsck -fn /dev/mapper/$vg-$lv1 + + # Convert raid0 -> raid4 + lvconvert -y --ty raid4 $vg/$lv1 +-lvchange --refresh $vg/$lv1 + check lv_field $vg/$lv1 segtype "raid4" + check lv_field $vg/$lv1 stripes 4 + fsck -fn /dev/mapper/$vg-$lv1 + aux wait_for_sync $vg $lv1 + fsck -fn /dev/mapper/$vg-$lv1 + ++# Convert raid4 -> striped ++lvconvert -y --ty striped $vg/$lv1 ++check lv_field $vg/$lv1 segtype "striped" ++check lv_field $vg/$lv1 stripes 3 ++fsck -fn /dev/mapper/$vg-$lv1 ++ + vgremove -ff $vg +diff --git a/tools/lvconvert.c b/tools/lvconvert.c +index 0d2a4d1..541df72 100644 +--- a/tools/lvconvert.c ++++ b/tools/lvconvert.c +@@ -1931,7 +1931,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l + return 1; + } + goto try_new_takeover_or_reshape; +- } else if (!lp->repair && !lp->replace && (!*lp->type_str || seg->segtype == lp->segtype)) { ++ } else if (!lp->repair && !lp->replace && !*lp->type_str) { + log_error("Conversion operation not yet supported."); + return 0; + } +@@ -2017,28 +2017,18 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l + return 1; + } + +- + try_new_takeover_or_reshape: +- + /* FIXME This needs changing globally. */ + if (!arg_is_set(cmd, stripes_long_ARG)) + lp->stripes = 0; + +- /* Only let raid4 through for now. */ +- if (lp->type_str && lp->type_str[0] && lp->segtype != seg->segtype && +- ((seg_is_raid4(seg) && seg_is_striped(lp) && lp->stripes > 1) || +- (seg_is_striped(seg) && seg->area_count > 1 && seg_is_raid4(lp)))) { +- if (!lv_raid_convert(lv, lp->segtype, lp->yes, lp->force, lp->stripes, lp->stripe_size_supplied, lp->stripe_size, +- lp->region_size, lp->pvh)) +- return_0; +- +- log_print_unless_silent("Logical volume %s successfully converted.", +- display_lvname(lv)); +- return 1; +- } ++ if (!lv_raid_convert(lv, lp->segtype, lp->yes, lp->force, lp->stripes, lp->stripe_size_supplied, lp->stripe_size, ++ lp->region_size, lp->pvh)) ++ return_0; + +- log_error("Conversion operation not yet supported."); +- return 0; ++ log_print_unless_silent("Logical volume %s successfully converted.", ++ display_lvname(lv)); ++ return 1; + } + + static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volume *cow, diff --git a/SOURCES/lvm2-2_02_167-prevent-raid4-creation-and-conversion-on-non-supporting-kernels.patch b/SOURCES/lvm2-2_02_167-prevent-raid4-creation-and-conversion-on-non-supporting-kernels.patch new file mode 100644 index 00000000..93eb82ef --- /dev/null +++ b/SOURCES/lvm2-2_02_167-prevent-raid4-creation-and-conversion-on-non-supporting-kernels.patch @@ -0,0 +1,303 @@ + WHATS_NEW | 1 + + lib/activate/activate.c | 25 +++++++++++++++++++++++++ + lib/activate/activate.h | 3 ++- + lib/metadata/lv.c | 16 +++++++++++++++- + lib/metadata/segtype.h | 3 ++- + lib/raid/raid.c | 10 ++++++++-- + test/shell/lvconvert-raid-takeover.sh | 13 +++++++++++++ + tools/lvconvert.c | 26 ++++++++++++++++++++++++++ + tools/lvcreate.c | 6 ++++++ + 9 files changed, 98 insertions(+), 5 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 6a0c311..519bbc9 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.167 - + ====================================== ++ Prevent raid4 creation/conversion on non-supporting kernels + Add direct striped -> raid4 conversion + Fix raid4 parity image pair position on conversions from striped/raid0* + Disable lvconvert of thin pool to raid while active. +diff --git a/lib/activate/activate.c b/lib/activate/activate.c +index 5550955..571f2b2 100644 +--- a/lib/activate/activate.c ++++ b/lib/activate/activate.c +@@ -370,6 +370,11 @@ void activation_exit(void) + { + } + ++int raid4_is_supported(struct cmd_context *cmd, const struct segment_type *segtype) ++{ ++ return 1; ++} ++ + int lv_is_active(const struct logical_volume *lv) + { + return 0; +@@ -1489,6 +1494,26 @@ out: + return r || l; + } + ++/* ++ * Check if "raid4" @segtype is supported by kernel. ++ * ++ * if segment type is not raid4, return 1. ++ */ ++int raid4_is_supported(struct cmd_context *cmd, const struct segment_type *segtype) ++{ ++ unsigned attrs; ++ ++ if (segtype_is_raid4(segtype) && ++ (!segtype->ops->target_present || ++ !segtype->ops->target_present(cmd, NULL, &attrs) || ++ !(attrs & RAID_FEATURE_RAID4))) { ++ log_error("RAID module does not support RAID4."); ++ return 0; ++ } ++ ++ return 1; ++} ++ + int lv_is_active(const struct logical_volume *lv) + { + return _lv_is_active(lv, NULL, NULL, NULL); +diff --git a/lib/activate/activate.h b/lib/activate/activate.h +index 1e8d7a8..3922d78 100644 +--- a/lib/activate/activate.h ++++ b/lib/activate/activate.h +@@ -1,6 +1,6 @@ + /* + * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. +- * Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved. ++ * Copyright (C) 2004-2016 Red Hat, Inc. All rights reserved. + * + * This file is part of LVM2. + * +@@ -99,6 +99,7 @@ int target_present(struct cmd_context *cmd, const char *target_name, + int use_modprobe); + int target_version(const char *target_name, uint32_t *maj, + uint32_t *min, uint32_t *patchlevel); ++int raid4_is_supported(struct cmd_context *cmd, const struct segment_type *segtype); + int lvm_dm_prefix_check(int major, int minor, const char *prefix); + int list_segment_modules(struct dm_pool *mem, const struct lv_segment *seg, + struct dm_list *modules); +diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c +index 53a1044..0f1b6e7 100644 +--- a/lib/metadata/lv.c ++++ b/lib/metadata/lv.c +@@ -1,6 +1,6 @@ + /* + * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. +- * Copyright (C) 2004-2013 Red Hat, Inc. All rights reserved. ++ * Copyright (C) 2004-2016 Red Hat, Inc. All rights reserved. + * + * This file is part of LVM2. + * +@@ -1425,6 +1425,7 @@ int lv_active_change(struct cmd_context *cmd, struct logical_volume *lv, + enum activation_change activate, int needs_exclusive) + { + const char *ay_with_mode = NULL; ++ struct lv_segment *seg = first_seg(lv); + + if (activate == CHANGE_ASY) + ay_with_mode = "sh"; +@@ -1461,6 +1462,9 @@ deactivate: + break; + case CHANGE_ALY: + case CHANGE_AAY: ++ if (!raid4_is_supported(cmd, seg->segtype)) ++ goto no_raid4; ++ + if (needs_exclusive || _lv_is_exclusive(lv)) { + log_verbose("Activating logical volume %s exclusively locally.", + display_lvname(lv)); +@@ -1475,6 +1479,9 @@ deactivate: + break; + case CHANGE_AEY: + exclusive: ++ if (!raid4_is_supported(cmd, seg->segtype)) ++ goto no_raid4; ++ + log_verbose("Activating logical volume %s exclusively.", + display_lvname(lv)); + if (!activate_lv_excl(cmd, lv)) +@@ -1483,6 +1490,9 @@ exclusive: + case CHANGE_ASY: + case CHANGE_AY: + default: ++ if (!raid4_is_supported(cmd, seg->segtype)) ++ goto no_raid4; ++ + if (needs_exclusive || _lv_is_exclusive(lv)) + goto exclusive; + log_verbose("Activating logical volume %s.", display_lvname(lv)); +@@ -1495,6 +1505,10 @@ exclusive: + log_error("Failed to unlock logical volume %s.", display_lvname(lv)); + + return 1; ++ ++no_raid4: ++ log_error("Failed to activate %s LV %s", lvseg_name(seg), display_lvname(lv)); ++ return 0; + } + + char *lv_active_dup(struct dm_pool *mem, const struct logical_volume *lv) +diff --git a/lib/metadata/segtype.h b/lib/metadata/segtype.h +index 9ca740d..292b8b6 100644 +--- a/lib/metadata/segtype.h ++++ b/lib/metadata/segtype.h +@@ -1,6 +1,6 @@ + /* + * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. +- * Copyright (C) 2004-2015 Red Hat, Inc. All rights reserved. ++ * Copyright (C) 2004-2016 Red Hat, Inc. All rights reserved. + * + * This file is part of LVM2. + * +@@ -268,6 +268,7 @@ struct segment_type *init_unknown_segtype(struct cmd_context *cmd, + #define RAID_FEATURE_RAID10 (1U << 0) /* version 1.3 */ + #define RAID_FEATURE_RAID0 (1U << 1) /* version 1.7 */ + #define RAID_FEATURE_RESHAPING (1U << 2) /* version 1.8 */ ++#define RAID_FEATURE_RAID4 (1U << 3) /* ! version 1.8 or 1.9.0 */ + + #ifdef RAID_INTERNAL + int init_raid_segtypes(struct cmd_context *cmd, struct segtype_library *seglib); +diff --git a/lib/raid/raid.c b/lib/raid/raid.c +index 3bc3c75..92a96a3 100644 +--- a/lib/raid/raid.c ++++ b/lib/raid/raid.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2011-2013 Red Hat, Inc. All rights reserved. ++ * Copyright (C) 2011-2016 Red Hat, Inc. All rights reserved. + * + * This file is part of LVM2. + * +@@ -366,7 +366,7 @@ static int _raid_target_present(struct cmd_context *cmd, + + static int _raid_checked = 0; + static int _raid_present = 0; +- static int _raid_attrs = 0; ++ static unsigned _raid_attrs = 0; + uint32_t maj, min, patchlevel; + unsigned i; + +@@ -389,6 +389,12 @@ static int _raid_target_present(struct cmd_context *cmd, + else + log_very_verbose("Target raid does not support %s.", + _features[i].feature); ++ ++ if (!(maj == 1 && (min == 8 || (min == 9 && patchlevel == 0)))) ++ _raid_attrs |= RAID_FEATURE_RAID4; ++ else ++ log_very_verbose("Target raid does not support %s.", ++ SEG_TYPE_NAME_RAID4); + } + + if (attributes) +diff --git a/test/shell/lvconvert-raid-takeover.sh b/test/shell/lvconvert-raid-takeover.sh +index 0140e22..332786d 100644 +--- a/test/shell/lvconvert-raid-takeover.sh ++++ b/test/shell/lvconvert-raid-takeover.sh +@@ -16,6 +16,8 @@ SKIP_WITH_LVMPOLLD=1 + + aux have_raid 1 9 0 || skip + ++[ `aux have_raid 1.9.1` ] && correct_raid4_layout=1 ++ + aux prepare_vg 9 288 + + # Delay 1st leg so that rebuilding status characters +@@ -99,6 +101,9 @@ check lv_field $vg/$lv3 stripes 3 + echo y | mkfs -t ext4 /dev/mapper/$vg-$lv3 + fsck -fn /dev/mapper/$vg-$lv3 + ++if [ $correct_raid4_layout -eq 1 ] ++then ++ + # Create 3-way raid4 + lvcreate -y -aey --type raid4 -i 3 -L 64M -n $lv4 $vg + check lv_field $vg/$lv4 segtype "raid4" +@@ -164,4 +169,12 @@ check lv_field $vg/$lv1 segtype "striped" + check lv_field $vg/$lv1 stripes 3 + fsck -fn /dev/mapper/$vg-$lv1 + ++else ++ ++not lvcreate -y -aey --type raid4 -i 3 -L 64M -n $lv4 $vg ++not lvconvert -y --ty raid4 $vg/$lv1 ++not lvconvert -y --ty raid4 $vg/$lv2 ++ ++fi ++ + vgremove -ff $vg +diff --git a/tools/lvconvert.c b/tools/lvconvert.c +index 541df72..7a4215a 100644 +--- a/tools/lvconvert.c ++++ b/tools/lvconvert.c +@@ -1821,6 +1821,25 @@ static void _lvconvert_raid_repair_ask(struct cmd_context *cmd, + } + } + ++/* Check for dm-raid target supporting raid4 conversion properly. */ ++static int _raid4_conversion_supported(struct logical_volume *lv, struct lvconvert_params *lp) ++{ ++ int ret = 1; ++ struct lv_segment *seg = first_seg(lv); ++ ++ if (seg_is_raid4(seg)) ++ ret = raid4_is_supported(lv->vg->cmd, seg->segtype); ++ else if (segtype_is_raid4(lp->segtype)) ++ ret = raid4_is_supported(lv->vg->cmd, lp->segtype); ++ ++ if (ret) ++ return 1; ++ ++ log_error("Cannot convert %s LV %s to %s.", ++ lvseg_name(seg), display_lvname(lv), lp->segtype->name); ++ return 0; ++} ++ + static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *lp) + { + int replace = 0, image_count = 0; +@@ -1945,6 +1964,9 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l + return 0; + } + ++ if (!_raid4_conversion_supported(lv, lp)) ++ return 0; ++ + if (!arg_is_set(cmd, stripes_long_ARG)) + lp->stripes = 0; + +@@ -2018,6 +2040,10 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l + } + + try_new_takeover_or_reshape: ++ ++ if (!_raid4_conversion_supported(lv, lp)) ++ return 0; ++ + /* FIXME This needs changing globally. */ + if (!arg_is_set(cmd, stripes_long_ARG)) + lp->stripes = 0; +diff --git a/tools/lvcreate.c b/tools/lvcreate.c +index 387c8d4..dbc0708 100644 +--- a/tools/lvcreate.c ++++ b/tools/lvcreate.c +@@ -1054,6 +1054,12 @@ static int _lvcreate_params(struct cmd_context *cmd, + return 0; + } + ++ if (segtype_is_raid4(lp->segtype) && ++ !(lp->target_attr & RAID_FEATURE_RAID4)) { ++ log_error("RAID module does not support RAID4."); ++ return 0; ++ } ++ + if (segtype_is_raid10(lp->segtype) && !(lp->target_attr & RAID_FEATURE_RAID10)) { + log_error("RAID module does not support RAID10."); + return 0; diff --git a/SOURCES/lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch b/SOURCES/lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch new file mode 100644 index 00000000..c7247729 --- /dev/null +++ b/SOURCES/lvm2-2_02_169-clvmd-add-mutex-protection-for-cpg_-call.patch @@ -0,0 +1,49 @@ +From dae4f53acb269219e876c229c8f034fcdaf3ff5a Mon Sep 17 00:00:00 2001 +From: Zdenek Kabelac +Date: Sat, 4 Feb 2017 14:47:27 +0100 +Subject: [PATCH] clvmd: add mutex protection for cpg_ call + +The library for corosync multicasting is not supporting multithread +usage - add local mutex to avoid parallel call of cpg_mcast_joined(). +--- + WHATS_NEW | 1 + + daemons/clvmd/clvmd-corosync.c | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 8ae2df8..0b571ae 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.169 - + ===================================== ++ Avoid parallel usage of cpg_mcast_joined() in clvmd with corosync. + Fix segfault in lvmetad from missing NULL in daemon_reply_simple. + + Version 2.02.167 - +diff --git a/daemons/clvmd/clvmd-corosync.c b/daemons/clvmd/clvmd-corosync.c +index 05c9882..2227cbf 100644 +--- a/daemons/clvmd/clvmd-corosync.c ++++ b/daemons/clvmd/clvmd-corosync.c +@@ -532,6 +532,7 @@ static int _cluster_fd_callback(struct local_client *fd, char *buf, int len, + static int _cluster_send_message(const void *buf, int msglen, const char *csid, + const char *errtext) + { ++ static pthread_mutex_t _mutex = PTHREAD_MUTEX_INITIALIZER; + struct iovec iov[2]; + cs_error_t err; + int target_node; +@@ -546,7 +547,10 @@ static int _cluster_send_message(const void *buf, int msglen, const char *csid, + iov[1].iov_base = (char *)buf; + iov[1].iov_len = msglen; + ++ pthread_mutex_lock(&_mutex); + err = cpg_mcast_joined(cpg_handle, CPG_TYPE_AGREED, iov, 2); ++ pthread_mutex_unlock(&_mutex); ++ + return cs_to_errno(err); + } + +-- +1.8.3.1 + diff --git a/SOURCES/lvm2-2_02_169-fix-segfault-in-lvmetad-from-missing-null-in-daemon_reply_simple.patch b/SOURCES/lvm2-2_02_169-fix-segfault-in-lvmetad-from-missing-null-in-daemon_reply_simple.patch new file mode 100644 index 00000000..21b85a45 --- /dev/null +++ b/SOURCES/lvm2-2_02_169-fix-segfault-in-lvmetad-from-missing-null-in-daemon_reply_simple.patch @@ -0,0 +1,50 @@ + WHATS_NEW | 4 ++++ + daemons/lvmetad/lvmetad-core.c | 9 ++++++--- + 2 files changed, 10 insertions(+), 3 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 519bbc9..8ae2df8 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,3 +1,7 @@ ++Version 2.02.169 - ++===================================== ++ Fix segfault in lvmetad from missing NULL in daemon_reply_simple. ++ + Version 2.02.167 - + ====================================== + Prevent raid4 creation/conversion on non-supporting kernels +diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c +index 36a5cec..c46c7ac 100644 +--- a/daemons/lvmetad/lvmetad-core.c ++++ b/daemons/lvmetad/lvmetad-core.c +@@ -2745,7 +2745,8 @@ static response handler(daemon_state s, client_handle h, request r) + "expected = %s", state->token, + "received = %s", token, + "update_pid = " FMTd64, (int64_t)state->update_pid, +- "reason = %s", "another command has populated the cache"); ++ "reason = %s", "another command has populated the cache", ++ NULL); + } + + DEBUGLOG(state, "token_update end len %d pid %d new token %s", +@@ -2778,7 +2779,8 @@ static response handler(daemon_state s, client_handle h, request r) + "expected = %s", state->token, + "received = %s", token, + "update_pid = " FMTd64, (int64_t)state->update_pid, +- "reason = %s", "another command has populated the cache"); ++ "reason = %s", "another command has populated the cache", ++ NULL); + } + + /* If a pid doing update was cancelled, ignore its update messages. */ +@@ -2793,7 +2795,8 @@ static response handler(daemon_state s, client_handle h, request r) + "expected = %s", state->token, + "received = %s", token, + "update_pid = " FMTd64, (int64_t)state->update_pid, +- "reason = %s", "another command has populated the lvmetad cache"); ++ "reason = %s", "another command has populated the lvmetad cache", ++ NULL); + } + + pthread_mutex_unlock(&state->token_lock); diff --git a/SOURCES/lvm2-2_02_169-lvcreate-fix-striped-limit.patch b/SOURCES/lvm2-2_02_169-lvcreate-fix-striped-limit.patch new file mode 100644 index 00000000..9e224ddb --- /dev/null +++ b/SOURCES/lvm2-2_02_169-lvcreate-fix-striped-limit.patch @@ -0,0 +1,34 @@ + WHATS_NEW | 1 + + tools/lvcreate.c | 4 +++- + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 0b571ae..26aa5b0 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.169 - + ===================================== ++ Fix limit of stripes in lvcreate. + Avoid parallel usage of cpg_mcast_joined() in clvmd with corosync. + Fix segfault in lvmetad from missing NULL in daemon_reply_simple. + +diff --git a/tools/lvcreate.c b/tools/lvcreate.c +index dbc0708..dae9da6 100644 +--- a/tools/lvcreate.c ++++ b/tools/lvcreate.c +@@ -559,8 +559,10 @@ static int _read_mirror_and_raid_params(struct cmd_context *cmd, + else if (seg_is_any_raid6(lp)) + max_images -= 2; + } +- } else ++ } else if (seg_is_mirrored(lp)) + max_images = DEFAULT_MIRROR_MAX_IMAGES; ++ else ++ max_images = MAX_STRIPES; + + /* Common mirror and raid params */ + if (arg_is_set(cmd, mirrors_ARG)) { +-- +1.8.3.1 + diff --git a/SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch b/SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch new file mode 100644 index 00000000..aa050528 --- /dev/null +++ b/SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch @@ -0,0 +1,30 @@ + conf/example.conf.in | 2 +- + lib/config/defaults.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/conf/example.conf.in b/conf/example.conf.in +index b1a2a9c..8e68165 100644 +--- a/conf/example.conf.in ++++ b/conf/example.conf.in +@@ -311,7 +311,7 @@ devices { + # or activating LVs in it while a PV appears on multiple devices. + # Enabling this setting allows the VG to be used as usual even with + # uncertain devices. +- allow_changes_with_duplicate_pvs = 0 ++ allow_changes_with_duplicate_pvs = 1 + } + + # Configuration section allocation. +diff --git a/lib/config/defaults.h b/lib/config/defaults.h +index d988779..985c832 100644 +--- a/lib/config/defaults.h ++++ b/lib/config/defaults.h +@@ -45,7 +45,7 @@ + #define DEFAULT_DATA_ALIGNMENT_DETECTION 1 + #define DEFAULT_ISSUE_DISCARDS 0 + #define DEFAULT_PV_MIN_SIZE_KB 2048 +-#define DEFAULT_ALLOW_CHANGES_WITH_DUPLICATE_PVS 0 ++#define DEFAULT_ALLOW_CHANGES_WITH_DUPLICATE_PVS 1 + + #define DEFAULT_LOCKING_LIB "liblvm2clusterlock.so" + #define DEFAULT_ERROR_WHEN_FULL 0 diff --git a/SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch b/SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch new file mode 100644 index 00000000..949983da --- /dev/null +++ b/SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch @@ -0,0 +1,104 @@ + configure | 20 ++++++++++---------- + configure.in | 4 ++-- + lib/device/dev-type.c | 3 +-- + 3 files changed, 13 insertions(+), 14 deletions(-) + +diff --git a/configure b/configure +index 8253bfc..587b978 100755 +--- a/configure ++++ b/configure +@@ -11951,12 +11951,12 @@ if test -n "$BLKID_CFLAGS"; then + pkg_cv_BLKID_CFLAGS="$BLKID_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkid >= 2.24\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "blkid >= 2.24") 2>&5 ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkid >= 2.23\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "blkid >= 2.23") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then +- pkg_cv_BLKID_CFLAGS=`$PKG_CONFIG --cflags "blkid >= 2.24" 2>/dev/null` ++ pkg_cv_BLKID_CFLAGS=`$PKG_CONFIG --cflags "blkid >= 2.23" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes + else + pkg_failed=yes +@@ -11968,12 +11968,12 @@ if test -n "$BLKID_LIBS"; then + pkg_cv_BLKID_LIBS="$BLKID_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ +- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkid >= 2.24\""; } >&5 +- ($PKG_CONFIG --exists --print-errors "blkid >= 2.24") 2>&5 ++ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"blkid >= 2.23\""; } >&5 ++ ($PKG_CONFIG --exists --print-errors "blkid >= 2.23") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then +- pkg_cv_BLKID_LIBS=`$PKG_CONFIG --libs "blkid >= 2.24" 2>/dev/null` ++ pkg_cv_BLKID_LIBS=`$PKG_CONFIG --libs "blkid >= 2.23" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes + else + pkg_failed=yes +@@ -11994,9 +11994,9 @@ else + _pkg_short_errors_supported=no + fi + if test $_pkg_short_errors_supported = yes; then +- BLKID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "blkid >= 2.24" 2>&1` ++ BLKID_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "blkid >= 2.23" 2>&1` + else +- BLKID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "blkid >= 2.24" 2>&1` ++ BLKID_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "blkid >= 2.23" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$BLKID_PKG_ERRORS" >&5 +@@ -12004,7 +12004,7 @@ fi + if test "$BLKID_WIPING" = maybe; then + BLKID_WIPING=no + else +- as_fn_error $? "bailing out... blkid library >= 2.24 is required" "$LINENO" 5 ++ as_fn_error $? "bailing out... blkid library >= 2.23 is required" "$LINENO" 5 + fi + elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +@@ -12012,7 +12012,7 @@ $as_echo "no" >&6; } + if test "$BLKID_WIPING" = maybe; then + BLKID_WIPING=no + else +- as_fn_error $? "bailing out... blkid library >= 2.24 is required" "$LINENO" 5 ++ as_fn_error $? "bailing out... blkid library >= 2.23 is required" "$LINENO" 5 + fi + else + BLKID_CFLAGS=$pkg_cv_BLKID_CFLAGS +diff --git a/configure.in b/configure.in +index 33b5c76..9ed6226 100644 +--- a/configure.in ++++ b/configure.in +@@ -1302,12 +1302,12 @@ AC_MSG_RESULT($BLKID_WIPING) + + if test "$BLKID_WIPING" != no; then + pkg_config_init +- PKG_CHECK_MODULES(BLKID, blkid >= 2.24, ++ PKG_CHECK_MODULES(BLKID, blkid >= 2.23, + [test "$BLKID_WIPING" = maybe && BLKID_WIPING=yes], + [if test "$BLKID_WIPING" = maybe; then + BLKID_WIPING=no + else +- AC_MSG_ERROR([bailing out... blkid library >= 2.24 is required]) ++ AC_MSG_ERROR([bailing out... blkid library >= 2.23 is required]) + fi]) + if test "$BLKID_WIPING" = yes; then + BLKID_PC="blkid" +diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c +index 0246c09..bae984a 100644 +--- a/lib/device/dev-type.c ++++ b/lib/device/dev-type.c +@@ -703,8 +703,7 @@ static int _wipe_known_signatures_with_blkid(struct device *dev, const char *nam + BLKID_SUBLKS_TYPE | + BLKID_SUBLKS_USAGE | + BLKID_SUBLKS_VERSION | +- BLKID_SUBLKS_MAGIC | +- BLKID_SUBLKS_BADCSUM); ++ BLKID_SUBLKS_MAGIC); + + while (!blkid_do_probe(probe)) { + if ((r_wipe = _blkid_wipe(probe, dev, name, types_to_exclude, types_no_prompt, yes, force)) == 1) { diff --git a/SOURCES/lvm2-fix-libdm-versioning-for-dm_tree_node_size_changed-symbol.patch b/SOURCES/lvm2-fix-libdm-versioning-for-dm_tree_node_size_changed-symbol.patch new file mode 100644 index 00000000..5a941eaf --- /dev/null +++ b/SOURCES/lvm2-fix-libdm-versioning-for-dm_tree_node_size_changed-symbol.patch @@ -0,0 +1,21 @@ + libdm/.exported_symbols.DM_1_02_107 | 1 + + libdm/.exported_symbols.DM_1_02_110 | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libdm/.exported_symbols.DM_1_02_107 b/libdm/.exported_symbols.DM_1_02_107 +index 89d3464..0c7b7af 100644 +--- a/libdm/.exported_symbols.DM_1_02_107 ++++ b/libdm/.exported_symbols.DM_1_02_107 +@@ -13,3 +13,4 @@ dm_stats_create_region + dm_stats_driver_supports_histogram + dm_stats_get_histogram + dm_stats_get_region_nr_histogram_bins ++dm_tree_node_size_changed +diff --git a/libdm/.exported_symbols.DM_1_02_110 b/libdm/.exported_symbols.DM_1_02_110 +index eba5625..da742ee 100644 +--- a/libdm/.exported_symbols.DM_1_02_110 ++++ b/libdm/.exported_symbols.DM_1_02_110 +@@ -1,3 +1,2 @@ + dm_report_compact_given_fields + dm_hold_control_dev +-dm_tree_node_size_changed diff --git a/SOURCES/lvm2-lvmlockd-tech-preview-warning.patch b/SOURCES/lvm2-lvmlockd-tech-preview-warning.patch new file mode 100755 index 00000000..e3d1edaf --- /dev/null +++ b/SOURCES/lvm2-lvmlockd-tech-preview-warning.patch @@ -0,0 +1,27 @@ +commit dc1c96b8bebbd6bfe9b774fdb13f904f976f29bd +Author: David Teigland +Date: Thu Jul 2 13:45:38 2015 -0500 + + lvmlockd: tech preview notice +--- + tools/toollib.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/tools/toollib.c b/tools/toollib.c +index 6b8ce22..b8edaea 100644 +--- a/tools/toollib.c ++++ b/tools/toollib.c +@@ -981,6 +981,13 @@ int vgcreate_params_set_from_args(struct cmd_context *cmd, + vp_new->clustered = 0; + + log_debug("Setting lock_type to %s", vp_new->lock_type); ++ ++ if (is_lockd_type(vp_new->lock_type)) { ++ log_print("WARNING: shared lock type \"%s\" and lvmlockd are Technology Preview.", vp_new->lock_type); ++ log_print("For more information on Technology Preview features, visit:"); ++ log_print("https://access.redhat.com/support/offerings/techpreview/"); ++ } ++ + return 1; + } + diff --git a/SOURCES/lvm2-remove-mpath-device-handling-from-udev-rules.patch b/SOURCES/lvm2-remove-mpath-device-handling-from-udev-rules.patch new file mode 100755 index 00000000..168603bc --- /dev/null +++ b/SOURCES/lvm2-remove-mpath-device-handling-from-udev-rules.patch @@ -0,0 +1,18 @@ + udev/10-dm.rules.in | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in +index 2755530..8d7a8ca 100644 +--- a/udev/10-dm.rules.in ++++ b/udev/10-dm.rules.in +@@ -120,10 +120,6 @@ ENV{DM_UDEV_RULES_VSN}="2" + + ENV{DM_UDEV_DISABLE_DM_RULES_FLAG}!="1", ENV{DM_NAME}=="?*", SYMLINK+="(DM_DIR)/$env{DM_NAME}" + +-# We have to ignore further rule application for inappropriate events +-# and devices. But still send the notification if cookie exists. +-ENV{DM_UUID}=="mpath-?*", ENV{DM_ACTION}=="PATH_FAILED", GOTO="dm_disable" +- + # Avoid processing and scanning a DM device in the other (foreign) + # rules if it is in suspended state. However, we still keep 'disk' + # and 'DM subsystem' related rules enabled in this case. diff --git a/SOURCES/lvm2-revert-fix-for-lvconvert-repair-for-raid-lvs.patch b/SOURCES/lvm2-revert-fix-for-lvconvert-repair-for-raid-lvs.patch new file mode 100644 index 00000000..77869aec --- /dev/null +++ b/SOURCES/lvm2-revert-fix-for-lvconvert-repair-for-raid-lvs.patch @@ -0,0 +1,323 @@ + WHATS_NEW | 1 - + daemons/dmeventd/plugins/raid/dmeventd_raid.c | 42 +++-------- + lib/metadata/lv.c | 7 ++ + lib/metadata/raid_manip.c | 2 +- + test/shell/lvconvert-repair-raid.sh | 104 ++------------------------ + tools/lvconvert.c | 19 +++++ + 6 files changed, 41 insertions(+), 134 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 25f6742..977e578 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -3,7 +3,6 @@ Version 2.02.166 - 26th September 2016 + Fix lvm2-activation-generator to read all LVM2 config sources. (2.02.155) + Fix lvchange-rebuild-raid.sh to cope with older target versions. + Use dm_config_parse_without_dup_node_check() to speedup metadata reading. +- Fix lvconvert --repair regression + Fix reported origin lv field for cache volumes. (2.02.133) + Always specify snapshot cow LV for monitoring not internal LV. (2.02.165) + Fix lvchange --discard|--zero for active thin-pool. +diff --git a/daemons/dmeventd/plugins/raid/dmeventd_raid.c b/daemons/dmeventd/plugins/raid/dmeventd_raid.c +index bec594a..770fbc6 100644 +--- a/daemons/dmeventd/plugins/raid/dmeventd_raid.c ++++ b/daemons/dmeventd/plugins/raid/dmeventd_raid.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (C) 2005-2016 Red Hat, Inc. All rights reserved. ++ * Copyright (C) 2005-2015 Red Hat, Inc. All rights reserved. + * + * This file is part of LVM2. + * +@@ -13,20 +13,14 @@ + */ + + #include "lib.h" +-#include "defaults.h" + #include "dmeventd_lvm.h" + #include "libdevmapper-event.h" + +-/* Hold enough elements for the mximum number of RAID images */ +-#define RAID_DEVS_ELEMS ((DEFAULT_RAID_MAX_IMAGES + 63) / 64) +- + struct dso_state { + struct dm_pool *mem; + char cmd_lvscan[512]; + char cmd_lvconvert[512]; +- uint64_t raid_devs[RAID_DEVS_ELEMS]; + int failed; +- int warned; + }; + + DM_EVENT_LOG_FN("raid") +@@ -37,39 +31,20 @@ static int _process_raid_event(struct dso_state *state, char *params, const char + { + struct dm_status_raid *status; + const char *d; +- int dead = 0, r = 1; + + if (!dm_get_status_raid(state->mem, params, &status)) { + log_error("Failed to process status line for %s.", device); + return 0; + } + +- d = status->dev_health; +- while ((d = strchr(d, 'D'))) { +- uint32_t dev = (uint32_t)(d - status->dev_health); +- +- if (!(state->raid_devs[dev / 64] & (1 << (dev % 64)))) +- log_error("Device #%u of %s array, %s, has failed.", +- dev, status->raid_type, device); +- +- state->raid_devs[dev / 64] |= (1 << (dev % 64)); +- d++; +- dead = 1; +- } +- +- if (dead) { +- if (status->insync_regions < status->total_regions) { +- if (!state->warned) +- log_warn("WARNING: waiting for resynchronization to finish " +- "before initiating repair on RAID device %s", device); +- +- state->warned = 1; +- goto out; /* Not yet done syncing with accessible devices */ +- } +- ++ if ((d = strchr(status->dev_health, 'D'))) { + if (state->failed) + goto out; /* already reported */ + ++ log_error("Device #%d of %s array, %s, has failed.", ++ (int)(d - status->dev_health), ++ status->raid_type, device); ++ + state->failed = 1; + if (!dmeventd_lvm2_run_with_lock(state->cmd_lvscan)) + log_warn("WARNING: Re-scan of RAID device %s failed.", device); +@@ -77,7 +52,8 @@ static int _process_raid_event(struct dso_state *state, char *params, const char + /* if repair goes OK, report success even if lvscan has failed */ + if (!dmeventd_lvm2_run_with_lock(state->cmd_lvconvert)) { + log_info("Repair of RAID device %s failed.", device); +- r = 0; ++ dm_pool_free(state->mem, status); ++ return 0; + } + } else { + state->failed = 0; +@@ -88,7 +64,7 @@ static int _process_raid_event(struct dso_state *state, char *params, const char + out: + dm_pool_free(state->mem, status); + +- return r; ++ return 1; + } + + void process_event(struct dm_task *dmt, +diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c +index 70036f9..53a1044 100644 +--- a/lib/metadata/lv.c ++++ b/lib/metadata/lv.c +@@ -988,6 +988,7 @@ int lv_mirror_image_in_sync(const struct logical_volume *lv) + int lv_raid_image_in_sync(const struct logical_volume *lv) + { + unsigned s; ++ dm_percent_t percent; + char *raid_health; + struct lv_segment *seg, *raid_seg = NULL; + +@@ -1017,6 +1018,12 @@ int lv_raid_image_in_sync(const struct logical_volume *lv) + return 0; + } + ++ if (!lv_raid_percent(raid_seg->lv, &percent)) ++ return_0; ++ ++ if (percent == DM_PERCENT_100) ++ return 1; ++ + /* Find out which sub-LV this is. */ + for (s = 0; s < raid_seg->area_count; s++) + if (seg_lv(raid_seg, s) == lv) +diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c +index deb88a2..e5fdf4f 100644 +--- a/lib/metadata/raid_manip.c ++++ b/lib/metadata/raid_manip.c +@@ -3658,7 +3658,7 @@ static int _lv_raid_rebuild_or_replace(struct logical_volume *lv, + return 0; + } + +- if (!_raid_in_sync(lv)) { ++ if (!mirror_in_sync() && !_raid_in_sync(lv)) { + log_error("Unable to replace devices in %s/%s while it is" + " not in-sync.", lv->vg->name, lv->name); + return 0; +diff --git a/test/shell/lvconvert-repair-raid.sh b/test/shell/lvconvert-repair-raid.sh +index b51d8fe..1ef91c4 100644 +--- a/test/shell/lvconvert-repair-raid.sh ++++ b/test/shell/lvconvert-repair-raid.sh +@@ -22,52 +22,11 @@ aux lvmconf 'allocation/maximise_cling = 0' \ + + aux prepare_vg 8 + +-function delay +-{ +- for d in $(< DEVICES) +- do +- aux delay_dev "$d" 0 $1 $(get first_extent_sector "$d") +- done +-} +- + # It's possible small raid arrays do have problems with reporting in-sync. + # So try bigger size +-RAID_SIZE=32 +- +-# Fast sync and repair afterwards +-delay 0 +- +-# RAID1 dual-leg single replace after initial sync +-lvcreate --type raid1 -m 1 -L $RAID_SIZE -n $lv1 $vg "$dev1" "$dev2" +-aux wait_for_sync $vg $lv1 +-aux disable_dev "$dev2" +-lvconvert -y --repair $vg/$lv1 +-vgreduce --removemissing $vg +-aux enable_dev "$dev2" +-vgextend $vg "$dev2" +-lvremove -ff $vg/$lv1 +- +-# Delayed sync to allow for repair during rebuild +-delay 50 +- +-# RAID1 triple-leg single replace during initial sync +-lvcreate --type raid1 -m 2 -L $RAID_SIZE -n $lv1 $vg "$dev1" "$dev2" "$dev3" +-aux disable_dev "$dev2" "$dev3" +-not lvconvert -y --repair $vg/$lv1 +-aux wait_for_sync $vg $lv1 +-lvconvert -y --repair $vg/$lv1 +-vgreduce --removemissing $vg +-aux enable_dev "$dev2" "$dev3" +-vgextend $vg "$dev2" "$dev3" +-lvremove -ff $vg/$lv1 +- +- +-# Larger RAID size possible for striped RAID + RAID_SIZE=64 + +-# Fast sync and repair afterwards +-delay 0 +-# RAID5 single replace after initial sync ++# RAID5 single replace + lvcreate --type raid5 -i 2 -L $RAID_SIZE -n $lv1 $vg "$dev1" "$dev2" "$dev3" + aux wait_for_sync $vg $lv1 + aux disable_dev "$dev3" +@@ -75,69 +34,16 @@ lvconvert -y --repair $vg/$lv1 + vgreduce --removemissing $vg + aux enable_dev "$dev3" + vgextend $vg "$dev3" +-lvremove -ff $vg/$lv1 ++lvremove -ff $vg + +-# Delayed sync to allow for repair during rebuild +-delay 50 +- +-# RAID5 single replace during initial sync +-lvcreate --type raid5 -i 2 -L $RAID_SIZE -n $lv1 $vg "$dev1" "$dev2" "$dev3" +-aux disable_dev "$dev3" +-not lvconvert -y --repair $vg/$lv1 +-aux wait_for_sync $vg $lv1 +-lvconvert -y --repair $vg/$lv1 +-vgreduce --removemissing $vg +-aux enable_dev "$dev3" +-vgextend $vg "$dev3" +-lvremove -ff $vg/$lv1 +- +-# Fast sync and repair afterwards +-delay 0 +- +-# RAID6 double replace after initial sync ++# RAID6 double replace + lvcreate --type raid6 -i 3 -L $RAID_SIZE -n $lv1 $vg \ + "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" + aux wait_for_sync $vg $lv1 + aux disable_dev "$dev4" "$dev5" + lvconvert -y --repair $vg/$lv1 + vgreduce --removemissing $vg +-aux enable_dev "$dev4" "$dev5" +-vgextend $vg "$dev4" "$dev5" +-lvremove -ff $vg/$lv1 +- +-# Delayed sync to allow for repair during rebuild +-delay 50 +- +-# RAID6 single replace after initial sync +-lvcreate --type raid6 -i 3 -L $RAID_SIZE -n $lv1 $vg \ +- "$dev1" "$dev2" "$dev3" "$dev4" "$dev5" +-aux disable_dev "$dev4" +-not lvconvert -y --repair $vg/$lv1 +-delay 0 # Fast sync and repair afterwards +-aux disable_dev "$dev4" # Need to disable again after changing delay +-aux wait_for_sync $vg $lv1 +-lvconvert -y --repair $vg/$lv1 +-vgreduce --removemissing $vg + aux enable_dev "$dev4" +-vgextend $vg "$dev4" +-lvremove -ff $vg/$lv1 +- +-# Delayed sync to allow for repair during rebuild +-delay 50 +- +-# RAID10 single replace after initial sync +-lvcreate --type raid10 -m 1 -i 2 -L $RAID_SIZE -n $lv1 $vg \ +- "$dev1" "$dev2" "$dev3" "$dev4" +-aux disable_dev "$dev4" +-not lvconvert -y --repair $vg/$lv1 +-delay 0 # Fast sync and repair afterwards +-aux disable_dev "$dev4" # Need to disable again after changing delay +-aux disable_dev "$dev1" +-aux wait_for_sync $vg $lv1 +-lvconvert -y --repair $vg/$lv1 +-vgreduce --removemissing $vg +-aux enable_dev "$dev4" +-vgextend $vg "$dev4" +-lvremove -ff $vg/$lv1 +- ++aux enable_dev "$dev5" ++vgextend $vg "$dev4" "$dev5" + vgremove -ff $vg +diff --git a/tools/lvconvert.c b/tools/lvconvert.c +index 3607247..d1d21b6 100644 +--- a/tools/lvconvert.c ++++ b/tools/lvconvert.c +@@ -1826,6 +1826,7 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l + struct dm_list *failed_pvs; + struct cmd_context *cmd = lv->vg->cmd; + struct lv_segment *seg = first_seg(lv); ++ dm_percent_t sync_percent; + + if (_linear_type_requested(lp->type_str)) { + if (arg_is_set(cmd, mirrors_ARG) && (arg_uint_value(cmd, mirrors_ARG, 0) != 0)) { +@@ -1973,6 +1974,24 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l + return 0; + } + ++ if (!lv_raid_percent(lv, &sync_percent)) { ++ log_error("Unable to determine sync status of %s.", ++ display_lvname(lv)); ++ return 0; ++ } ++ ++ if (sync_percent != DM_PERCENT_100) { ++ log_warn("WARNING: %s is not in-sync.", display_lvname(lv)); ++ log_warn("WARNING: Portions of the array may be unrecoverable."); ++ ++ /* ++ * The kernel will not allow a device to be replaced ++ * in an array that is not in-sync unless we override ++ * by forcing the array to be considered "in-sync". ++ */ ++ init_mirror_in_sync(1); ++ } ++ + _lvconvert_raid_repair_ask(cmd, lp, &replace); + + if (replace) { diff --git a/SOURCES/lvm2-rhel7.patch b/SOURCES/lvm2-rhel7.patch new file mode 100644 index 00000000..b029dcef --- /dev/null +++ b/SOURCES/lvm2-rhel7.patch @@ -0,0 +1,18 @@ + VERSION | 2 +- + VERSION_DM | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/VERSION b/VERSION +index dd4e60e..39d6c15 100644 +--- a/VERSION ++++ b/VERSION +@@ -1 +1 @@ +-2.02.166(2) (2016-09-26) ++2.02.166(2)-RHEL7 (2016-11-16) +diff --git a/VERSION_DM b/VERSION_DM +index d53f47a..005fbd4 100644 +--- a/VERSION_DM ++++ b/VERSION_DM +@@ -1 +1 @@ +-1.02.135 (2016-09-26) ++1.02.135-RHEL7 (2016-11-16) diff --git a/SOURCES/lvm2-set-default-preferred_names.patch b/SOURCES/lvm2-set-default-preferred_names.patch new file mode 100644 index 00000000..1c446054 --- /dev/null +++ b/SOURCES/lvm2-set-default-preferred_names.patch @@ -0,0 +1,30 @@ + conf/example.conf.in | 2 +- + lib/config/config_settings.h | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/conf/example.conf.in b/conf/example.conf.in +index c0afcb7..ec12918 100644 +--- a/conf/example.conf.in ++++ b/conf/example.conf.in +@@ -106,7 +106,7 @@ devices { + # Example + # preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ] + # +- # This configuration option does not have a default value defined. ++ preferred_names = [ "^/dev/mpath/", "^/dev/mapper/mpath", "^/dev/[hs]d" ] + + # Configuration option devices/filter. + # Limit the block devices that are used by LVM commands. +diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h +index 9017043..c06b6f0 100644 +--- a/lib/config/config_settings.h ++++ b/lib/config/config_settings.h +@@ -205,7 +205,7 @@ cfg(devices_external_device_info_source_CFG, "external_device_info_source", devi + " compiled with udev support.\n" + "#\n") + +-cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED , CFG_TYPE_STRING, NULL, vsn(1, 2, 19), NULL, 0, NULL, ++cfg_array(devices_preferred_names_CFG, "preferred_names", devices_CFG_SECTION, CFG_ALLOW_EMPTY, CFG_TYPE_STRING, "#S^/dev/mpath/#S^/dev/mapper/mpath#S^/dev/[hs]d", vsn(1, 2, 19), NULL, 0, NULL, + "Select which path name to display for a block device.\n" + "If multiple path names exist for a block device, and LVM needs to\n" + "display a name for the device, the path names are matched against\n" diff --git a/SPECS/lvm2.spec b/SPECS/lvm2.spec new file mode 100644 index 00000000..7623a4f6 --- /dev/null +++ b/SPECS/lvm2.spec @@ -0,0 +1,3989 @@ +%global device_mapper_version 1.02.146 + +%global enable_cache 1 +%global enable_cluster 1 +%global enable_cmirror 1 +%global enable_lvmetad 1 +%global enable_lvmlockd 1 +%global enable_lvmpolld 1 +%global enable_python 1 +%global enable_thin 1 +%global enable_dmfilemapd 1 + +%global systemd_version 189-3 +%global dracut_version 002-18 +%global util_linux_version 2.23 +%global bash_version 4.0 +%global corosync_version 1.99.9-1 +%global resource_agents_version 3.9.5-25 +%global dlm_version 4.0.6-2 +%global libselinux_version 1.30.19-4 +%global persistent_data_version 0.7.0-0.1.rc6 +%global sanlock_version 3.3.0-1 +%global boom_version 0.8.5 + +%global enable_lockd_sanlock %{enable_lvmlockd} +%global enable_lockd_dlm %{enable_lvmlockd} + +%global boom_pkgname lvm2-python-boom +%global boom_version 0.8.5 +%global boom_summary A set of libraries and tools for managing boot loader entries +%global boom_dir boom-%{boom_version} + +%if 0%{?rhel} + %ifnarch i686 x86_64 ppc64 ppc64le s390x + %global enable_cluster 0 + %global enable_cmirror 0 + %global enable_lockd_dlm 0 + %endif + + %ifnarch x86_64 ppc64 ppc64le aarch64 + %global enable_lockd_sanlock 0 + %endif +%endif + +%ifnarch s390x s390 + %global enable_boom 1 +%else + %global enable_boom 0 +%endif + +%if %{enable_cluster} + %global configure_cluster --with-cluster=internal --with-clvmd=corosync + %if %{enable_cmirror} + %global configure_cmirror --enable-cmirrord + %endif +%else + %global configure_cluster --with-cluster=internal --with-clvmd=none +%endif + +# Do not reset Release to 1 unless both lvm2 and device-mapper +# versions are increased together. + +Summary: Userland logical volume management tools +Name: lvm2 +Epoch: 7 +Version: 2.02.177 +Release: 4%{?dist} +License: GPLv2 +Group: System Environment/Base +URL: http://sources.redhat.com/lvm2 +Source0: ftp://sources.redhat.com/pub/lvm2/releases/LVM2.%{version}.tgz +Source1: https://github.com/bmr-cymru/boom/archive/%{boom_version}/boom-%{boom_version}.tar.gz +Patch0: lvm2-rhel7.patch +Patch1: lvm2-set-default-preferred_names.patch +Patch2: lvm2-fix-libdm-versioning-for-dm_tree_node_size_changed-symbol.patch +Patch3: lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch +Patch4: lvm2-default-allow-changes-with-duplicate-pvs.patch +Patch5: lvm2-rhel7-fix-StartLimitInterval.patch +Patch6: lvm2-2_02_178-lvmlockd-clear-coverity-complaint.patch +Patch7: lvm2-2_02_178-man-lvmlockd-update-wording.patch +Patch8: lvm2-2_02_178-lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch +Patch9: lvm2-2_02_178-lvmlockd-print-warning-when-skipping-locking.patch +Patch10: lvm2-2_02_178-man-lvmlockd-remove-lv-resizing-comment.patch +Patch11: lvm2-2_02_178-allocation-Avoid-exceeding-array-bounds-in-allocatio.patch +Patch12: lvm2-2_02_178-lvconvert-use-excl-activation-for-conversion.patch +Patch13: lvm2-2_02_178-pvmove-fix-_remove_sibling_pvs_from_trim_list.patch +Patch14: lvm2-2_02_178-pvmove-better-check-for-exclusive-LV.patch +Patch15: lvm2-2_02_178-pvmove-drop-misleading-pvmove-restriction-for-cluste.patch +Patch16: lvm2-2_02_178-dmeventd-add-check-for-result-code.patch +Patch17: lvm2-2_02_178-activation-guard-exclusive-activation.patch +Patch18: lvm2-2_02_178-cleanup-enhance-messages.patch +Patch19: lvm2-2_02_178-cleanup-drop-unused-code.patch +Patch20: lvm2-2_02_178-tests-properly-test-with-clustered-VG.patch +Patch21: lvm2-2_02_178-tests-check-preserved-exclusivness-of-snapshot-merge.patch +Patch22: lvm2-2_02_178-tests-longer-startup-timeout-for-daemons-with-valgri.patch +Patch23: lvm2-2_02_178-tests-check-pvmove-is-merging-segments.patch +Patch24: lvm2-2_02_178-activation-move-check-later.patch +Patch25: lvm2-2_02_178-libdm-accept-mirror-status-with-userspace-word-in-th.patch +Patch26: lvm2-2_02_178-pvmove-reinstantiate-clustered-pvmove.patch +Patch27: lvm2-2_02_178-mirror-Add-deprecation-warning-for-mirrored-log.patch +Patch28: lvm2-2_02_178-locking-exclusive-can-be-either-remote-or-local.patch +Patch29: lvm2-2_02_178-pvmove-enhance-accepted-states-of-active-LVs.patch + +BuildRequires: libselinux-devel >= %{libselinux_version}, libsepol-devel +BuildRequires: libblkid-devel >= %{util_linux_version} +BuildRequires: ncurses-devel +BuildRequires: readline-devel +%if %{enable_cluster} +BuildRequires: corosynclib-devel >= %{corosync_version} +%endif +%if %{enable_cluster} || %{enable_lockd_dlm} +BuildRequires: dlm-devel >= %{dlm_version} +%endif +BuildRequires: module-init-tools +BuildRequires: pkgconfig +BuildRequires: systemd-devel +BuildRequires: systemd-units +%if %{enable_python} || %{enable_boom} +BuildRequires: python2-devel +BuildRequires: python-setuptools +%endif +%if %{enable_thin} || %{enable_cache} +BuildRequires: device-mapper-persistent-data >= %{persistent_data_version} +%endif +%if %{enable_lockd_sanlock} +BuildRequires: sanlock-devel >= %{sanlock_version} +%endif + +Requires: %{name}-libs = %{epoch}:%{version}-%{release} +Requires: bash >= %{bash_version} +Requires(post): systemd-units >= %{systemd_version} +Requires(preun): systemd-units >= %{systemd_version} +Requires(postun): systemd-units >= %{systemd_version} +Requires: module-init-tools +%if %{enable_thin} || %{enable_cache} +Requires: device-mapper-persistent-data >= %{persistent_data_version} +%endif +# BZ https://bugzilla.redhat.com/show_bug.cgi?id=1523288 + +%description +LVM2 includes all of the support for handling read/write operations on +physical volumes (hard disks, RAID-Systems, magneto optical, etc., +multiple devices (MD), see mdadm(8) or even loop devices, see +losetup(8)), creating volume groups (kind of virtual disks) from one +or more physical volumes and creating one or more logical volumes +(kind of logical partitions) in volume groups. + +%prep +%if %{enable_boom} +%setup -q -b 1 -n %{boom_dir} +%endif + +%setup -q -n LVM2.%{version} +%patch0 -p1 -b .rhel7 +%patch1 -p1 -b .preferred_names +%patch2 -p1 -b .libdm_symbol_versioning +%patch3 -p1 -b .blkid_sublks_badcsum +%patch4 -p1 -b .default_allow_dup +%patch5 -p1 -b .startlimitinterval +%patch6 -p1 -b .6lvmlockd_clear_coverity_complaint +%patch7 -p1 -b .7man_lvmlockd_update_wording +%patch8 -p1 -b .8lvmlockd_add_lockopt_values_for_skipping_selected_lo +%patch9 -p1 -b .9lvmlockd_print_warning_when_skipping_locking +%patch10 -p1 -b .10man_lvmlockd_remove_lv_resizing_comment +%patch11 -p1 -b .11allocation_Avoid_exceeding_array_bounds_in_allocatio +%patch12 -p1 -b .12lvconvert_use_excl_activation_for_conversion +%patch13 -p1 -b .13pvmove_fix__remove_sibling_pvs_from_trim_list +%patch14 -p1 -b .14pvmove_better_check_for_exclusive_LV +%patch15 -p1 -b .15pvmove_drop_misleading_pvmove_restriction_for_cluste +%patch16 -p1 -b .16dmeventd_add_check_for_result_code +%patch17 -p1 -b .17activation_guard_exclusive_activation +%patch18 -p1 -b .18cleanup_enhance_messages +%patch19 -p1 -b .19cleanup_drop_unused_code +%patch20 -p1 -b .20tests_properly_test_with_clustered_VG +%patch21 -p1 -b .21tests_check_preserved_exclusivness_of_snapshot_merge +%patch22 -p1 -b .22tests_longer_startup_timeout_for_daemons_with_valgri +%patch23 -p1 -b .23tests_check_pvmove_is_merging_segments +%patch24 -p1 -b .24activation_move_check_later +%patch25 -p1 -b .25libdm_mirror_status_userspace +%patch26 -p1 -b .26clustered_pvmove +%patch27 -p1 -b .27deprecation_warning_for_mirrored_log +%patch28 -p1 -b .28locking_ex_either_remote_or_local +%patch29 -p1 -b .29pvmove_enhance_accepted_states_of_active_LVs + +%build +%global _default_pid_dir /run +%global _default_dm_run_dir /run +%global _default_run_dir /run/lvm +%global _default_locking_dir /run/lock/lvm + +%global _udevdir %{_prefix}/lib/udev/rules.d +%global _tmpfilesdir %{_prefix}/lib/tmpfiles.d + +%global configure_udev --with-udevdir=%{_udevdir} --enable-udev_sync + +%if %{enable_cache} +%global configure_cache --with-cache=internal +%endif + +%if %{enable_thin} +%global configure_thin --with-thin=internal +%endif + +%if %{enable_lvmetad} +%global configure_lvmetad --enable-lvmetad +%endif + +%if %{enable_lockd_dlm} +%global configure_lockd_dlm --enable-lvmlockd-dlm +%endif + +%if %{enable_lockd_sanlock} +%global configure_lockd_sanlock --enable-lvmlockd-sanlock +%endif + +%if %{enable_lvmpolld} +%global configure_lvmpolld --enable-lvmpolld +%endif + +%if %{enable_python} +%global configure_python --enable-python2-bindings +%endif + +%if %{enable_dmfilemapd} +%global configure_dmfilemapd --enable-dmfilemapd +%endif + +%configure --with-default-dm-run-dir=%{_default_dm_run_dir} --with-default-run-dir=%{_default_run_dir} --with-default-pid-dir=%{_default_pid_dir} --with-default-locking-dir=%{_default_locking_dir} --with-usrlibdir=%{_libdir} --enable-lvm1_fallback --enable-fsadm --with-pool=internal --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd --enable-blkid_wiping %{?configure_python} %{?configure_cluster} %{?configure_cmirror} %{?configure_udev} %{?configure_thin} %{?configure_lvmetad} %{?configure_cache} %{?configure_lvmpolld} %{?configure_lockd_dlm} %{?configure_lockd_sanlock} %{?configure_dmfilemapd} + +make %{?_smp_mflags} + +%if %{enable_boom} +( +cd ../%{boom_dir} +%py2_build +) +%endif + +%install +make install DESTDIR=$RPM_BUILD_ROOT +make install_system_dirs DESTDIR=$RPM_BUILD_ROOT +make install_initscripts DESTDIR=$RPM_BUILD_ROOT +make install_systemd_units DESTDIR=$RPM_BUILD_ROOT +make install_systemd_generators DESTDIR=$RPM_BUILD_ROOT +make install_tmpfiles_configuration DESTDIR=$RPM_BUILD_ROOT + +%if %{enable_boom} +( +cd ../%{boom_dir} +%py2_install + +# Install Grub2 integration scripts +install -d -m 700 ${RPM_BUILD_ROOT}/etc/grub.d +install -d -m 755 ${RPM_BUILD_ROOT}/etc/default +install -m 755 etc/grub.d/42_boom ${RPM_BUILD_ROOT}/etc/grub.d +install -m 644 etc/default/boom ${RPM_BUILD_ROOT}/etc/default + +# Make configuration directories +install -d -m 700 ${RPM_BUILD_ROOT}/boot/boom/profiles +install -d -m 700 ${RPM_BUILD_ROOT}/boot/loader/entries +install -m 644 examples/profiles/*.profile ${RPM_BUILD_ROOT}/boot/boom/profiles + +install -d -m 755 ${RPM_BUILD_ROOT}/%{_mandir}/man8 +install -m 644 man/man8/boom.8 ${RPM_BUILD_ROOT}/%{_mandir}/man8 +) +%endif + +%clean +rm -rf $RPM_BUILD_ROOT + +%post +/sbin/ldconfig +%systemd_post lvm2-monitor.service +if [ "$1" = "1" ] ; then + # enable and start lvm2-monitor.service on completely new installation only, not on upgrades + systemctl enable lvm2-monitor.service + systemctl start lvm2-monitor.service +fi +%if %{enable_lvmetad} +%systemd_post lvm2-lvmetad.socket +# lvm2-lvmetad.socket is always enabled and started and ready to serve if lvmetad is used +# replace direct systemctl calls with systemd rpm macro once this is provided in the macro: +# http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678 +systemctl enable lvm2-lvmetad.socket +systemctl start lvm2-lvmetad.socket +%endif + +%if %{enable_lvmpolld} +%systemd_post lvm2-lvmpolld.socket +# lvm2-lvmpolld socket is always enabled and started and ready to serve if lvmpolld is used +# replace direct systemctl calls with systemd rpm macro once this is provided in the macro: +# http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678 +systemctl enable lvm2-lvmpolld.socket +systemctl start lvm2-lvmpolld.socket +%endif + +%preun +%systemd_preun lvm2-monitor.service +%if %{enable_lvmetad} +%systemd_preun lvm2-lvmetad.service lvm2-lvmetad.socket +%endif + +%if %{enable_lvmpolld} +%systemd_preun lvm2-lvmpolld.service lvm2-lvmpolld.socket +%endif + +%postun +%systemd_postun lvm2-monitor.service +%if %{enable_lvmetad} +%systemd_postun_with_restart lvm2-lvmetad.service +%endif + +%if %{enable_lvmpolld} +%systemd_postun_with_restart lvm2-lvmpolld.service +%endif + +%triggerun -- %{name} < 2.02.86-2 +%{_bindir}/systemd-sysv-convert --save lvm2-monitor >/dev/null 2>&1 || : +/bin/systemctl --no-reload enable lvm2-monitor.service > /dev/null 2>&1 || : +/sbin/chkconfig --del lvm2-monitor > /dev/null 2>&1 || : +/bin/systemctl try-restart lvm2-monitor.service > /dev/null 2>&1 || : + +%files +%defattr(-,root,root,755) +%{!?_licensedir:%global license %%doc} +%license COPYING COPYING.LIB +%doc README VERSION WHATS_NEW +%doc doc/lvm_fault_handling.txt + +# Main binaries +%defattr(555,root,root,-) +%{_sbindir}/fsadm +%{_sbindir}/lvm +%{_sbindir}/lvmconf +%{_sbindir}/lvmconfig +%{_sbindir}/lvmdump +%if %{enable_lvmetad} +%{_sbindir}/lvmetad +%endif +%if %{enable_lvmpolld} +%{_sbindir}/lvmpolld +%endif + +# Other files +%defattr(444,root,root,-) +%{_sbindir}/lvchange +%{_sbindir}/lvconvert +%{_sbindir}/lvcreate +%{_sbindir}/lvdisplay +%{_sbindir}/lvextend +%{_sbindir}/lvmdiskscan +%{_sbindir}/lvmsadc +%{_sbindir}/lvmsar +%{_sbindir}/lvreduce +%{_sbindir}/lvremove +%{_sbindir}/lvrename +%{_sbindir}/lvresize +%{_sbindir}/lvs +%{_sbindir}/lvscan +%{_sbindir}/pvchange +%{_sbindir}/pvck +%{_sbindir}/pvcreate +%{_sbindir}/pvdisplay +%{_sbindir}/pvmove +%{_sbindir}/pvremove +%{_sbindir}/pvresize +%{_sbindir}/pvs +%{_sbindir}/pvscan +%{_sbindir}/vgcfgbackup +%{_sbindir}/vgcfgrestore +%{_sbindir}/vgchange +%{_sbindir}/vgck +%{_sbindir}/vgconvert +%{_sbindir}/vgcreate +%{_sbindir}/vgdisplay +%{_sbindir}/vgexport +%{_sbindir}/vgextend +%{_sbindir}/vgimport +%{_sbindir}/vgimportclone +%{_sbindir}/vgmerge +%{_sbindir}/vgmknodes +%{_sbindir}/vgreduce +%{_sbindir}/vgremove +%{_sbindir}/vgrename +%{_sbindir}/vgs +%{_sbindir}/vgscan +%{_sbindir}/vgsplit +%{_mandir}/man5/lvm.conf.5.gz +%{_mandir}/man7/lvmcache.7.gz +%{_mandir}/man7/lvmraid.7.gz +%{_mandir}/man7/lvmreport.7.gz +%{_mandir}/man7/lvmthin.7.gz +%{_mandir}/man7/lvmsystemid.7.gz +%{_mandir}/man8/fsadm.8.gz +%{_mandir}/man8/lvchange.8.gz +%{_mandir}/man8/lvconvert.8.gz +%{_mandir}/man8/lvcreate.8.gz +%{_mandir}/man8/lvdisplay.8.gz +%{_mandir}/man8/lvextend.8.gz +%{_mandir}/man8/lvm.8.gz +%{_mandir}/man8/lvm2-activation-generator.8.gz +%{_mandir}/man8/lvm-config.8.gz +%{_mandir}/man8/lvmconfig.8.gz +%{_mandir}/man8/lvm-dumpconfig.8.gz +%{_mandir}/man8/lvmconf.8.gz +%{_mandir}/man8/lvmdiskscan.8.gz +%{_mandir}/man8/lvmdump.8.gz +%{_mandir}/man8/lvm-fullreport.8.gz +%{_mandir}/man8/lvmsadc.8.gz +%{_mandir}/man8/lvmsar.8.gz +%{_mandir}/man8/lvreduce.8.gz +%{_mandir}/man8/lvremove.8.gz +%{_mandir}/man8/lvrename.8.gz +%{_mandir}/man8/lvresize.8.gz +%{_mandir}/man8/lvs.8.gz +%{_mandir}/man8/lvscan.8.gz +%{_mandir}/man8/pvchange.8.gz +%{_mandir}/man8/pvck.8.gz +%{_mandir}/man8/pvcreate.8.gz +%{_mandir}/man8/pvdisplay.8.gz +%{_mandir}/man8/pvmove.8.gz +%{_mandir}/man8/pvremove.8.gz +%{_mandir}/man8/pvresize.8.gz +%{_mandir}/man8/pvs.8.gz +%{_mandir}/man8/pvscan.8.gz +%{_mandir}/man8/vgcfgbackup.8.gz +%{_mandir}/man8/vgcfgrestore.8.gz +%{_mandir}/man8/vgchange.8.gz +%{_mandir}/man8/vgck.8.gz +%{_mandir}/man8/vgconvert.8.gz +%{_mandir}/man8/vgcreate.8.gz +%{_mandir}/man8/vgdisplay.8.gz +%{_mandir}/man8/vgexport.8.gz +%{_mandir}/man8/vgextend.8.gz +%{_mandir}/man8/vgimport.8.gz +%{_mandir}/man8/vgimportclone.8.gz +%{_mandir}/man8/vgmerge.8.gz +%{_mandir}/man8/vgmknodes.8.gz +%{_mandir}/man8/vgreduce.8.gz +%{_mandir}/man8/vgremove.8.gz +%{_mandir}/man8/vgrename.8.gz +%{_mandir}/man8/vgs.8.gz +%{_mandir}/man8/vgscan.8.gz +%{_mandir}/man8/vgsplit.8.gz +%{_udevdir}/11-dm-lvm.rules +%if %{enable_lvmetad} +%{_mandir}/man8/lvmetad.8.gz +%{_udevdir}/69-dm-lvm-metad.rules +%endif +%if %{enable_lvmpolld} +%{_mandir}/man8/lvmpolld.8.gz +%{_mandir}/man8/lvm-lvpoll.8.gz +%endif +%attr(755, -, -) %dir %{_sysconfdir}/lvm +%ghost %{_sysconfdir}/lvm/cache/.cache +%attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf +%attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvmlocal.conf +%attr(755, -, -) %dir %{_sysconfdir}/lvm/profile +%{_sysconfdir}/lvm/profile/command_profile_template.profile +%{_sysconfdir}/lvm/profile/metadata_profile_template.profile +%{_sysconfdir}/lvm/profile/thin-generic.profile +%{_sysconfdir}/lvm/profile/thin-performance.profile +%{_sysconfdir}/lvm/profile/cache-mq.profile +%{_sysconfdir}/lvm/profile/cache-smq.profile +%{_sysconfdir}/lvm/profile/lvmdbusd.profile +%attr(700, -, -) %dir %{_sysconfdir}/lvm/backup +%attr(700, -, -) %dir %{_sysconfdir}/lvm/cache +%attr(700, -, -) %dir %{_sysconfdir}/lvm/archive +%ghost %attr(700, -, -) %dir %{_default_locking_dir} +%ghost %attr(700, -, -) %dir %{_default_run_dir} +%{_tmpfilesdir}/%{name}.conf +%{_unitdir}/lvm2-monitor.service +%attr(555, -, -) %{_prefix}/lib/systemd/system-generators/lvm2-activation-generator +%if %{enable_lvmetad} +%{_unitdir}/lvm2-lvmetad.socket +%{_unitdir}/lvm2-lvmetad.service +%{_unitdir}/lvm2-pvscan@.service +%endif +%if %{enable_lvmpolld} +%{_unitdir}/lvm2-lvmpolld.socket +%{_unitdir}/lvm2-lvmpolld.service +%endif + +############################################################################## +# Library and Development subpackages +############################################################################## +%package devel +Summary: Development libraries and headers +Group: Development/Libraries +License: LGPLv2 +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: device-mapper-devel = %{epoch}:%{device_mapper_version}-%{release} +Requires: device-mapper-event-devel = %{epoch}:%{device_mapper_version}-%{release} +Requires: pkgconfig + +%description devel +This package contains files needed to develop applications that use +the lvm2 libraries. + +%files devel +%defattr(444,root,root,-) +%{_libdir}/liblvm2app.so +%{_libdir}/liblvm2cmd.so +%{_libdir}/libdevmapper-event-lvm2.so +%{_includedir}/lvm2app.h +%{_includedir}/lvm2cmd.h +%{_libdir}/pkgconfig/lvm2app.pc + +%package libs +Summary: Shared libraries for lvm2 +License: LGPLv2 +Group: System Environment/Libraries +Requires: device-mapper-event = %{epoch}:%{device_mapper_version}-%{release} + +%description libs +This package contains shared lvm2 libraries for applications. + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%files libs +%defattr(555,root,root,555) +%{!?_licensedir:%global license %%doc} +%license COPYING.LIB +%{_libdir}/liblvm2app.so.* +%{_libdir}/liblvm2cmd.so.* +%{_libdir}/libdevmapper-event-lvm2.so.* +%dir %{_libdir}/device-mapper +%{_libdir}/device-mapper/libdevmapper-event-lvm2mirror.so +%{_libdir}/device-mapper/libdevmapper-event-lvm2snapshot.so +%{_libdir}/device-mapper/libdevmapper-event-lvm2raid.so +%{_libdir}/libdevmapper-event-lvm2mirror.so +%{_libdir}/libdevmapper-event-lvm2snapshot.so +%{_libdir}/libdevmapper-event-lvm2raid.so + +%if %{enable_thin} +%{_libdir}/libdevmapper-event-lvm2thin.so +%{_libdir}/device-mapper/libdevmapper-event-lvm2thin.so +%endif + +%if %{enable_python} + +%package python-libs +Summary: Python module to access LVM +License: LGPLv2 +Group: Development/Libraries +Provides: python-lvm = %{epoch}:%{version}-%{release} +Obsoletes: python-lvm < 2.02.98-3 +Requires: %{name}-libs = %{epoch}:%{version}-%{release} + +%description python-libs +Python module to allow the creation and use of LVM +logical volumes, physical volumes, and volume groups. + +%files python-libs +%{python_sitearch}/lvm* + +%endif + +############################################################################## +# LVM locking daemon +############################################################################## +%if %{enable_lockd_dlm} || %{enable_lockd_sanlock} +%package lockd +Summary: LVM locking daemon +Group: System Environment/Base +Requires: lvm2 = %{epoch}:%{version}-%{release} +%if %{enable_lockd_sanlock} +Requires: sanlock-lib >= %{sanlock_version} +%endif +%if %{enable_lockd_dlm} +Requires: dlm-lib >= %{dlm_version} +%endif +Requires(post): systemd-units >= %{systemd_version} +Requires(preun): systemd-units >= %{systemd_version} +Requires(postun): systemd-units >= %{systemd_version} + +%description lockd + +LVM commands use lvmlockd to coordinate access to shared storage. + +%post lockd +%systemd_post lvm2-lvmlockd.service lvm2-lvmlocking.service + +%preun lockd +%systemd_preun lvm2-lvmlockd.service lvm2-lvmlocking.service + +%postun lockd +%systemd_postun lvm2-lvmlockd.service lvm2-lvmlocking.service + +%files lockd +%defattr(444,root,root,-) +%%attr(555, -, -) %{_sbindir}/lvmlockd +%%attr(555, -, -) %{_sbindir}/lvmlockctl +%{_mandir}/man8/lvmlockd.8.gz +%{_mandir}/man8/lvmlockctl.8.gz +%{_unitdir}/lvm2-lvmlockd.service +%{_unitdir}/lvm2-lvmlocking.service + +%endif + +############################################################################## +# Cluster subpackage +# The 'clvm' OCF script to manage clvmd instance is part of resource-agents. +############################################################################## +%if %{enable_cluster} + +%package cluster +Summary: Cluster extensions for userland logical volume management tools +License: GPLv2 +Group: System Environment/Base +Requires: lvm2 = %{epoch}:%{version}-%{release} +Requires(preun): device-mapper = %{epoch}:%{device_mapper_version} +Requires(preun): lvm2 >= 2.02 +Requires: corosync >= %{corosync_version} +Requires: dlm >= %{dlm_version} +Requires: resource-agents >= %{resource_agents_version} + +%description cluster + +Extensions to LVM2 to support clusters. + +%post cluster +if [ -e %{_default_pid_dir}/clvmd.pid ]; then + /usr/sbin/clvmd -S || echo "Failed to restart clvmd daemon. Please, try manual restart." +fi + +%preun cluster +if [ "$1" = "0" ]; then + /sbin/lvmconf --disable-cluster +fi + +%files cluster +%defattr(555,root,root,-) +%{_sbindir}/clvmd +%attr(444, -, -) %{_mandir}/man8/clvmd.8.gz + +############################################################################## +# Cluster-standalone subpackage +############################################################################## +%package cluster-standalone +Summary: Additional files to support clustered LVM2 in standalone mode +License: GPLv2 +Group: System Environment/Base +Requires: lvm2-cluster = %{epoch}:%{version}-%{release} + +%description cluster-standalone + +Additional files needed to run clustered LVM2 daemon and clustered volume +activation in standalone mode as services without cluster resource manager +involvement (e.g. pacemaker). + +%post cluster-standalone +%systemd_post lvm2-clvmd.service lvm2-cluster-activation.service + +%preun cluster-standalone +%systemd_preun lvm2-clvmd.service lvm2-cluster-activation.service + +%postun cluster-standalone +%systemd_postun lvm2-clvmd.service lvm2-cluster-activation.service + +%files cluster-standalone +%defattr(555,root,root,-) +%{_prefix}/lib/systemd/lvm2-cluster-activation +%defattr(444,root,root,-) +%{_unitdir}/lvm2-clvmd.service +%{_unitdir}/lvm2-cluster-activation.service + +%endif + +############################################################################### +# Cluster mirror subpackage +# The 'clvm' OCF script to manage cmirrord instance is part of resource-agents. +############################################################################### +%if %{enable_cluster} +%if %{enable_cmirror} + +%package -n cmirror +Summary: Daemon for device-mapper-based clustered mirrors +Group: System Environment/Base +Requires: corosync >= %{corosync_version} +Requires: device-mapper = %{epoch}:%{device_mapper_version}-%{release} +Requires: resource-agents >= %{resource_agents_version} + +%description -n cmirror +Daemon providing device-mapper-based mirrors in a shared-storage cluster. + +%files -n cmirror +%defattr(555,root,root,-) +%{_sbindir}/cmirrord +%attr(444, -, -) %{_mandir}/man8/cmirrord.8.gz + +############################################################################## +# Cmirror-standalone subpackage +############################################################################## +%package -n cmirror-standalone +Summary: Additional files to support device-mapper-based clustered mirrors in standalone mode +License: GPLv2 +Group: System Environment/Base +Requires: cmirror >= %{epoch}:%{version}-%{release} + +%description -n cmirror-standalone + +Additional files needed to run daemon for device-mapper-based clustered +mirrors in standalone mode as a service without cluster resource manager +involvement (e.g. pacemaker). + +%post -n cmirror-standalone +%systemd_post lvm2-cmirrord.service + +%preun -n cmirror-standalone +%systemd_preun lvm2-cmirrord.service + +%postun -n cmirror-standalone +%systemd_postun lvm2-cmirrord.service + +%files -n cmirror-standalone +%defattr(444,root,root,-) +%{_unitdir}/lvm2-cmirrord.service + +%endif +%endif + +############################################################################## +# Legacy SysV init subpackage +############################################################################## +%package sysvinit +Summary: SysV style init script for LVM2. +Group: System Environment/Base +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: initscripts + +%description sysvinit +SysV style init script for LVM2. It needs to be installed only if systemd +is not used as the system init process. + +%files sysvinit +%defattr(555,root,root,-) +%{_sysconfdir}/rc.d/init.d/blk-availability +%{_sysconfdir}/rc.d/init.d/lvm2-monitor +%if %{enable_cluster} +%{_sysconfdir}/rc.d/init.d/clvmd +%if %{enable_cmirror} +%{_sysconfdir}/rc.d/init.d/cmirrord +%endif +%endif +%if %{enable_lvmetad} +%{_sysconfdir}/rc.d/init.d/lvm2-lvmetad +%endif +%if %{enable_lvmpolld} +%{_sysconfdir}/rc.d/init.d/lvm2-lvmpolld +%endif + +############################################################################## +# Device-mapper subpackages +############################################################################## +%package -n device-mapper +Summary: Device mapper utility +Version: %{device_mapper_version} +License: GPLv2 +Group: System Environment/Base +URL: http://sources.redhat.com/dm +Requires: device-mapper-libs = %{epoch}:%{device_mapper_version}-%{release} +Requires: util-linux >= %{util_linux_version} +Requires: systemd >= %{systemd_version} +# We need dracut to install required udev rules if udev_sync +# feature is turned on so we don't lose required notifications. +Conflicts: dracut < %{dracut_version} + +%description -n device-mapper +This package contains the supporting userspace utility, dmsetup, +for the kernel device-mapper. + +%post -n device-mapper +%systemd_post blk-availability.service + +%preun -n device-mapper +%systemd_preun blk-availability.service + +%files -n device-mapper +%defattr(-,root,root,-) +%doc COPYING COPYING.LIB WHATS_NEW_DM VERSION_DM README INSTALL +%doc udev/12-dm-permissions.rules +%defattr(444,root,root,-) +%attr(555, -, -) %{_sbindir}/dmsetup +%attr(555, -, -) %{_sbindir}/blkdeactivate +# dmstats is a symlink +%{_sbindir}/dmstats +%{_mandir}/man8/dmsetup.8.gz +%{_mandir}/man8/dmstats.8.gz +%{_mandir}/man8/blkdeactivate.8.gz +%if %{enable_dmfilemapd} +%attr(555, -, -) %{_sbindir}/dmfilemapd +%{_mandir}/man8/dmfilemapd.8.gz +%endif +%{_udevdir}/10-dm.rules +%{_udevdir}/13-dm-disk.rules +%{_udevdir}/95-dm-notify.rules +%{_unitdir}/blk-availability.service + +%package -n device-mapper-devel +Summary: Development libraries and headers for device-mapper +Version: %{device_mapper_version} +License: LGPLv2 +Group: Development/Libraries +Requires: device-mapper = %{epoch}:%{device_mapper_version}-%{release} +Requires: pkgconfig + +%description -n device-mapper-devel +This package contains files needed to develop applications that use +the device-mapper libraries. + +%files -n device-mapper-devel +%defattr(444,root,root,-) +%{_libdir}/libdevmapper.so +%{_includedir}/libdevmapper.h +%{_libdir}/pkgconfig/devmapper.pc + +%package -n device-mapper-libs +Summary: Device-mapper shared library +Version: %{device_mapper_version} +License: LGPLv2 +Group: System Environment/Libraries +Requires: device-mapper = %{epoch}:%{device_mapper_version}-%{release} + +%description -n device-mapper-libs +This package contains the device-mapper shared library, libdevmapper. + +%post -n device-mapper-libs -p /sbin/ldconfig + +%postun -n device-mapper-libs -p /sbin/ldconfig + +%files -n device-mapper-libs +%defattr(555,root,root,555) +%{!?_licensedir:%global license %%doc} +%license COPYING COPYING.LIB +%{_libdir}/libdevmapper.so.* + +%package -n device-mapper-event +Summary: Device-mapper event daemon +Group: System Environment/Base +Version: %{device_mapper_version} +# Older lvm2 versions had incorrect dependency on device-mapper-event +# package where lvm2-libs had "Requires: device-mapper-event >=" +# instead of "Requires: device-mapper-event =". This was fixed in +# lvm2-2.02.111-1 and later. +Conflicts: lvm2-libs < 7:2.02.111 +Requires: device-mapper = %{epoch}:%{device_mapper_version}-%{release} +Requires: device-mapper-event-libs = %{epoch}:%{device_mapper_version}-%{release} +Requires(post): systemd-units +Requires(preun): systemd-units +Requires(postun): systemd-units + +%description -n device-mapper-event +This package contains the dmeventd daemon for monitoring the state +of device-mapper devices. + +%post -n device-mapper-event +%systemd_post dm-event.socket +# dm-event.socket is always enabled and started and ready to serve if dmeventd is used +# replace direct systemctl calls with systemd rpm macro once this is provided in the macro: +# http://cgit.freedesktop.org/systemd/systemd/commit/?id=57ab2eabb8f92fad5239c7d4492e9c6e23ee0678 +systemctl enable dm-event.socket +systemctl start dm-event.socket + +%preun -n device-mapper-event +%systemd_preun dm-event.service dm-event.socket + +%posttrans -n device-mapper-event +if [ -e %{_default_pid_dir}/dmeventd.pid ]; then + %{_sbindir}/dmeventd -R || echo "Failed to restart dmeventd daemon. Please, try manual restart." +fi + +%files -n device-mapper-event +%defattr(444,root,root,-) +%attr(555, -, -) %{_sbindir}/dmeventd +%{_mandir}/man8/dmeventd.8.gz +%{_unitdir}/dm-event.socket +%{_unitdir}/dm-event.service + +%package -n device-mapper-event-libs +Summary: Device-mapper event daemon shared library +Version: %{device_mapper_version} +License: LGPLv2 +Group: System Environment/Libraries + +%description -n device-mapper-event-libs +This package contains the device-mapper event daemon shared library, +libdevmapper-event. + +%post -n device-mapper-event-libs -p /sbin/ldconfig + +%postun -n device-mapper-event-libs -p /sbin/ldconfig + +%files -n device-mapper-event-libs +%defattr(555,root,root,555) +%{!?_licensedir:%global license %%doc} +%license COPYING.LIB +%{_libdir}/libdevmapper-event.so.* + +%package -n device-mapper-event-devel +Summary: Development libraries and headers for the device-mapper event daemon +Version: %{device_mapper_version} +License: LGPLv2 +Group: Development/Libraries +Requires: device-mapper-event = %{epoch}:%{device_mapper_version}-%{release} +Requires: pkgconfig + +%description -n device-mapper-event-devel +This package contains files needed to develop applications that use +the device-mapper event library. + +%files -n device-mapper-event-devel +%defattr(444,root,root,-) +%{_libdir}/libdevmapper-event.so +%{_includedir}/libdevmapper-event.h +%{_libdir}/pkgconfig/devmapper-event.pc + +%if %{enable_boom} +############################################################################## +# boom subpackages +############################################################################## +%package -n %{boom_pkgname} +Summary: %{boom_summary} +Version: %{boom_version} +License: GPLv2 +Group: System Environment/Base +BuildArch: noarch +%{?python_provide:%python_provide python2-boom} + +%description -n %{boom_pkgname} +Boom is a boot manager for Linux systems using boot loaders that support +the BootLoader Specification for boot entry configuration. + +Boom requires a BLS compatible boot loader to function: either the +systemd-boot project, or Grub2 with the bls patch (Red Hat Grub2 builds +include this support in both Red Hat Enterprise Linux 7 and Fedora). + +This package provides the python2 version of boom. + +%files -n %{boom_pkgname} +%license COPYING +%{_mandir}/man8/boom.* +%{python2_sitelib}/boom* +%{_bindir}/boom +/etc/grub.d/42_boom +%config(noreplace) /etc/default/boom +/boot/* +%doc ../%{boom_dir}/README.md +%doc ../%{boom_dir}/examples/ +%doc ../%{boom_dir}/tests/ +%endif + +%changelog +* Fri Feb 16 2018 Marian Csontos - 7:2.02.177-4 +- pvmove enhance accepted states of active LVs. +- boom: Remove debug output. + +* Wed Feb 14 2018 Marian Csontos - 7:2.02.177-3 +- boom: Handle LVs passed in --root-device. +- boom: Allow /dev/VG/LV notation for --root-lv. +- boom: Detection of invalid root devices. +- boom: Support long options without dash separator. +- Add deprecation warning for mirrored mirror log. + +* Wed Feb 07 2018 Marian Csontos - 7:2.02.177-2 +- boom: Better error handling. +- boom: Warn user when grub2 integration is missing. +- Reenable clustered pvmove. + +* Tue Jan 23 2018 Marian Csontos - 7:2.02.177-1 +- boom: Add missing profiles +- Avoid non-exclusive activation of exclusive segment types. +- Fix trimming sibling PVs when doing a pvmove of raid subLVs. +- Preserve exclusive activation during thin snaphost merge. +- Check array boundaries in allocation tag processing. +- When writing metadata, consistently skip mdas marked as failed. +- Reduce checks for active LVs in vgchange before background polling. +- Ensure _node_send_message always uses clean status of thin pool. +- Activation tree of thin pool skips duplicated check of pool status. + +* Wed Dec 06 2017 Marian Csontos - 7:2.02.176-5 +- boom: Update man page. +- boom: Allow users to disable grub2 configuration. +- boom: Do not add snapshots submenu unless entries exist. +- boom: Use fdatasync() for profile and entry files. +- Fix lvmlockd to use pool lock when accessing _tmeta volume. +- Report expected sanlock_convert errors only when retries fail. +- Avoid blocking in sanlock_convert on SH to EX lock conversion. +- Deactivate missing raid LV legs (_rimage_X-missing_Y_Z) on decativation. +- Allow extending of raid LVs created with --nosync after a failed repair. +- Merge adjacent segments when pvmove is finished. +- Ensure very large numbers used as arguments are not casted to lower values. +- Enhance reading and validation of options stripes and stripes_size. +- Fix printing of default stripe size when user is not using stripes. +- Activation code for pvmove automatically discovers holding LVs for resume. +- Make a pvmove LV locking holder. +- Enhance activation code to automatically suspend pvmove participants. +- Prevent conversion of thin volumes to snapshot origin when lvmlockd is used. +- Correct the steps to change lock type in lvmlockd man page. +- Retry lock acquisition on recognized sanlock errors. +- Fix lock manager error codes in lvmlockd. +- Check raid reshape flags in vg_validate(). +- Add support for pvmove of cache and snapshot origins. +- Ehnance pvmove locking. +- Deactivate activated LVs on error path when pvmove activation fails. + +* Wed Nov 15 2017 Marian Csontos - 7:2.02.176-4 +- Avoid importing persistent filter in vgscan/pvscan/vgrename. +- Fix memleak of string buffer when vgcfgbackup runs in secure mode. +- Do not print error when clvmd cannot find running clvmd. +- Prevent start of new merge of snapshot if origin is already being merged. +- Suppress integrity encryption keys in 'table' output unless --showkeys supplied. +- Fix offered type for raid6_n_6 to raid5 conversion (raid5_n). +- Deactivate sub LVs when removing unused cache-pool. +- Do not take backup with suspended devices. +- Avoid RAID4 activation on incompatible kernels under all circumstances. +- Reject conversion request to striped/raid0 on 2-legged raid4/5. + +* Thu Nov 09 2017 Bryn M. Reeves - 7:2.02.176-3 +- Disable boom package build on s390x. + +* Fri Nov 03 2017 Marian Csontos - 7:2.02.176-2 +- Add "boom" boot manager. + +* Fri Nov 03 2017 Marian Csontos - 7:2.02.176-1 +- Fix segfault in lvm_pv_remove in liblvm. (2.02.173) +- Do not allow storing VG metadata with LV without any segment. +- Fix printed message when thin snapshot was already merged. +- Remove created spare LV when creation of thin-pool failed. +- Avoid reading ignored metadata when MDA gets used again. +- Fix detection of moved PVs in vgsplit. (2.02.175) +- Ignore --stripes/--stripesize on RAID takeover +- Disallow creation of snapshot of mirror/raid subLV (was never supported). +- Keep Install section only in *.socket systemd units. +- Improve used paths for generated systemd units and init shells. + +* Wed Oct 25 2017 Marian Csontos - 7:2.02.175-3 +- Fix regression in more advanced vgname extraction in lvconvert (2.02.169). +- Allow lvcreate to be used for caching of _tdata LV. +- Avoid internal error when resizing cache type _tdata LV (not yet supported). +- Show original converted names when lvconverting LV to pool volume. +- Distinguish between device not found and excluded by filter. +- Monitor external origin LVs. +- Remove unused replicator code, including configure --with-replicators. + +* Fri Oct 13 2017 Marian Csontos - 7:2.02.175-2 +- Allow lvcreate --type mirror to work with 100%%FREE. +- Improve selection of resource name for complex volume activation lock. +- Avoid cutting first character of resource name for activation lock. +- Support for encrypted devices in fsadm. +- Improve thin pool overprovisioning and repair warning messages. +- Fix incorrect adjustment of region size on striped RaidLVs. + +* Mon Oct 09 2017 Marian Csontos - 7:2.02.175-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Wed Jun 28 2017 Marian Csontos - 7:2.02.171-8 +- Fix reusing of dm_task structure for status reading (used by dmeventd). + +* Thu Jun 22 2017 Marian Csontos - 7:2.02.171-7 +- Fix a segfault in RAID. + +* Wed Jun 21 2017 Marian Csontos - 7:2.02.171-6 +- Reenable conversion of data and metadata thin-pool volumes to raid. +- Improve handling of RAID status in lvs. +- Disable RAID reshape/take-over in a cluster or when snapshot exists. + +* Wed Jun 14 2017 Marian Csontos - 7:2.02.171-5 +- Improve lvcreate --cachepool arg validation. +- Limit maximal size of thin-pool for specific chunk size. +- Accept truncated files in calls to dm_stats_update_regions_from_fd(). + +* Wed Jun 07 2017 Marian Csontos - 7:2.02.171-4 +- Converting linear to raid1 using "recover" not "resync". +- Print a warning about in-use PVs with no VG using them. +- Disable automatic clearing of PVs that look like in-use orphans. + +* Wed Jun 07 2017 Marian Csontos - 7:2.02.171-4 +- Converting linear to raid1 using "recover" not "resync". +- Print a warning about in-use PVs with no VG using them. +- Disable automatic clearing of PVs that look like in-use orphans. + +* Wed May 31 2017 Marian Csontos - 7:2.02.171-3 +- Cache format2 flag is now using segment name type field compatible with + previous versions. + +* Wed May 24 2017 Marian Csontos - 7:2.02.171-2 +- Stop using '--yes' mode when fsadm runs without terminal. +- Extend validation of filesystems resized by fsadm. +- Enhance lvconvert automatic settings of possible (raid) LV types. +- Allow lvchange to change properties on a thin pool data sub LV. +- Fix lvcreate extent percentage calculation for mirrors. +- Don't reinstate still-missing devices when correcting inconsistent metadata. +- Properly handle subshell return codes in fsadm. +- Disallow cachepool creation with policy cleaner and mode writeback. + +* Wed May 03 2017 Marian Csontos - 7:2.02.171-1 +- Fix dmstats and dmfilemapd permissions. +- Fix memory warnings by using mempools for command definition processing. +- Fix running commands from a script file. +- Adjust pvresize/pvcreate messages and prompt if underlying device size + differs. +- Preserve region size on raid1 image count changes. +- Handle insufficient space on RAID takeover. +- Raise mirror/raid default regionsize to 2MiB. + +* Thu Apr 13 2017 Marian Csontos - 7:2.02.170-2 +- Fix RPM build - missing upstrem and sources. + +* Thu Apr 13 2017 Marian Csontos - 7:2.02.170-1 +- Introduce global/fsadm_executable to make fsadm path configurable. +- Look for limited thin pool metadata size when using 16G metadata. +- Fix missing lvmlockd LV locks in lvchange and lvconvert. +- Allow valid lvconvert --regionsize change. +- Handle insufficient PVs on lvconvert takeover. +- Fix SIGINT blocking to prevent corrupted metadata. +- Fix systemd unit existence check for lvmconf --services --startstopservices. + +* Wed Mar 29 2017 Marian Csontos - 7:2.02.169-3 +- Fix dmfilemapd's Makefile. +- Update dependencies. + +* Wed Mar 29 2017 Marian Csontos - 7:2.02.169-2 +- Enable dmfilemapd. + +* Tue Mar 28 2017 Marian Csontos - 7:2.02.169-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Thu Mar 23 2017 Alasdair Kergon - 7:2.02.166-2 +- Add clustered ppc64le support to build. + +* Thu Feb 09 2017 Peter Rajnoha - 7:2.02.166-1.el7_3.3 +- Fix segfault in lvmetad from missing NULL in daemon_reply_simple. + +* Wed Nov 16 2016 Peter Rajnoha - 7:2.02.166-1.el7_3.2 +- Prevent raid4 creation/conversion on non-supporting kernels +- Add direct striped -> raid4 conversion +- Fix raid4 parity image pair position on conversions from striped/raid0* + +* Wed Oct 12 2016 Peter Rajnoha - 7:2.02.166-1.el7_3.1 +- Fix lvconvert to allow repair for cache raid LVs. +- Fix time when dmeventd is reloaded on package upgrade to start using new code. +- Fix libdm versioning for dm_tree_node_size_changed symbol. + +* Wed Sep 28 2016 Peter Rajnoha - 7:2.02.166-1 +- Disable lvconvert of thin pool to raid while active. +- Use dm_config_parse_without_dup_node_check() to speedup metadata reading. +- Fix lvm2-activation-generator to read all LVM2 config sources. (2.02.155) +- Fix man entry for dmsetup status. +- Introduce new dm_config_parse_without_dup_node_check(). + +* Thu Sep 22 2016 Peter Rajnoha - 7:2.02.165-4 +- Revert lvconvert --repair fix for RAID LVs. + +* Wed Sep 21 2016 Peter Rajnoha - 7:2.02.165-3 +- Fix lvchange --discard|--zero for active thin-pool. +- Fix lvconvert --repair regression for RAID LVs. +- Always specify snapshot cow LV for monitoring not internal LV. (2.02.165) +- Ensure memory allocated internally for --filemap histogram bounds are freed. +- Fix missing display of last created dmstats file map. +- Use --alloc normal for mirror logs even if the mimages were stricter. +- Fix reported origin lv field for cache volumes. (2.02.133) +- Fix lock-holder device for thin pool with inactive thin volumes. +- Enforce 4MiB or 25% metadata free space for thin pool operations. +- Fix lvmetad metadata validation when rescanning VG. + +* Wed Sep 14 2016 Peter Rajnoha - 7:2.02.165-2 +- Fix possible NULL pointer dereference when checking for monitoring. +- Add lvmreport(7) man page. +- Report 0% as dirty (copy%) for cache without any used block. +- Fix lvm2api reporting of cache data and metadata percent. +- Restore reporting of metadata usage for cache volumes (2.02.155). + +* Wed Sep 07 2016 Peter Rajnoha - 7:2.02.165-1 +- Support raid scrubbing on cache origin LV. +- Add lvmraid(7) man page. +- Use udev db to check for mpath components before running pvscan for lvmetad. +- Improve explanation of udev fallback in libdevmapper.h. + +* Mon Sep 05 2016 Peter Rajnoha - 7:2.02.164-5 +- Use udev db to check for mpath components before running pvscan for lvmetad. +- Use devices/allow_changes_with_duplicate_pvs=1 by default. + +* Wed Aug 31 2016 Peter Rajnoha - 7:2.02.164-4 +- Use lsblk -s and lsblk -O in lvmdump only if these options are supported. +- Fix typo in report/columns_as_rows config option name recognition (2.02.99). +- Do not monitor cache-pool metadata when LV is just being cleared. +- Add allocation/cache_pool_max_chunks to prevent misuse of cache target. +- Fix number of stripes shown in lvcreate raid10 message when too many. +- Give error not segfault in lvconvert --splitmirrors when PV lies outside LV. +- Avoid PV tags when checking allocation against parallel PVs. + +* Wed Aug 24 2016 Peter Rajnoha - 7:2.02.164-3 +- Disallow segtype and mirror conversions of raid10 volumes. +- Fix dmeventd unmonitoring when segment type (and dso) changes. +- Don't allow lvconvert --repair on raid0 devices or attempt to monitor them. +- No longer adjust incorrect number of raid stripes supplied to lvcreate. +- Move lcm and gcd to lib/misc. +- Suppress some unnecessary --stripesize parameter warnings. +- Fix 'pvmove -n name ...' to prohibit collocation of RAID SubLVs + +* Tue Aug 16 2016 Peter Rajnoha - 7:2.02.164-2 +- Suppress some unnecessary --stripesize parameter warnings. +- Fix selection of PVs when allocating raid0_meta. +- Specify max stripes for raid LV types: raid0:64; 1:10; 4,5:63; 6:62; 10:32. +- Avoid double suffix when naming _rmeta LV paired with _rimage LV. + +* Wed Aug 10 2016 Peter Rajnoha - 7:2.02.163-1 +- Add profile for lvmdbusd which uses lvm shell json report output. +- Restrict in-command modification of some parms in lvm shell. +- Apply LVM_COMMAND_PROFILE early for lvm shell. +- Refactor reporting so lvm shell log report collects whole of cmd execution. +- Support LVM_*_FD envvars to redirect output to file descriptors. +- Limit use of --corelog and --mirrorlog to mirrors in lvconvert. +- Reject --nosync option for RAID6 LVs in lvcreate. +- Do not refresh whole cmd context if profile dropped after processing LVM cmd. +- Support straightforward lvconvert between striped and raid4 LVs. +- Support straightforward lvconvert between raid1 and mirror LVs. +- Report supported conversions when asked for unsupported raid lvconvert. +- Add "--rebuild PV" option to lvchange to allow for PV selective rebuilds. +- Preserve existing mirror region size when using --repair. +- Forbid stripe parameters with lvconvert --repair. +- Unify stripe size validation into get_stripe_params to catch missing cases. +- Further lvconvert validation logic refactoring. +- Add "lvm fullreport" man page. +- Add dm_report_destroy_rows/dm_report_group_output_and_pop_all for lvm shell. +- Adjust group handling and json production for lvm shell. + +* Fri Jul 29 2016 Peter Rajnoha - 7:2.02.162-1 +- Extend vg_validate also to check raid configurations thoroughly. +- Support lvconvert -Zn also when doing full cache pool conversion. +- Suppress not zeroing warn when converting to thin LV for non-zeroing tpool. +- Fix automatic updates of PV extension headers to newest version. +- Improve lvconvert --trackchanges validation to require --splitmirrors 1. +- Add note about lastlog built-in command to lvm man page. +- Fix unrecognised segtype flag message. +- lvconvert not clears cache pool metadata ONLY with -Zn. +- Add allocation/raid_stripe_all_devices to reinstate previous behaviour. +- Create raid stripes across fixed small numbers of PVs instead of all PVs. +- Disallow lvconvert --replace with raid0* LVs. +- Fix some lvmetad changed VG metadata notifications that sent uncommitted data. +- Fix json reporting to escape '"' character that may appear in reported string. + +* Thu Jul 28 2016 Peter Rajnoha - 7:2.02.161-3 +- Improve lvmlockd message for lock-start. +- Improve lvmlockd activation locking error message. +- Improve lvmlockd error message about missing global lock. +- Allow lvconvert with implied cache pool. +- Fix vgsplit with external origin LV. (2.02.161) + +* Wed Jul 20 2016 Peter Rajnoha - 7:2.02.161-2 +- Fix output redirection while executing blkdeactivate -m disablequeueing. + +* Wed Jul 20 2016 Peter Rajnoha - 7:2.02.161-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Wed Jul 06 2016 Alasdair Kergon - 7:2.02.160-1 +- Minor fixes from coverity. +- vgimportclone is now a symlink. + +* Wed Jul 06 2016 Alasdair Kergon - 7:2.02.159-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Mon Jun 13 2016 Peter Rajnoha - 7:2.02.156-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Wed May 04 2016 Peter Rajnoha - 7:2.02.152-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Wed Oct 14 2015 Peter Rajnoha - 7:2.02.130-5 +- Fixup /etc/lvm/archive ownership. + +* Wed Oct 14 2015 Peter Rajnoha - 7:2.02.130-4 +- Reinstate /etc/lvm dir content permissions after change in defaults. + +* Wed Oct 14 2015 Peter Rajnoha - 7:2.02.130-3 +- Enforce writethrough mode for cleaner policy. +- Check for enough space in thin-pool in command before creating new thin. + +* Tue Sep 15 2015 Peter Rajnoha - 7:2.02.130-2 +- Fix vgimportclone cache_dir path name (2.02.115). +- Disallow usage of --stripe and --stripesize when creating cache pool. +- Swapping of LV identifiers handles more complex LVs. +- Fix VG metadata comparison failure while scanning the VG for lvmetad. +- Ignore persistent cache if configuration changed. (2.02.127) +- Do not check for full thin pool when activating without messages (1.02.107). + +* Wed Sep 09 2015 Peter Rajnoha - 7:2.02.130-1 +- Fix use of uninitialized device status if reading outdated .cache record. +- Restore support for --monitor option in lvcreate (2.02.112). +- Read thin-pool data and metadata percent without flush. +- Detect blocked thin-pool and avoid scanning their thin volumes. +- Check if dm device is usable before checking its size (2.02.116). +- Extend parsing of cache_check version in configure. +- Make lvpoll error messages visible in lvmpolld's stderr and in syslog. +- Add 'make install_full_man' to install all man pages regardless of config. +- Parse thin-pool status with one single routine internally. +- Add --histogram to select default histogram fields for list and report. +- Add report fields for displaying latency histogram configuration and data. +- Add dmstats --bounds to specify histogram boundaries for a new region. +- Add dm_histogram_to_string() to format histogram data in string form. +- Add public methods to libdm to access numerical histogram config and data. +- Parse and store histogram data in dm_stats_list() and dm_stats_populate(). +- Add an argument to specify histogram bounds to dm_stats_create_region(). +- Add dm_histogram_bounds_from_{string,uint64_t}() to parse histogram bounds. +- Add dm_histogram handle type to represent a latency histogram and its bounds. + +* Wed Sep 02 2015 Peter Rajnoha - 7:2.02.129-2 +- Reinstate dm_task_get_info@Base to libdevmapper exports. (1.02.106) + +* Mon Aug 31 2015 Peter Rajnoha - 7:2.02.129-1 +- Drop error message when vgdisplay encounters an exported VG. (2.02.27) +- Fix shared library generation to stop exporting internal functions.(2.02.120) +- Accept --cachemode with lvconvert. +- Fix and improve reporting properties of cache-pool. +- Enable usage of --cachepolicy and --cachesetting with lvconvert. +- Don't allow to reduce size of thin-pool metadata. +- Fix debug buffer overflows in cmirrord logging. +- Add --foreground and --help to cmirrord. +- Add 'precise' column to statistics reports. +- Add --precise switch to 'dmstats create' to request nanosecond counters. +- Add precise argument to dm_stats_create_region(). +- Add support to libdm-stats for precise_timestamps +- Fix devmapper.pc pkgconfig file to declare -lrt dependency properly. + +* Tue Aug 18 2015 Peter Rajnoha - 7:2.02.128-1 +- Allocation setting cache_pool_cachemode is replaced by cache_mode. +- Don't attempt to close config file that couldn't be opened. +- Check for valid cache mode in validation of cache segment. +- Change internal interface handling cache mode and policy. +- When no cache policy specified, prefer smq (if available) over mq. +- Add demo cache-mq and cache-smq profiles. +- Add cmd profilable allocation/cache_policy,cache_settings,cache_mode. +- Require cache_check 0.5.4 for use of --clear-needs-check-flag. +- Fix lvmetad udev rules to not override SYSTEMD_WANTS, add the service instead. +- Fix 'dmstats list -o all' segfault. +- Separate dmstats statistics fields from region information fields. +- Add interval and interval_ns fields to dmstats reports. +- Do not include internal glibc headers in libdm-timestamp.c (1.02.104) +- Exit immediately if no device is supplied to dmsetup wipe_table. +- Suppress dmsetup report headings when no data is output. (1.02.104) +- Adjust dmsetup usage/help output selection to match command invoked. +- Fix dmsetup -o all to select correct fields in splitname report. +- Restructure internal dmsetup argument handling across all commands. +- Add dm_report_is_empty() to indicate there is no data awaiting output. +- Add more arg validation for dm_tree_node_add_cache_target(). +- Add --alldevices switch to replace use of --force for stats create / delete. + +* Mon Aug 10 2015 Peter Rajnoha - 7:2.02.127-1 +- Do not init filters, locking, lvmetad, lvmpolld if command doesn't use it. +- Order fields in struct cmd_context more logically. +- Add lock_type to lvmcache VG summary and info structs. +- Fix regression in cache causing some PVs to bypass filters (2.02.105). +- Make configure --enable-realtime the default now. +- Add dmstats.8 man page. +- Add dmstats --segments switch to create one region per device segment. +- Add dmstats --regionid, --allregions to specify a single / all stats regions. +- Add dmstats --allprograms for stats commands that filter by program ID. +- Add dmstats --auxdata and --programid args to specify aux data and program ID. +- Add report stats sub-command to provide repeating stats reports. +- Add clear, delete, list, and print stats sub-commands. +- Add create stats sub-command and --start, --length, --areas and --areasize. +- Recognize 'dmstats' as an alias for 'dmsetup stats' when run with this name. +- Add a 'stats' command to dmsetup to configure, manage and report stats data. +- Add statistics fields to dmsetup -o. +- Add libdm-stats library to allow management of device-mapper statistics. +- Add --nosuffix to suppress dmsetup unit suffixes in report output. +- Add --units to control dmsetup report field output units. +- Add support to redisplay column headings for repeating column reports. +- Fix report header and row resource leaks. +- Report timestamps of ioctls with dmsetup -vvv. +- Recognize report field name variants without any underscores too. +- Add dmsetup --interval and --count to repeat reports at specified intervals. +- Add dm_timestamp functions to libdevmapper. +- Recognise vg/lv name format in dmsetup. +- Move size display code to libdevmapper as dm_size_to_string. + +* Tue Jul 28 2015 Peter Rajnoha - 7:2.02.126-1 +- Fix long option hyphen removal. (2.02.122) +- Fix clvmd freeze if client disappears without first releasing its locks. +- Fix lvconvert segfaults while performing snapshots merge. +- Ignore errors during detection if use_blkid_wiping=1 and --force is used. +- Recognise DM_ABORT_ON_INTERNAL_ERRORS env var override in lvm logging fn. +- Fix alloc segfault when extending LV with fewer stripes than in first seg. +- Fix handling of cache policy name. +- Set cache policy before with the first lvm2 cache pool metadata commit. +- Fix detection of thin-pool overprovisioning (2.02.124). +- Fix lvmpolld segfaults on 32 bit architectures. +- Add lvmlockd lock_args validation to vg_validate. +- Fix ignored --startstopservices option if running lvmconf with systemd. +- Hide sanlock LVs when processing LVs in VG unless named or --all used. +- Introduce libdevmapper wrappers for all malloc-related functions. + +* Fri Jul 10 2015 Peter Rajnoha - 7:2.02.125-2 +- lvm2-lockd subpackage requires dlm-lib or sanlock-lib or both + based on which support is compiled in. +- lvm2-lockd subpackage requires dlm-lib instead of former dlm + for lvmlockd daemon with dlm support. + +* Tue Jul 07 2015 Peter Rajnoha - 7:2.02.125-1 +- Fix getline memory usage in lvmpolld. +- Add support --clear-needs-check-flag for cache_check of cache pool metadata. +- Add lvmetactl for developer use only. +- Rename global/lock_retries to lvmlockd_retries. +- Replace --enable-lvmlockd by --enable-lockd-sanlock and --enable-lockd-dlm. + +* Mon Jul 06 2015 Peter Rajnoha - 7:2.02.124-1 +- Add lvm2-lockd subpackage with technical preview of lvm locking daemon. +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Wed Jan 28 2015 Peter Rajnoha - 7:2.02.115-3 +- Preserve chunk size with repair and metadata swap of a thin pool. +- Fix raid --splitmirror 1 functionality (2.02.112). +- Fix tree preload to handle splitting raid images. + +* Thu Jan 22 2015 Peter Rajnoha - 7:2.02.115-2 +- Remove rules from 10-dm.rules which handle multipath, rules for handling + multipath devices are directly part of device-mapper-multipath package. + +* Wed Jan 21 2015 Peter Rajnoha - 7:2.02.115-1 +- Report segment types without monitoring support as undefined. +- Support lvchange --errorwhenfull for thin pools. +- Improve the processing and reporting of duplicate PVs. +- Add support for lvcreate --errorwhenfull y|n for thin pools +- Fix lvconvert --repair to honour resilience requirement for segmented RAID LV. +- Also call lvscan --cache in dmeventd for mirror device update in lvmetad. +- Filter out partitioned device-mapper devices as unsuitable for use as PVs. +- Also notify lvmetad about filtered device if using pvscan --cache DevicePath. +- Add report/compact_output to lvm.conf to enable/disable compact report output. +- Rename lv_error_when_full reporting field to lv_when_full. +- Reduce severity of ioctl error message when dmeventd waitevent is interrupted. +- Report 'unknown version' when incompatible version numbers were not obtained. +- Add dm_report_compact_fields to remove empty fields from report output. +- Add BuildRequires: device-mapper-persistent-data for proper thin_check configuration. + +* Wed Jan 14 2015 Peter Rajnoha - 7:2.02.114-5 +- Report lv_health_status and health attribute also for thin pool. +- Add lv_error_when_full reporting field. +- Add support for lvcreate --errorwhenfull y|n for thin pools. +- Report more info from thin pool status (out of data, metadata-ro, fail). +- Support error_if_no_space for thin pool target. +- Do not filter out snapshot origin LVs as unusable devices for an LVM stack. +- Fix process_each_pv to match item by device not by its PV device name only. + +* Wed Jan 07 2015 Peter Rajnoha - 7:2.02.114-4 +- Fix incorrect rimage names when converting from mirror to raid1 LV (2.02.112). +- Avoid excessive re-reading of metadata and related error messages in pvremove. +- Check for cmirror availability during cluster mirror creation and activation. +- Fix possible segfault when using cache_policy and cache_settings fields. +- Fix reserved values recognition for cache_policy and cache_settings fields. + +* Wed Dec 17 2014 Peter Rajnoha - 7:2.02.114-3 +- Add cache_policy and cache_settings reporting fields. +- Add missing recognition for --binary option with {pv,vg,lv}display -C. +- Fix vgimportclone to notify lvmetad about changes done if lvmetad is used. +- Fix vgimportclone to properly override config if it is missing in lvm.conf. +- Fix automatic use of configure --enable-udev-systemd-background-jobs. +- Correctly rename active split LV with -splitmirrors for raid1. +- Still restrict mirror region size to power of 2 when VG extent size is not. +- Fix segfault while using selection with regex and unbuffered reporting. +- Remove unimplemented dm_report_set_output_selection from libdevmapper.h. + +* Mon Dec 01 2014 Peter Rajnoha - 7:2.02.114-2 +- Release socket in daemon_close and protocol string in daemon_open error path. +- Add --cachepolicy and --cachesettings to lvcreate. +- Fix regression when parsing /dev/mapper dir (2.02.112). +- Fix typo in clvmd initscript causing CLVMD_STOP_TIMEOUT var to be ignored. + +* Wed Nov 26 2014 Peter Rajnoha - 7:2.02.113-1 +- Fix missing rounding to 64KB when estimating optimal thin pool chunk size. +- Fix size in pvresize "Resizing to ..." verbose msg to show proper result size. +- Add --cachepolicy and --cachesettings options to lvchange. +- Validate that converted volume and specified pool volume differ in lvconvert. +- Fix regression in vgscan --mknodes usage (2.02.112). +- Respect --prefix when setting CLMVD_PATH configure (2.02.89). +- Default to configure --enable-udev-systemd-background-jobs for systemd>=205. +- Fix ignore_vg() to properly react on various vg_read errors (2.02.112). +- Failed recovery returns FAILED_RECOVERY status flag for vg_read(). +- Exit with non-zero status code when pvck encounters a problem. +- Fix clean_tree after activation/resume for cache target (2.02.112). +- Fix memory corruption with sorting empty string lists (1.02.86). +- Fix man dmsetup.8 syntax warning of Groff +- Accept unquoted strings and / in place of {} when parsing configs. + +* Tue Nov 11 2014 Peter Rajnoha - 7:2.02.112-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Mon Sep 29 2014 Peter Rajnoha - 7:2.02.111-1 +- Update to latest upstream release with various fixes and + enhancements documented in WHATS_NEW and WHATS_NEW_DM file. + +* Wed Mar 26 2014 Peter Rajnoha - 7:2.02.105-14 +- Increase wait time for finishing initial lvmetad scan that's run in parallel. +- Reinitialise lvmcache properly on fork to fix polldaemon exiting prematurely. +- Add more cleanup for stray "cpg_dispatch_failed" cmirror messages. + +* Wed Mar 19 2014 Peter Rajnoha - 7:2.02.105-13 +- Use VG read lock during 'pvscan --cache -aay' autoactivation. +- Issue a VG refresh before autoactivation only if the PV has changed/is new. +- Add flag to lvmetad protocol to indicate the PV scanned has changed/is new. +- Also add vgname to lvmetad protocol when referencing VGs for PVs scanned. +- Use correct PATH_MAX for locking dir path. + +* Wed Mar 12 2014 Peter Rajnoha - 7:2.02.105-12 +- Do not try to check empty pool with scheduled messages. +- Fix return value in pool_has_message() when quering for any message. +- Fix dmeventd logging with parallel wait event processing. + +* Thu Mar 06 2014 Peter Rajnoha - 7:2.02.105-11 +- Cleanup stray "cpg_dispatch failed: CS_ERR_BAD_HANDLE" messages for cmirror. + +* Wed Mar 05 2014 Peter Rajnoha - 7:2.02.105-10 +- Fix cache consistency in lvmetad when PV moves around. +- Fix memleak when lvmetad discovers PV to appear on another device. +- Fix invalid memory read in lvmetad that could cause a deadlock. + +* Fri Feb 28 2014 Peter Rajnoha - 7:2.02.105-9 +- Use configure --with-cache=internal to enable cache support code. + +* Thu Feb 27 2014 Peter Rajnoha - 7:2.02.105-8 +- Fix incorrect calculation of snapshot cow size. + +* Wed Feb 26 2014 Peter Rajnoha - 7:2.02.105-7 +- Fix previous build that reinstated obsoleted multipath rule in 10-dm.rules. + +* Wed Feb 26 2014 Peter Rajnoha - 7:2.02.105-6 +- Add initial support for LVM cache and cachepool segment types. +- Include various bug fixes from upcoming lvm2 v2.02.106 release + detailed in WHATS_NEW and WHATS_NEW_DM file. + +* Fri Feb 21 2014 Peter Rajnoha - 7:2.02.105-5 +- Avoid a PV label scan while in a critical section. +- Add Requires: resource-agents to lvm2-cluster and cmirror subpackage. +- Add new lvm2-cluster-standalone and cmirror-standalone subpackages. +- Add systemd native service for clvmd, cmirrord and clustered LV activation. +- Move obsolete clvmd/cmirrord initscripts to lvm2-sysvinit subpackage. +- Use --ignoreskippedcluster in lvm2-monitor initscript/systemd unit. +- Use --ignoreskippedcluster in activation systemd units if use_lvmetad=0. + +* Wed Feb 19 2014 Peter Rajnoha - 7:2.02.105-4 +- Fix unwanted drop of hold flocks on forked children. +- Fix merging of old snapshot into thin volume origin. +- Exit dmeventd with pidfile cleanup instead of raising SIGKILL on DIE request. +- Add new DM_EVENT_GET_PARAMETERS request to dmeventd protocol. +- Do not use systemd's reload for dmeventd restart, use dmeventd -R instead. + +* Wed Feb 05 2014 Peter Rajnoha - 7:2.02.105-3 +- Drop obsolete multipath rules from 10-dm.rules. +- Drop cryptsetup rules from 10-dm.rules - cryptsetup >= 1.1.3 sets them. +- Avoid trying to convert single to thin pool and volume at the same time. +- Detect thin feature external_origin_extend and limit extend when missing. + +* Fri Jan 24 2014 Daniel Mach - 7:2.02.105-2 +- Mass rebuild 2014-01-24 + +* Wed Jan 22 2014 Peter Rajnoha - 7:2.02.105-1 +- Online thin pool metadata resize requires 1.10 kernel thin pool target. +- Fix thin LV flagging for udev to skip scanning only if the LV is wiped. +- Replace use of xfs_check with xfs_repair in fsadm. +- Mark lvm1 format metadata as FMT_OBSOLETE. Do not use it with lvmetad. +- Invalidate cached VG struct after a PV in it gets orphaned. (2.02.87) +- Mark pool format metadata as FMT_OBSOLETE. +- Syntax and spelling fixes in some man pages. +- Dependency scan counts with snapshots and external origins. +- Make sure VG extent size is always greater or equal to PV phys. block size. +- Optimize double call of stat() for cached devices. +- Enable support for thin provisioning for default configuration. +- Return success when inserting dirs and links into device cache. +- Test for remote exclusive activation after activation fails. +- Support lvconvert --merge for thin snapshots. +- Add support to read thin device id from table line entry. +- Extend lv_remove_single() to not print info about removed LV. +- Replace open_count check with lv_check_not_in_use() for snapshot open test. +- Add error messages with LV names for failing lv refresh. +- Add --splitsnapshot to lvconvert to separate out cow LV. +- Reinstate origin reload to complete lvconvert -s with active LVs. (2.02.98) +- Select only active volume groups if vgdisplay -A is used. +- Add -p and LVM_LVMETAD_PID env var to lvmetad to change pid file. +- Allow lvmetad to reuse stale socket. +- Only unlink lvmetad socket on error if created by the same process. +- Append missing newline to lvmetad missing socket path error message. +- Check for non-zero aligment in _text_pv_add_metadata_area() to not div by 0. +- Add allocation/use_blkid_wiping to lvm.conf to enable blkid wiping. +- Enable blkid_wiping by default if the blkid library is present. +- Add configure --disable-blkid_wiping to disable libblkid signature detection. +- Add -W/--wipesignatures lvcreate option to support wiping on new LVs. +- Add allocation/wipe_signatures_when_zeroing_new_lvs to lvm.conf. +- Do not connect to lvmetad on vg/lvchange --sysinit -aay and socket absent. +- Use lv_check_not_in_use() when testing device in use before merging. +- Check for failure of lvmcache_add_mda() when writing pv. +- Check for failure of dev_get_size() when reporting device size. +- Drop extra unneeded '/' when scanning sysfs directory. +- Fix undef value if skipped clustered VG ignored for toollib PV seg. (2.02.103) +- Support validation of VG/LV names in liblvm/python. +- Allow creation of PVs with arguments to liblvm/python. +- Ensure sufficient metadata copies retained in liblvm/python vgreduce. +- Fix installation of profiles from conf subdir when not building in srcdir. +- Show UUIDs for missing PVs in reports. +- Add reporting of thin_id device id for thin volumes. +- Fix reporting of empty numerical values for recently-added fields. +- Use _field_set_percent/value in reporting code. +- Return success when LV cannot be activated because of volume_list filter. +- Return proper error state for remote exclusive activation. +- Fix clvmd message verification to not reject REMOTE flag. (2.02.100) +- Compare equality of double values with DBL_EPSILON predefined constant. +- Use additional gcc warning flags by default. +- Add ignore_lvm_mirrors to config file to read/ignore labels on mirrors. +- Fix endless loop in blkdeactivate ... if unable to umount/deactivate. +- Remove 2>/dev/null from three lvm commands executed by vgimportclone. +- Check for open count with a timeout before removal/deactivation of an LV. +- Report RAID images split with tracking as out-of-sync ("I"). +- Add workaround for deactivation problem of opened virtual snapshot. +- Disable unsupported merge for virtual snapshot. +- Revert activation of activated nodes if a node preload callback fails. +- Avoid busy looping on CPU when dmeventd reads event DM_WAIT_RETRY. +- Ensure global mutex is held when working with dmeventd thread. +- Drop taking timeout mutex for un/registering dmeventd monitor. +- Allow section names in config file data to be quoted strings. +- Close fifos before exiting in dmeventd restart() error path. +- Catch invalid use of string sort values when reporting numerical fields. +- Consistently report on stderr when device is not found for dmsetup info. +- Skip race errors when non-udev dmsetup build runs on udev-enabled system. +- Skip error message when holders are not present in sysfs. +- Require libpthread to build now. +- Add BuildRequires: libblkid-devel for blkid wiping functionality. + +* Wed Jan 15 2014 Peter Rajnoha - 7:2.02.103-11 +- Do not drop SYSTEMD_READY for non-activating events (LVM on MD or loop). +- Add missing AC_TRY_CCFLAG defined in acinclude.m4 for configuration checks. + +* Tue Jan 07 2014 Peter Rajnoha - 7:2.02.103-10 +- Properly apply RELRO and PIE compiler and linker options. + +* Tue Jan 07 2014 Peter Rajnoha - 7:2.02.103-9 +- Consolidate file permissions for all packaged files. + +* Mon Jan 06 2014 Peter Rajnoha - 7:2.02.103-8 +- Use major:minor in lvm2-pvscan@.service for proper global_filter application. +- Fix SYSTEMD_READY assignment for foreign devices in lvmetad udev rules. +- Handle failures in temporary mirror used when adding images to mirrors. +- Compile/link executables with new RELRO and PIE options (non-static builds). +- Replace hardcoded sbin dir value with rpm variable for clvmd and cmirrord. +- Install all binary executables with 0555 permissions. +- Configure with --enable-write_install for writeable executables + during rpm processing of debug info. + +* Fri Dec 27 2013 Daniel Mach - 7:2.02.103-7 +- Mass rebuild 2013-12-27 + +* Wed Nov 27 2013 Peter Rajnoha - 2.02.103-6 +- Do not fail the whole autoactivation if the VG refresh done before fails. + +* Tue Nov 12 2013 Peter Rajnoha - 2.02.103-5 +- Fix missing lvmetad scan for PVs found on MD partitions. +- Add internal flag for temporary LVs to properly direct udev to not interfere. +- Respect DM_UDEV_DISABLE_OTHER_RULES_FLAG in lvmetad udev rules. +- Workaround VG refresh race during autoactivation by retrying the refresh. + +* Thu Oct 24 2013 Peter Rajnoha - 2.02.103-4 +- Add dev-block-:.device systemd alias for complete PV tracking. +- Use major:minor as short form of --major and --minor arg for pvscan --cache. +- Fix lvconvert swap of poolmetadata volume for active thin pool. + +* Fri Oct 18 2013 Peter Rajnoha - 2.02.103-3 +- Add configure --enable-udev-systemd-background-jobs. +- Add lvm2-pvscan@.service to run pvscan as a service for lvmetad/autoactivation. + +* Thu Oct 10 2013 Peter Rajnoha - 2.02.103-2 +- Fix LV_NOSCAN flag so it's properly recognized as internal LV flag. + +* Thu Oct 10 2013 Peter Rajnoha - 2.02.103-1 +- Fix possible race during daemon worker thread creation (lvmetad). +- Fix possible deadlock while clearing lvmetad cache for full rescan. +- Fix possible race while creating/destroying memory pools. +- Fix failing metadata repair when lvmetad is used. +- Fix incorrect memory handling when reading messages from lvmetad. +- Fix locking in lvmetad when handling the PV which is gone. +- Run full scan before vgrename operation to avoid any cache name collision. +- Recognize new flag to skip udev scanning in udev rules and act appropriately. +- Add support for flagging an LV to skip udev scanning during activation. +- Improve message when unable to change discards setting on active thin pool. +- Fix lvconvert when converting to a thin pool and thin LV at once. +- Ensure vgid matches before removing vgname entry from lvmetad cache. +- Add --ignoreskippedcluster for exit status success when clustered VGs skipped. +- Fix 3 minute udev timeout so that it is applied for all LVM volumes. +- Fix thin/raid & activation config defaults with configure --disable-devmapper. +- Fix RAID calculation for sufficient allocatable space. +- lvconvert from linear to mirror or RAID1 now honors mirror_segtype_default. +- Add thin-performance configuration profile. +- Add lvm.conf allocation/thin_pool_chunk_size_policy option. +- Fix contiguous & cling allocation policies for parity RAID. (2.02.100) +- Have lvmconf --enable/disable-cluster reset/set use_lvmetad. +- Add seg_size_pe field to reports. +- Support start+length notation with command line PE ranges. +- Exit cleanly with message when pvmove cannot restart because LV is inactive. +- Define symbolic names for subsystem udev flags in libdevmapper for easier use. +- Make subsystem udev rules responsible for importing DM_SUBSYSTEM_UDEV_FLAG*. +- Start using a distinct Epoch number in pkg version for major RHEL release. + +* Tue Sep 24 2013 Peter Rajnoha - 2.02.102-1 +- Fix missing build dependency for scripts subdir in Makefile. +- Fix node up/down handling in clvmd corosync module. +- Fix 3-thread clvmd deadlock triggered by cleanup on EOF from client. +- Remove VG from lvmetad before restoring it with vgcfgrestore. +- Add devtypes report command to display built-in recognised block device types. +- Fix CC Makefile override which had reverted to using built-in value. (2.02.75) +- Recognise bcache block devices in filter (experimental). +- Run lvm2-activation-net after lvm2-activation service to prevent parallel run. +- Add man page entries for lvmdump's -u and -l options. +- Fix lvm2app segfault while using lvm_list_pvs_free fn if there are no PVs. +- Improve of clvmd singlenode locking simulation. +- lvconvert no longer converts LVs of "mirror" segment type to thinpool. +- lvconvert no longer converts thinpool sub-LVs to "mirror" segment type. +- Direct udev to use 3min timeout for LVM devices. Recent udev has default 30s. +- Do not scan multipath or RAID components and avoid incorrect autoactivation. +- Fix MD/loop udev handling to fire autoactivation after setup or coldplug only. +- Make RAID capable of single-machine exclusive operations in a cluster. +- Drop calculation of read ahead for deactivated volume. +- Check for exactly one lv segment in validation of thin pools and volumes. +- Fix dmeventd unmonitoring of thin pools. +- Fix lvresize for stacked thin pool volumes (i.e. mirrors). +- Write Completed debug message before reinstating log defaults after command. +- Refresh existing VG before autoactivation (event retrigger/device reappeared). +- Use pvscan -b in udev rules to avoid a deadlock on udev process count limit. +- Add pvscan -b/--background for the command to be processed in the background. +- Don't assume stdin file descriptor is readable. +- Avoid unlimited recursion when creating dtree containing inactive pvmove LV. +- Require exactly 3 arguments for lvm2-activation-generator. Remove defaults. +- Inform lvmetad about any lost PV label to make it in sync with system state. +- Support most of lvchange operations on stacked thin pool meta/data LVs. +- Enable non-clustered pvmove of snapshots and snapshot origins. +- Add ability to pvmove non-clustered RAID, mirror, and thin volumes. +- Make lvm2-activation-generator silent unless it's in error state. +- Remove "mpath major is not dm major" msg for mpath component scan (2.02.94). +- Prevent cluster mirror logs from being corrupted by redundant checkpoints. +- Fix ignored lvmetad update on loop device configuration (2.02.99). +- Use LVM_PATH instead of hardcoded value in lvm2 activation systemd generator. +- Fix vgck to notice on-disk corruption even if lvmetad is used. +- Move mpath device filter before partitioned filter (which opens devices). +- Require confirmation for vgchange -c when no VGs listed explicitly. +- Also skip /var and /var/log by default in blkdeactivate when unmounting. +- Add support for bind mounts in blkdeactivate. +- Add blkdeactivate -v/--verbose for debug output from external tools used. +- Add blkdeactivate -e/--errors for error messages from external tools used. +- Suppress messages from external tools called in blkdeactivate by default. +- Fix inability to remove a VG's cluster flag if it contains a mirror. +- Fix bug making lvchange unable to change recovery rate for RAID. +- Prohibit conversion of thin pool to external origin. +- Workaround gcc v4.8 -O2 bug causing failures if config/checks=1 (32bit arch). +- Verify clvmd message validity before processing and log error if incorrect. +- When creating PV on existing LV don't forbid reserved LV names on LVs below. +- When converting mirrors, default segtype should be the same unless specified. +- Make "raid1" the default mirror segment type. +- Fix clogd descriptor leak when daemonizing. +- Fix clvmd descriptor leak on restart. +- Add pipe_open/close() to use instead of less efficient/secure popen(). +- Inherit and apply any profile attached to a VG if creating new thin pool. +- Ignore previous LV seg with alloc contiguous & cling when num stripes varies. +- Set use_lvmetad=0 on lvmconf --enable-cluster, reset to default on --disable-cluster. +- Tidy dmeventd fifo initialisation. +- Detect invalid sector supplied to 'dmsetup message'. +- Free any previously-set string if a dm_task_set_* function is called again. +- Do not allow passing empty new name for dmsetup rename. +- Display any output returned by 'dmsetup message'. +- Add dm_task_get_message_response to libdevmapper. +- Create dmeventd timeout threads as "detached" so exit status is freed. +- Add DM_ABORT_ON_INTERNAL_ERRORS env var support to abort on internal errors. + +* Wed Jul 31 2013 Peter Rajnoha - 2.02.99-1 +- o Features/Extensions/Additions: +- Add initial support thin pool lvconvert --repair. +- Add support for poolmetadataspare LV, that will be used for pool recovery. +- Improve activation order when creating thin pools in non-clustered VG. +- Add lvm2-activation-net systemd unit to activate LVs on net-attached storage. +- Automatically flag thin snapshots to be skipped during activation. +- Add support for persistent flagging of LVs to be skipped during activation. +- Make selected thinp settings customizable by a profile. +- Support storing profile name in metadata for both VGs and LVs. +- Add support for configuration profiles. +- Add support for thin volumes in vgsplit. +- Add lvresize support for online thin pool metadata volume resize. +- Add detection for thin pool metadata resize kernel support. +- Add vg->vg_ondisk / lv_ondisk() holding committed metadata. +- Add detection of mounted fs also for vgchange deactivation. +- Avoid a global lock in pvs when lvmetad is in use. +- Detect maximum usable size for snapshot for lvresize. +- Improve RAID kernel status retrieval to include sync_action/mismatch_cnt. +- Add external origin support for lvcreate. +- Support automatic config validation. +- Add PV header extension: extension version, flags and bootloader areas. +- Initial support for lvconvert of thin external origin. +- Improve activation code for better support of stacked devices. +- vgimport '--force' now allows import of VGs with missing PVs. +- Allow removal or replacement of RAID LV components that are error segments. +- Make 'vgreduce --removemissing' able to handle RAID LVs with missing PVs. +- Add lvconvert support to swap thin pool metadata volume. +- Allow vgcfgrestore of lvm2 metadata with thin volumes if --force is used. +- Give precedence to EMC power2 devices with duplicate PVIDs. +- Recognise Storage Class Memory (IBM S/390) devices in filter. +- Recognise STEC skd devices in filter. +- Recognise Violin Memory vtms devices in filter. +- Support discards for non-power-of-2 thin pool chunks. +- Automatically restore MISSING PVs with no MDAs. +- Support allocation of pool metadata with lvconvert command. +- Detect mounted fs also via reading /proc/self/mountinfo. +- o Command Interface/Options: +- Support ARG_GROUPABLE with merge_synonym (for --raidwritemostly). +- Add --ignoreactivationskip to lvcreate/vgchange/lvchange to ignore skip flag. +- Add --setactivationskip to lvcreate/lvchange to set activation skip flag. +- Add --type profilable to lvm dumpconfig to show profilable config settings. +- Add --mergedconfig to lvm dumpconfig for merged --config/--profile/lvm.conf. +- Support changing VG/LV profiles: vgchange/lvchange --profile/--detachprofile. +- Add new --profile command line arg to select a configuration profile for use. +- For creation of snapshot require size for at least 3 chunks. +- Do not accept size parameters bigger then 16EiB. +- Accept --yes in all commands so test scripts can be simpler. +- Add lvcreate/lvchange --[raid]{min|max}recoveryrate for raid LVs. +- Add lvchange --[raid]writemostly/writebehind support for RAID1 +- Add lvchange --[raid]syncaction for scrubbing of RAID LVs. +- Add --validate option to lvm dumpconfig to validate current config on demand. +- Add --ignoreadvanced and --ignoreunsupported switch to lvm dumpconfig. +- Add --withcomments and --withversions switch to lvm dumpconfig. +- Add --type {current|default|missing|new} and --atversion to lvm dumpconfig. +- Add --bootloaderareasize to pvcreate and vgconvert to create bootloader area. +- Do not take a free lv name argument for lvconvert --thinpool option. +- Allow lvconvert --stripes/stripesize only with --mirrors/--repair/--thinpool. +- Do not ignore -f in lvconvert --repair -y -f for mirror and raid volumes. +- Support use of option --yes for lvchange --persistent. +- Fix clvmd support for option -d and properly use its argument. +- o Reporting: +- Issue an error msg if lvconvert --type used incorrectly with other options. +- Use LOG_DEBUG/ERR msg severity instead default for lvm2-activation-generator. +- Add LV report fields: raid_mismatch_count/raid_sync_action/raid_write_behind. +- Add LV reporting fields raid_min_recovery_rate, raid_max_recovery_rate. +- Add sync_percent as alias for copy_percent LV reporting field. +- Add lv_ prefix to modules reporting field. +- Use units B or b (never E) with no decimal places when displaying sizes < 1k. +- List thin-pool and thin modules for thin volumes. +- Add 's(k)ip activation' bit to lvs -o lv_attr to indicate skip flag attached. +- Improve error loging when user tries to interrupt commands. +- Add vgs/lvs -o vg_profile/lv_profile to report profiles attached to VG/LV. +- Report lvs volume type 'e' with higher priority. +- Report lvs volume type 'o' also for external origin volumes. +- Report lvs target type 't' only for thin pools and thin volumes. +- Add "active" LV reporting field to show activation state. +- Add "monitor" segment reporting field to show dmevent monitoring status. +- Add explicit message about unsupported pvmove for thin/thinpool volumes. +- Add pvs -o pv_ba_start,pv_ba_size to report bootloader area start and size. +- Fix pvs -o pv_free reporting for PVs with zero PE count. +- Report blank origin_size field if the LV doesn't have an origin instead of 0. +- Report partial and in-sync RAID attribute based on kernel status +- Log output also to syslog when abort_on_internal_error is set. +- Change lvs heading Copy% to Cpy%%Sync and print RAID4/5/6 sync% there too. +- Report error for nonexisting devices in dmeventd communication. +- Reduce some log_error messages to log_warn where we don't fail. +- o Configuration: +- Add lvm.conf thin_repair/dump_executable and thin_repair_options. +- Add activation/auto_set_activation_skip to control activation skip flagging. +- Add default.profile configuration profile and install it on make install. +- Add config/profile_dir to set working directory to load profiles from. +- Use mirror_segtype_default if type not specified for linear->mirror upconvert. +- Refine lvm.conf and man page documentation for autoactivation feature. +- Override system's global_filter settings for vgimportclone. +- Find newest timestamp of merged config files. +- Add 'config' section to lvm.conf to set the way the LVM configuration is handled. +- Add global/raid10_segtype_default to lvm.conf. +- Accept activation/raid_region_size in preference to mirror_region_size config. +- Add log/debug_classes to lvm.conf to control debug log messages. +- Allow empty activation/{auto_activation|read_only|}_volume_list config option. +- Add lvm.conf option global/thin_disabled_features. +- Add lvm.conf thin pool allocation settings thin_pool_{chunk_size|discards|zero}. +- Relax ignore_suspended_devices to read from mirrors that don't have a device marked failed. +- o Documentation: +- Add man page entries for profile configuration and related options. +- Document lvextend --use-policies option in man. +- Improve lvcreate, lvconvert and lvm man pages. +- o API/interfaces: +- liblvm/python API: Additions: PV create/removal/resize/listing +- liblvm/python API: Additions: LV attr/origin/Thin pool/Thin LV creation +- Fix exported symbols regex for non-GNU busybox sed. +- Add LV snapshot support to liblvm and python-lvm. +- Fix lvm2app to return all property sizes in bytes (not sectors). +- Fix lvm2app and return lvseg discards property as string. +- Remove python liblvm object. systemdir can only be changed using env var now. +- Add DM_DISABLE_UDEV environment variable to manage dev nodes by libdm only. +- Add dm_get_status_snapshot() for parsing snapshot status. +- Append discards and read-only fields to exported struct dm_status_thin_pool. +- Validate passed params to dm_get_status_raid/thin/thin_pool(). +- Fix dm_task_set_cookie to properly process udev flags if udev_sync disabled. +- Add dm_mountinfo_read() for parsing /proc/self/mountinfo. +- Add dm_config_write_{node_out/one_node_out} for enhanced config output. +- Add dm_config_value_is_bool to check for boolean value in supported formats. +- Add DM_ARRAY_SIZE public macro. +- Add DM_TO_STRING public macro. +- Implement ref-counting for parents in python lib. +- o Fixes (general) +- Do not zero init 4KB of thin snapshot for non-zeroing thin pool (2.02.94). +- Correct thin creation error paths. +- Add whole log_lv and metadata_lv sub volumes when creating partial tree. +- Properly use snapshot layer for origin which is also thin volume. +- Avoid generating metadata backup when calling update_pool_lv(). +- Send thin messages also for active thin pool and inactive thin volume. +- Avoid creation of multiple archives for one command. +- Avoid flushing thin pool when just requesting transaction_id. +- Fix use of too big chunks of memory when communication with lvmetad. +- Also filter partitions on mpath components if multipath_component_detection=1. +- Do not use persistent filter with lvmetad. +- Move syslog code out of signal handle in dmeventd. +- Fix lvresize --use-policies of VALID but 100% full snapshot. +- Skip monitoring of snapshots that are already bigger then origin. +- Refuse to init a snapshot merge in lvconvert if there's no kernel support. +- Fix alignment of PV data area if detected alignment less than 1 MB (2.02.74). +- Fix premature DM version checking which caused useless mapper/control access. +- Fix creation and removal of clustered snapshot. +- Fix clvmd caching of metadata when suspending inactive volumes. +- Fix lvmetad error path in lvmetad_vg_lookup() for null vgname. +- Fix clvmd _cluster_request() return code in memory fail path. +- Fix vgextend to not allow a PV with 0 MDAs to be used while already in a VG. +- Fix PV alignment to incorporate alignment offset if the PV has zero MDAs. +- Fix missing cleanup of flags when the LV is detached from pool. +- Fix check for some forbidden discards conversion of thin pools. +- Fix blkdeactivate to handle nested mountpoints and mangled mount paths. +- Synchronize with udev in pvscan --cache and fix dangling udev_sync cookies. +- Fix autoactivation to not autoactivate VG/LV on each change of the PVs used. +- Limit RAID device replacement to repair only if LV is not in-sync. +- Disallow RAID device replacement or repair on inactive LVs. +- Unlock vg mutex in error path when lvmetad tries to lock_vg. +- Detect key string duplication failure in config_make_nodes_v in libdaemon. +- Disallow pvmove on RAID LVs until they are addressed properly +- Recognize DM_DISABLE_UDEV environment variable for a complete fallback. +- Do not verify udev operations if --noudevsync command option is used. +- When no --stripes argument is given when creating a RAID10 volume, default to 2 stripes. +- Do not allow lvconvert --splitmirrors on RAID10 logical volumes. +- Skip mlocking [vectors] on arm architecture. +- Repair a mirrored log before the mirror itself when both fail. +- Don't use lvmetad in lvm2-monitor.service ExecStop to avoid a systemd issue. +- Avoid trying to read a mirror that has a failed device in its mirrored log. +- Fix 'dmsetup splitname -o' to not fail if used without '-c' switch (1.02.68). +- Fix segfault for truncated string token in config file after the first '"'. +- Fix config node lookup inside empty sections to not return the section itself. +- Fix parsing of 64bit snapshot status in dmeventd snapshot plugin. +- Always return success on dmeventd -V command call. +- o Fixes (segfaults/crashes/deadlocks/races): +- Fix segfault if devices/global_filter is not specified correctly. +- Fix segfault when reporting raid_syncaction for older kernels. +- Fix vgcfgrestore crash when specified incorrect vg name. +- Avoid crash-inducing race in lvmetad when VG disappears during rename. +- Fix possible race while removing metadata from lvmetad. +- Fix possible deadlock when querying and updating lvmetad at the same time. +- Check for memory failure of dm_config_write_node() in lvmetad. +- Fix crash in pvscan --cache -aay triggered by non-mda PV. +- Prevent double free error after dmeventd call of _fill_device_data(). +- o Fixes (resource leaks/memleaks): +- Release memory allocated with _cached_info(). +- Release memory and unblock signals in lock_vol error path. +- Fix memory resource leak in memlocking error path. +- Fix memleak in dmeventd thin plugin in device list obtaining err path. +- Fix socket leak on error path in lvmetad's handle_connect. +- Fix memleak on error path for lvmetad's pv_found. +- Fix memleak in device_is_usable mirror testing function. +- Fix memory leak on error path for pvcreate with invalid uuid. +- Fix resource leak in error path of dmeventd's umount of thin volume. +- Close open dmeventd FIFO file descriptors on exec (FD_CLOEXEC). +- o Testing: +- Fix test for active snapshot in cluster before resizing it. +- Add python-lvm unit test case +- o Other: +- Add --with-thin-repair and --with-thin-dump configure options. +- Require 1.9 thin pool target version for online thin pool metadata resize. +- Use local activation for clearing snapshot COW device. +- Add configure --with-default-profile-subdir to select dir to keep profiles in. +- Creation of snapshot takes at most 100% origin coverage. +- Use LC_ALL to set locale in daemons and fsadm instead of lower priority LANG. +- Remove dependency on fedora-storage-init.service in lvm2 systemd units. +- Depend on lvm2-lvmetad.socket in lvm2-monitor.service systemd unit. +- Optimize out setting the same value of read_ahead. +- Automatically deactivate failed preloaded dm tree node. +- Process thin messages once to active thin pool target for dm_tree. +- Move common functionality for thin lvcreate and lvconvert to toollib. +- o Packaging: +- Add /etc/lvm/profile dir and /etc/lvm/profile/default.profile to lvm2 package. +- Do not include /lib/udev and /lib/udev/rules.d in device-mapper package. +- Fix spec file's util-linux version definition for proper expansion when used. +- Fix some incorrect changelog dates. + +* Fri Jun 07 2013 Peter Rajnoha - 2.02.98-6 +- Add pidfile reference to clvmd and cmirrord initscript for systemd + to not assume RemainAfterExit=yes which would end up with inconsistent + state for these services if daemon is killed. + +* Thu Apr 11 2013 Peter Rajnoha - 2.02.98-5 +- Add lvm2-activation-generator systemd generator to automatically generate + systemd units to activate LVM2 volumes even if lvmetad is not used. + This replaces lvm activation part of the former fedora-storage-init + script that was included in the initscripts package before. + +* Tue Nov 27 2012 Peter Rajnoha - 2.02.98-4 +- Apply the patch for pvscan --cache exit if cluster locking used or lvmetad not used. + +* Tue Nov 27 2012 Peter Rajnoha - 2.02.98-3 +- Incorporate former python-lvm package in lvm2 as lvm2-python-libs subpackage. +- Do not use lvmetad by default if lvm.conf missing or use_lvmetad not defined. +- Exit pvscan --cache immediately if cluster locking used or lvmetad not used. + +* Wed Nov 07 2012 Peter Rajnoha - 2.02.98-2 +- Fix ExecStop line in lvm2-monitor.service systemd unit - remove quotes. + +* Thu Nov 01 2012 Peter Rajnoha - 2.02.98-1 +- Don't use lvmetad in lvm2-monitor.service ExecStop to avoid a systemd issue. +- Depend on lvm2-lvmetad.socket in lvm2-monitor.service systemd unit. +- Init lvmetad lazily to avoid early socket access on config overrides. +- Hardcode use_lvmetad=0 if cluster locking used and issue a warning msg. +- Fix dm_task_set_cookie to properly process udev flags if udev_sync disabled. +- Don't try to issue discards to a missing PV to avoid segfault. +- Fix vgchange -aay not to activate non-matching LVs that follow a matching LV. +- Fix lvchange --resync for RAID LVs which had no effect. +- Add RAID10 support (--type raid10). +- Introduce blkdeactivate script to deactivate block devs with dependencies. +- Apply 'dmsetup mangle' for dm UUIDs besides dm names. +- Use -q as short form of --quiet. +- Suppress non-essential stdout with -qq. +- Add log/silent to lvm.conf equivalent to -qq. +- Add (p)artial attribute to lvs. +- Implement devices/global_filter to hide devices from lvmetad. +- Add lvmdump -l, to collect a state dump from lvmetad. +- Add --discards to lvconvert. +- Add support for lvcreate --discards. +- Add --poolmetadata to lvconvert and support thin meta/data dev stacking. +- Support creation of read-only thin volumes (lvcreate -p r). +- Support changes of permissions for thin snapshot volumes. +- Make lvremove ask before discarding data areas. +- Prohibit not yet supported change of thin-pool to read-only. +- Using autoextend percent 0 for thin pool fails 'lvextend --use-policies'. +- Make vgscan --cache an alias for pvscan --cache. +- Clear lvmetad metadata/PV cache before a rescan. +- Fix a segmentation fault upon receiving a corrupt lvmetad response. +- Give inconsistent metadata warnings in pvscan --cache. +- Avoid overlapping locks that could cause a deadlock in lvmetad. +- Fix memory leaks in libdaemon and lvmetad. +- Optimize libdaemon logging for a fast no-output path. +- Only create lvmetad pidfile when running as a daemon (no -f). +- Warn if lvmetad is running but disabled. +- Warn about running lvmetad with use_lvmetad = 0 in example.conf. +- Update lvmetad help output (flags and their meaning). +- Make pvscan --cache read metadata from LVM1 PVs. +- Make libdaemon buffer handling asymptotically more efficient. +- Make --sysinit suppress lvmetad connection failure warnings. +- Prohibit usage of lvcreate --thinpool with --mirrors. +- Fix lvm2api origin reporting for thin snapshot volume. +- Add implementation of lvm2api function lvm_percent_to_float. +- Allow non power of 2 thin chunk sizes if thin pool driver supports that. +- Allow limited metadata changes when PVs are missing via [vg|lv]change. +- Do not start dmeventd for lvchange --resync when monitoring is off. +- Remove pvscan --cache from lvm2-lvmetad init script. +- Remove ExecStartPost with pvscan --cache from lvm2-lvmetad.service. +- Report invalid percentage for property snap_percent of non-snaphot LVs. +- Disallow conversion of thin LVs to mirrors. +- Fix lvm2api data_percent reporting for thin volumes. +- Do not allow RAID LVs in a clustered volume group. +- Enhance insert_layer_for_lv() with recursive rename for _tdata LVs. +- Skip building dm tree for thin pool when called with origin_only flag. +- Ensure descriptors 0,1,2 are always available, using /dev/null if necessary. +- Use /proc/self/fd when available for closing opened descriptors efficiently. +- Fix inability to create, extend or convert to a large (> 1TiB) RAID LV. +- Update lvmetad communications to cope with clients using different filters. +- Clear LV_NOSYNCED flag when a RAID1 LV is converted to a linear LV. +- Disallow RAID1 upconvert if the LV was created with --nosync. +- Depend on systemd-udev-settle in units generated by activation generator. +- Disallow addition of RAID images until the array is in-sync. +- Fix RAID LV creation with '--test' so valid commands do not fail. +- Add lvm_lv_rename() to lvm2api. +- Fix setvbuf code by closing and reopening stream before changing buffer. +- Disable private buffering when using liblvm. +- When private stdin/stdout buffering is not used always use silent mode. +- Fix 32-bit device size arithmetic needing 64-bit casting throughout tree. +- Fix dereference of NULL in lvmetad error path logging. +- Fix buffer memory leak in lvmetad logging. +- Correct the discards field in the lvs manpage (2.02.97). +- Use proper condition to check for discards settings unsupported by kernel. +- Reinstate correct default to ignore discards for thin metadata from old tools. +- Issue error message when -i and -m args do not match specified RAID type. +- Change lvmetad logging syntax from -ddd to -l {all|wire|debug}. +- Add new libdaemon logging infrastructure. +- Support unmount of thin volumes from pool above thin pool threshold. +- Update man page to reflect that dm UUIDs are being mangled as well. +- Add 'mangled_uuid' and 'unmangled_uuid' fields to dmsetup info -c -o. +- Mangle device UUID on dm_task_set_uuid/newuuid call if necessary. +- Add dm_task_get_uuid_mangled/unmangled to libdevmapper. +- Always reset delay_resume_if_new flag when stacking thin pool over anything. +- Don't create value for dm_config_node and require dm_config_create_value call. +- Check for existing new_name for dmsetup rename. +- Fix memory leak in dmsetup _get_split_name() error path. +- Clean up spec file and keep support only for Fedora 18 upwards. +- Use systemd macros in rpm scriptlets to set up systemd units. +- Add Requires: bash >= 4.0 for blkdeactivate script. + +* Tue Aug 07 2012 Alasdair Kergon - 2.02.97-1 +- Improve documention of allocation policies in lvm.8. +- Increase limit for major:minor to 4095:1048575 when using -My option. +- Add generator for lvm2 activation systemd units. +- Add lvm_config_find_bool lvm2app fn to retrieve bool value from config tree. +- Respect --test when using lvmetad. +- No longer capitalise first LV attribute char for invalid snapshots. +- Allow vgextend to add PVs to a VG that is missing PVs. +- Recognise Micron PCIe SSDs in filter and move array out to device-types.h. +- Fix dumpconfig to print only without its siblings. (2.02.89) +- Do not issue "Failed to handle a client connection" error if lvmetad killed. +- Support lvchange --discards and -Z with thin pools. +- Add discard LV segment field to reports. +- Add --discards to lvcreate --thin. +- Set discard and external snapshot features if thin pool target is vsn 1.1+. +- Count percentage of completeness upwards not downwards when merging snapshot. +- Skip activation when using vg/lvchange --sysinit -a ay and lvmetad is active. +- Fix extending RAID 4/5/6 logical volumes +- Fix test for PV with unknown VG in process_each_pv to ignore ignored mdas. +- Fix _alloc_parallel_area to avoid picking already-full areas for raid devices. +- Never issue discards when LV extents are being reconfigured, not deleted. +- Allow release_lv_segment_area to fail as functions it calls can fail. +- Fix missing sync of filesystem when creating thin volume snapshot. +- Allow --noflush with dmsetup status and wait (for thin target). +- Add dm_config_write_one_node to libdevmapper. +- Add dm_vasprintf to libdevmapper. +- Support thin pool message release/reserve_metadata_snap in libdevmapper. +- Support thin pool discards and external origin features in libdevmapper. + +* Thu Jul 19 2012 Fedora Release Engineering - 2.02.96-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Wed Jul 04 2012 Peter Rajnoha - 2.02.96-3 +- Use configure --with-default-pid-dir=/run. +- Use globally set prefix for udev rules path. + +* Mon Jul 02 2012 Peter Rajnoha - 2.02.96-2 +- Compile with lvmetad support enabled. +- Add support for volume autoactivation using lvmetad. +- Update man pages with --activate ay option and auto_activation_volume_list. +- Use vgchange -aay instead of vgchange -ay in clmvd init script. +- Add activation/auto_activation_volume_list to lvm.conf. +- Add --activate ay to lvcreate, lvchange, pvscan and vgchange. +- Add --activate synonym for --available arg and prefer --activate. +- Open device read-only to obtain readahead value. +- Add configure --enable-udev-rule-exec-detection to detect exec path in rules. +- Use sbindir in udev rules by default and remove executable path detection. +- Remove hard-coded paths for dmeventd fifos and use default-dm-run-dir. +- Add configure --with-lvmetad-pidfile to remove hard-coded value. +- Add configure --with-default-pid-dir for common directory with pid files. +- Add configure --with-default-dm-run-dir to set run directory for dm tools. +- Add documentation references in systemd units. +- Clean up spec file and keep support only for Fedora 17 upwards. + +* Mon Jun 18 2012 Alasdair Kergon - 2.02.96-1 +- Require device-mapper-persistent-data package for thin provisioning. +- Set delay_resume_if_new on deptree snapshot origin. +- Log value chosen in _find_config_bool like other variable types do. +- Wait for dmeventd to exit after sending it DM_EVENT_CMD_DIE when restarting. +- Append 'Used' to {Blk}DevNames/DevNos dmsetup report headers for clarity. +- Remove dmeventd fifos on exit if they are not managed by systemd. +- Use SD_ACTIVATION environment variable in systemd units to detect systemd. +- Only start a new dmeventd instance on restart if one was already running. +- Extend the time waited for input from dmeventd fifo to 5 secs. (1.02.73) +- Fix error paths for regex filter initialization. +- Re-enable partial activation of non-thin LVs until it can be fixed. (2.02.90) +- Fix alloc cling to cling to PVs already found with contiguous policy. +- Fix cling policy not to behave like normal policy if no previous LV seg. +- Fix allocation loop not to use later policies when --alloc cling without tags. +- Fix division by zero if PV with zero PE count is used during vgcfgrestore. +- Add initial support for thin pool lvconvert. +- Fix lvrename for thin volumes (regression in for_each_sub_lv). (2.02.89) +- Fix up-convert when mirror activation is controlled by volume_list and tags. +- Warn of deadlock risk when using snapshots of mirror segment type. +- Fix bug in cmirror that caused incorrect status info to print on some nodes. +- Remove statement that snapshots cannot be tagged from lvm man page. +- Disallow changing cluster attribute of VG while RAID LVs are active. +- Fix lvconvert error message for non-mergeable volumes. +- Allow subset of failed devices to be replaced in RAID LVs. +- Prevent resume from creating error devices that already exist from suspend. +- Update and correct lvs man page with supported column names. +- Handle replacement of an active device that goes missing with an error device. +- Change change raid1 segtype always to request a flush when suspending. +- Add udev info and context to lvmdump. +- Add lvmetad man page. +- Fix RAID device replacement code so that it works under snapshot. +- Fix inability to split RAID1 image while specifying a particular PV. +- Update man pages to give them all the same look&feel. +- Fix lvresize of thin pool for striped devices. +- For lvresize round upward when specifying number of extents. +- For lvcreate with %%FREE support rounding downward stripe alignment. +- Change message severity to log_very_verbose for missing dev info in udev db. +- Fix lvconvert when specifying removal of a RAID device other than last one. +- Fix ability to handle failures in mirrored log in dmeventd plugin. (2.02.89) +- Fix unlocking volume group in vgreduce in error path. +- Cope when VG name is part of the supplied name in lvconvert --splitmirrors -n. +- Fix exclusive lvchange running from other node. (2.02.89) +- Add 'vgscan --cache' functionality for consistency with 'pvscan --cache'. +- Keep exclusive activation in pvmove if LV is already active. +- Disallow exclusive pvmove if some affected LVs are not exclusively activated. +- Remove unused and wrongly set cluster VG flag from clvmd lock query command. +- Fix pvmove for exclusively activated LV pvmove in clustered VG. (2.02.86) +- Update and fix monitoring of thin pool devices. +- Check hash insert success in lock_vg in clvmd. +- Check for buffer overwrite in get_cluster_type() in clvmd. +- Fix global/detect_internal_vg_cache_corruption config check. +- Fix initializiation of thin monitoring. (2.02.92) +- Cope with improperly formatted device numbers in /proc/devices. (2.02.91) +- Exit if LISTEN_PID environment variable incorrect in lvmetad systemd handover. +- Fix fsadm propagation of -e option. +- Fix fsadm parsing of /proc/mounts files (don't check for substrings). +- Fix fsadm usage of arguments with space. +- Fix arg_int_value alongside ARG_GROUPABLE --major/--minor for lvcreate/change. +- Fix name conflicts that prevent down-converting RAID1 when specifying a device +- Improve thin_check option passing and use configured path. +- Add --with-thin-check configure option for path to thin_check. +- Fix error message when pvmove LV activation fails with name already in use. +- Better structure layout for device_info in dev_subsystem_name(). +- Change message severity for creation of VG over uninitialised devices. +- Fix error path for failed toolcontext creation. +- Don't unlink socket on lvmetad shutdown if instantiated from systemd. +- Restart lvmetad automatically from systemd if it exits from uncaught signal. +- Fix warn msg for thin pool chunk size and update man for chunksize. (2.02.89) + +* Thu Jun 07 2012 Kay Sievers - 2.02.95-8 +- Remove explicit Requires: libudev, rpm takes care of that: + $ rpm -q --requires device-mapper | grep udev + libudev.so... + +* Tue Jun 05 2012 Peter Rajnoha - 2.02.95-7 +- Use BuildRequires: systemd-devel instead of BuildRequires: libudev-devel. +- Remove unsupported udev_get_dev_path libudev call used for checking udev dir. + +* Thu Mar 29 2012 Fabio M. Di Nitto - 2.02.95-6 +- BuildRequires and Requires on newer version of corosync and dlm. +- Restart clvmd on upgrades. + +* Mon Mar 19 2012 Peter Rajnoha - 2.02.95-5 +- Do not strictly require openais for cmirror subpackage. + +* Mon Mar 19 2012 Peter Rajnoha - 2.02.95-4 +- Reinstate cmirror support. +- Detect lvm binary path in lvmetad udev rules. +- Use pvscan --cache instead of vgscan in systemd units/init scripts. + +* Fri Mar 16 2012 Fabio M. Di Nitto - 2.02.95-3 +- Rebuild against new corosync (soname change). +- BuildRequires and Requires on newer version of corosync. + +* Thu Mar 08 2012 Peter Rajnoha - 2.02.95-2 +- Reload dm-event systemd service on upgrade. + +* Tue Mar 06 2012 Alasdair Kergon - 2.02.95-1 +- If unspecified, adjust thin pool metadata and chunk size to fit into 128MB. +- Deactivation of failed thin check on thin pool returns success. +- Check for multiply-mangled names in auto mangling mode. +- Fix dm_task_get_name_unmangled to not unmangle already unmangled name. +- Check whether device names are properly mangled on ioctl return. + +* Sat Mar 03 2012 Alasdair Kergon - 2.02.94-1 +- Add support to execute thin_check with each de/active of thin pool. +- Fix automatic estimation of metadata device size for thin pool. +- Wipe initial 4KiB of non zeroed thin volumes. +- Update code-base to incorporate new metadata daemon. (Not used in Fedora yet.) +- Numerous minor cleanups across the code-base. +- Fix dmsetup / dm_task_set_name to properly resolve path to dm name. (2.02.93) + +* Thu Feb 23 2012 Alasdair Kergon - 2.02.93-1 +- Moved systemd tmpfiles installation upstream for lvm2 lock and run dirs. +- Require number of stripes to be greater than parity devices in higher RAID. +- Fix allocation code to allow replacement of single RAID 4/5/6 device. +- Check all tags and LV names are in a valid form before writing any metadata. +- Allow 'lvconvert --repair' to operate on RAID 4/5/6. +- Fix build_parallel_areas_from_lv to account correctly for raid parity devices. +- Print message when faulty raid devices have been replaced. + +* Mon Feb 20 2012 Alasdair Kergon - 2.02.92-1 +- Read dmeventd monitoring config settings for every lvm command. +- For thin devices, initialize monitoring only for thin pools not thin volumes. +- Make conversion from a synced 'mirror' to 'raid1' not cause a full resync. +- Add clvmd init dependency on dlm service when running with new corosync. +- Switch to using built-in blkid in 13-dm-disk.rules. +- Add "watch" rule to 13-dm-disk.rules. +- Detect failing fifo and skip 20s retry communication period. +- Replace any '\' char with '\\' in dm table specification on input. +- New 'mangle' options in dmsetup/libdevmapper for transparent reversible + encoding of characters that udev forbids in device names. +- Add --manglename option to dmsetup to select the name mangling mode. +- Add mangle command to dmsetup to provide renaming to correct mangled form. +- Add 'mangled_name' and 'unmangled_name' fields to dmsetup info -c -o. +- Mangle device name on dm_task_set_name/newname call if necessary. +- Add dm_task_get_name_mangled/unmangled to libdevmapper. +- Add dm_set/get_name_mangling_mode to set/get name mangling in libdevmapper. + +* Mon Feb 13 2012 Peter Rajnoha - 2.02.91-2 +- Add configure --with-systemdsystemunitdir. + +* Sun Feb 12 2012 Alasdair Kergon - 2.02.91-1 +- New upstream with trivial fixes and refactoring of some lvmcache and orphan code. + +* Wed Feb 1 2012 Alasdair Kergon - 2.02.90-1 +- Drop support for cman, openais and cmirror for f17. Require dlm not cluster. +- Automatically detect whether corosync clvmd needs to use confdb or cmap. +- Disable partial activation for thin LVs and LVs with all missing segments. +- sync_local_dev_names before (re)activating mirror log for initialisation. +- Do not print warning for pv_min_size between 512KB and 2MB. +- Clean up systemd unit ordering and requirements. +- Allow ALLOC_NORMAL to track reserved extents for log and data on same PV. +- Fix data% report for thin volume used as origin for non-thin snapshot. + +* Thu Jan 26 2012 Alasdair Kergon - 2.02.89-2 +- New upstream release with experimental support for thinly-provisioned devices. +- The changelog for this release is quite long and contained in + WHATS_NEW and WHATS_NEW_DM in the documentation directory. + +* Fri Jan 13 2012 Fedora Release Engineering - 2.02.88-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Fri Dec 30 2011 Peter Robinson - 2.02.88-2 +- update util-linux-ng -> util-linux dependency as it changed long ago. + +* Mon Aug 22 2011 Alasdair Kergon - 2.02.88-1 +- Remove incorrect 'Breaking' error message from allocation code. (2.02.87) +- Add lvconvert --merge support for raid1 devices split with --trackchanges. +- Add --trackchanges support to lvconvert --splitmirrors option for raid1. +- Add dm_tree_node_add_null_area for temporarily-missing raid devs tracked. +- Support lvconvert of -m1 raid1 devices to a higher number. +- Support splitting off a single raid1 rimage in lvconvert --splitmirrors. +- Add -V as short form of --virtualsize in lvcreate. + +* Fri Aug 12 2011 Peter Rajnoha - 2.02.87-1 +- Cache and share generated VG structs to improve performance. +- Suppress locking error messages in monitoring init scripts. +- Add global/detect_internal_vg_cache_corruption to lvm.conf. +- If pipe in clvmd fails return busy instead of using uninitialised descriptors. +- Initialise clvmd locks before lvm context to avoid open descriptor leaks. +- Suppress low-level locking errors and warnings while using --sysinit. +- Add test for fcntl error in singlenode client code. +- Compare file size (as well as timestamp) to detect changed config file. +- Change DEFAULT_UDEV_SYNC to 1 so udev_sync is used if there is no config file. +- Update udev rules to skip DM flags decoding for removed devices. +- Remove device name prefix from dmsetup line output if -j & -m or -u supplied. +- Add new segtype 'raid' for MD RAID 1/4/5/6 support with dmeventd plugin. +- Add ability to reduce the number of mirrors in raid1 arrays to lvconvert. +- Add support for systemd file descriptor handover in dmeventd. +- Add systemd unit file to provide lvm2 monitoring. +- Add systemd unit files for dmeventd. +- Use new oom killer adjustment interface (oom_score_adj) when available. +- Fix read-only identical table reload supression. +- Remove --force option from lvrename manpage. + +* Wed Aug 03 2011 Peter Rajnoha - 2.02.86-5 +- Change DEFAULT_UDEV_SYNC to 1 so udev_sync is used even without any config. + +* Thu Jul 28 2011 Peter Rajnoha - 2.02.86-4 +- Add support for systemd file descriptor handover to dmeventd. +- Add support for new oom killer adjustment interface (oom_score_adj). + +* Wed Jul 20 2011 Peter Rajnoha - 2.02.86-3 +- Fix broken lvm2-sysinit Requires: lvm2 dependency. + +* Mon Jul 18 2011 Peter Rajnoha - 2.02.86-2 +- Add dm-event and lvm2-monitor unit files for use with systemd. +- Add sysvinit subpackage for legacy SysV init script support. + +* Fri Jul 8 2011 Alasdair Kergon - 2.02.86-1 +- Fix activation sequences to avoid trapped I/O with multiple LVs. +- Fix activation sequences to avoid allocating tables while devs suspended. +- Remove unnecessary warning in pvcreate for MD linear devices. +- Add activation/checks to lvm.conf to perform additional ioctl validation. +- Append 'm' attribute to pv_attr for missing PVs. +- Fix to preserve exclusive activation of mirror while up-converting. +- Reject allocation if number of extents is not divisible by area count. +- Fix cluster mirror creation to work with new mirror allocation algorithm. +- Ignore activation/verify_udev_operations if dm kernel driver vsn < 4.18. +- Add activation/verify_udev_operations to lvm.conf, disabled by default. +- Ignore inconsistent pre-commit metadata on MISSING_PV devs while activating. +- Add proper udev library context initialization and finalization to liblvm. +- Downgrade critical_section errors to debug level until it is moved to libdm. +- Fix ignored background polling default in vgchange -ay. +- Fix reduction of mirrors with striped segments to always align to stripe size. +- Validate mirror segments size. +- Fix extent rounding for striped volumes never to reduce more than requested. +- Fix create_temp_name to replace any '/' found in the hostname with '?'. +- Always use append to file in lvmdump. selinux policy may ban file truncation. +- Propagate test mode to clvmd to skip activation and changes to held locks. +- Permit --available with lvcreate so non-snapshot LVs need not be activated. +- Clarify error message when unable to convert an LV into a snapshot of an LV. +- Do not issue an error message when unable to remove .cache on read-only fs. +- Avoid memlock size mismatch by preallocating stdio line buffers. +- Report internal error if suspending a device using an already-suspended dev. +- Report internal error if any table is loaded while any dev is known suspended. +- Report error if a table load requiring target parameters has none supplied. +- Add dmsetup --checks and dm_task_enable_checks framework to validate ioctls. +- Add age_in_minutes parameter to dmsetup udevcomplete_all. +- Disable udev fallback by default and add --verifyudev option to dmsetup. +- Add dm_get_suspended_counter() for number of devs in suspended state by lib. +- Fix "all" report field prefix matching to include label fields with pv_all. +- Delay resuming new preloaded mirror devices with core logs in deptree code. + +* Wed Jun 22 2011 Zdenek Kabelac - 2.02.84-3 +- Updated uname string test. + +* Sat Jun 4 2011 Milan Broz - 2.02.84-2 +- Accept kernel 3.0 uname string in libdevmapper initialization. +- Make systemd initscripts configurable. + +* Wed Feb 9 2011 Alasdair Kergon - 2.02.84-1 +- Fix big-endian CRC32 checksumming broken since 2.02.75. If affected, + ensure metadata backups in /etc/lvm/backup are up-to-date (vgcfgbackup) + then after updating to 2.02.84 restore metadata from them (using pvcreate + with -Zn --restorefile and -u if PVs can no longer be seen, then + vgcfgrestore -f). +- Reinstate libdevmapper DEBUG_MEM support. (Removed in 1.02.62.) + +* Tue Feb 08 2011 Fedora Release Engineering - 2.02.83-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Fri Feb 4 2011 Alasdair Kergon - 2.02.83-1 +- Allow exclusive activation of snapshots in a cluster. +- Don't lose LV exclusive lock state when suspending clustered devices. +- Fix fs operation stack handling when multiple operations on same device. +- Increase hash table sizes to 1024 LV names and 64 PV uuids. +- When setting up mda wipe first 4k of it as was intended. +- Remove unneeded checks for open_count in lv_info(). +- Synchronize with udev before checking open_count in lv_info(). +- Add "dmsetup ls --tree" output to lvmdump. +- Fix udev synchronization with no-locking --sysinit (2.02.80). +- Improve man page style consistency for pvcreate, pvremove, pvresize, pvscan. +- Avoid rebuilding of uuid validation table. +- Improve lvcreate error text from insufficient "extents" to "free space". +- Always use O_DIRECT when opening block devices to check for partitioning. +- Move creation of device nodes from 'create' to 'resume'. +- Add --addnodeonresume and --addnodeoncreate options to dmsetup. +- Add dm_task_set_add_node to libdevmapper to control dev node creation time. +- Add dm_task_secure_data to libdevmapper to wipe ioctl buffers in kernel. +- Log debug message when expected uevent is not generated. +- Set DM_UDEV_DISABLE_OTHER_RULES_FLAG for suspended DM devices in udev rules. +- Begin a new pool object for each row in _output_as_rows() correctly. + +* Mon Jan 24 2011 Alasdair Kergon - 2.02.82-2 +- Bring lvscan man page up-to-date. +- Fix lvchange --test to exit cleanly. +- Add change_tag to toollib. +- Allow multiple pvchange command line options to be specified together. +- Do not fail pvmove polling if another process cleaned up first. +- Avoid clvmd incrementing dlm lockspace reference count more than once. +- Add -f (don't fork) option to clvmd and fix clvmd -d description. + +* Mon Jan 17 2011 Alasdair Kergon - 2.02.81-1 +- Add disk to allowed mirrored log type conversions. +- Accept fusion fio in device type filter. +- Speed up command processing by caching resolved config tree. +- Use same dm cookie for consecutive dm ops in same VG to reduce udev waits. +- Do not scan devices in dev_reset_error_count() when forking. +- Skip unnecessary LOCK_NULL unlock call during volume deactivation. +- Skip fs_unlock when calling exec_cmd within activation code (for modprobe). +- Replace fs_unlock by sync_local_dev_names to notify local clvmd. (2.02.80) +- Fix wrongly paired unlocking of VG_GLOBAL in pvchange. (2.02.66) +- Return 0 from cmirrord initscript 'start' if daemon is already running. +- Add DM_COOKIE_AUTO_CREATE to libdevmapper.h. +- Improve general lvconvert man page description. +- Detect NULL handle in get_property(). +- Fix memory leak in persistent filter creation error path. +- Check for errors setting up dm_task struct in _setup_task(). +- Fail polldaemon creation when lvmcache_init() fails. +- Return PERCENT_INVALID for errors in _copy_percent() and _snap_percent(). +- Detect errors from dm_task_set calls in _get_device_info (dmeventd). +- Fix memory leak in debug mode of restart_clvmd() error path. +- Log error message for pthread_join() failure in clvmd. +- Use tmpfiles.d/lvm2.conf to create /var/lock/lvm and /var/run/lvm at boot. +- Require initscripts for tmpfiles.d/lvm2.conf. + +* Tue Dec 21 2010 Alasdair Kergon - 2.02.79-1 +- Create /var/run/lvm directory during clvmd initialisation if missing. +- Avoid revalidating the label cache immediately after scanning. +- Support scanning for a single VG in independent mdas. +- Don't skip full scan when independent mdas are present even if memlock is set. +- Add copy_percent and snap_percent to liblvm. +- Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout. +- Enhance vg_validate to ensure integrity of LV and PV structs referenced. +- Enhance vg_validate to check composition of pvmove LVs. +- Avoid writing to freed memory in vg_release. (2.02.78) +- Add missing test for reallocation error in _find_parallel_space(). +- Add checks for allocation errors in config node cloning. +- Fix error path if regex engine cannot be created in _build_matcher(). +- Check read() and close() results in _get_cmdline(). +- Fix NULL pointer check in error path in clvmd do_command(). (2.02.78) +- Check for unlink failure in remove_lockfile() in dmeventd. +- Use dm_free for dm_malloc-ed areas in _clog_ctr/_clog_dtr in cmirrord. +- Change dm_regex_create() API to accept const char * const *patterns. + +* Mon Dec 6 2010 Alasdair Kergon - 2.02.78-1 +- Miscellaneous error path corrections and minor leaks fixed. +- Avoid misleading PV missing warnings in vgextend --restoremissing. +- Ignore unrecognised allocation policy found in metadata instead of aborting. +- Disallow lvconvert ops that both allocate & free supplied PEs in a single cmd. +- Fix liblvm seg_size to give bytes not sectors. +- Add functions to look up LV/PV by name/uuid to liblvm. +- Suppress 'No PV label' message when removing several PVs without mdas. +- Fix default /etc/lvm permissions to be 0755. (2.02.66) + +* Mon Nov 22 2010 Alasdair Kergon - 2.02.77-1 +- Add PV and LV segment types and functions to liblvm. +- Add set_property functions to liblvm. +- Remove tag length restriction and allow / = ! : # & characters. +- Support repetition of --addtag and --deltag arguments. +- Add infrastructure for specific cmdline arguments to be repeated in groups. +- Fix fsadm no longer to require '-f' to resize an unmounted filesystem. +- Fix fsadm to detect mounted filesystems on older systems. (2.0.75) +- Extend cling allocation policy to recognise PV tags (cling_by_tags). +- Add allocation/cling_tag_list to lvm.conf. + +* Tue Nov 9 2010 Alasdair Kergon - 2.02.76-1 +- Clarify error messages when activation fails due to activation filter use. +- Fix handling of online filesystem resize (using new fsadm return code). +- Modify fsadm to return different status code for check of mounted filesystem. +- Add DIAGNOSTICS section to fsadm man page. +- Update VG metadata only once in vgchange when making multiple changes. +- Allow independent vgchange arguments to be used together. +- Fix vgchange to process -a, --refresh, --monitor and --poll like lvchange. +- Add dmeventd -R to restart dmeventd without losing monitoring state. (1.02.56) +- Automatically unmount invalidated snapshots in dmeventd. +- Add lvm2app functions to query any pv, vg, or lv property / report field. +- Fix a deadlock caused by double close in clvmd. +- Fix NULL pointer dereference on too-large MDA error path in _vg_read_raw_area. +- Fix regex optimiser not to ignore RHS of OR nodes in _find_leftmost_common. +- Fix memory leak of field_id in _output_field function. +- Allocate buffer for reporting functions dynamically to support long outputs. + +* Mon Oct 25 2010 Alasdair Kergon - 2.02.75-1 +- Fix pthread mutex usage deadlock in clvmd. +- Avoid segfault by limiting partial mode for lvm1 metadata. (2.02.74) +- Skip dm devices in scan if they contain only error targets or are empty. +- Don't take write lock in vgchange --refresh, --poll or --monitor. +- Fix hang when repairing a mirrored-log that had both devs fail. +- Speed up unquoting of quoted double quotes and backslashes. +- Speed up CRC32 calculations by using a larger lookup table. +- Implement dmeventd -R to restart without state loss. +- Add --setuuid to dmsetup rename. +- Add global/metadata_read_only to use unrepaired metadata in read-only cmds. +- Automatically extend snapshots with dmeventd according to policy in lvm.conf. +- Add activation/snapshot_autoextend_threshold/percent to lvm.conf. +- Add devices/disable_after_error_count config to limit access to failing devs. +- Implement vgextend --restoremissing to reinstate missing devs that return. +- Read whole /proc/self/maps file before working with maps entries. +- Convey need for snapshot-merge target in lvconvert error message and man page. +- Give correct error message when creating a too-small snapshot. +- Make lvconvert respect --yes and --force when converting an inactive log. +- Better support of noninteractive shell execution of fsadm. +- Fix usage of --yes flag for ReiserFS resize in fsadm. +- Fix detection of mounted filesystems for fsadm when udev is used. +- Fix assignment of default value to LVM variable in fsadm. +- Fix support for --yes flag for fsadm. +- Do not execute lvresize from fsadm --dry-run. +- Fix fsadm return error code from user's break action. +- Return const pointer from dm_basename() in libdevmapper. +- Add dm_zalloc and use it and dm_pool_zalloc throughout. +- Add dm_task_set_newuuid to set uuid of mapped device post-creation. +- Fix missing variable initialization in cluster_send() function from cmirrord. +- Fix pointer for VG name in _pv_resize_single error code path. +- Fix vg_read memory leak with directory-based metadata. +- Fix memory leak of config_tree in reinitialization code path. +- Fix pool destruction order in dmeventd_lvm2_exit() to avoid leak debug mesg. +- Remove dependency on libm by replacing floor() by an integer-based algorithm. +- Refactor and add 'get' functions for pv, vg and lv properties/fields. +- Add pv_get_property and create generic internal _get_property function. +- Make generic GET_*_PROPERTY_FN macros with secondary macro for vg, pv & lv. + +* Fri Oct 15 2010 Alasdair Kergon - 2.02.73-3 +- Add --setuuid to dmsetup rename. +- Add dm_task_set_newuuid to set uuid of mapped device post-creation. + +* Wed Sep 29 2010 jkeating - 2.02.74-2 +- Rebuilt for gcc bug 634757 + +* Fri Sep 24 2010 Alasdair Kergon - 2.02.74-1 +- Fix the way regions are marked complete to avoid slow --nosync cmirror I/O. +- Add DM_REPORT_FIELD_TYPE_ID_LEN to libdevmapper.h. +- Allow : and @ to be escaped with \ in device names of PVs. +- Avoid stack corruption when reading in large metadata. +- Fix partial mode operations for lvm1 metadata format. +- Track recursive filter iteration to avoid refreshing while in use. (2.02.56) +- Allocate buffer for metadata tags dynamically to remove 4k limit. +- Add random suffix to archive file names to prevent races when being created. +- Reinitialize archive and backup handling on toolcontext refresh. +- Make poll_mirror_progress report PROGRESS_CHECK_FAILED if LV is not a mirror. +- Like mirrors, don't scan origins if ignore_suspended_devices() is set. +- Automatically generate tailored LSB Requires-Start for clvmd init script. +- Fix return code of pvmove --abort PV. +- Fix pvmove --abort to remove even for empty pvmove LV. +- Add implementation for simple numeric 'get' property functions. +- Simplify MD/swap signature detection in pvcreate and allow aborting. +- Allow --yes to be used without --force mode. +- Fix file descriptor leak in swap signature detection error path. +- Detect and allow abort in pvcreate if LUKS signature is detected. + +* Wed Aug 25 2010 Peter Rajnoha - 2.02.73-2 +- Add configure --with-default-data-alignment. +- Update heuristic used for default and detected data alignment. +- Add "devices/default_data_alignment" to lvm.conf. + +* Wed Aug 18 2010 Alasdair Kergon - 2.02.73-1 +- Change default alignment of data extents to 1MB. +- Add --norestorefile option to pvcreate. +- Require --restorefile when using pvcreate --uuid. +- Fix potential for corruption during cluster mirror device failure. +- Ignore snapshots when performing mirror recovery beneath an origin. +- Monitor origin -real device below snapshot instead of overlay device. +- Don't really change monitoring status when in test mode. +- Fix some exit statuses when starting/stopping monitoring fails. +- Enable snapshot monitoring by default when dmeventd is enabled. +- Fix 'lvconvert --splitmirrors' in cluster operation. +- Fix clvmd init script exit code to return 4 when executed as non-root user. +- Recognise and give preference to md device partitions (blkext major). +- Never scan internal LVM devices. +- Don't ignore user-specified PVs in split-mirror operations. (2.02.71) +- Fix data corruption bug in cluster mirrors. +- Require logical volume(s) to be explicitly named for lvconvert --merge. +- Avoid changing aligned pe_start as a side-effect of a log message. +- Use built-in rule for device aliases: block/ < dm- < disk/ < mapper/ < other. +- Handle failure of all mirrored log devices and all but one mirror leg. +- Disallow 'mirrored' log type for cluster mirrors. +- Fix configure to supply DEFAULT_RUN_DIR to Makefiles. +- Fix allocation of wrong number of mirror logs with 'remove' fault policy. +- Add dmeventd/executable to lvm.conf to test alternative dmeventd. +- Fix udev rules to support udev database content generated by older rules. +- Reinstate detection of inappropriate uevent with DISK_RO set and suppress it. +- Fix regex ttree off-by-one error. +- Fix segfault in regex matcher with characters of ordinal value > 127. +- Wait for node creation before displaying debug info in dmsetup. +- Fix return status 0 for "dmsetup info -c -o help". + +* Mon Aug 2 2010 Alasdair Kergon - 2.02.72-5 +- Make udev configurable and merge with f12. + +* Mon Aug 2 2010 Alasdair Kergon - 2.02.72-4 +- Merge f13, f14 and rawhide spec files. + +* Sat Jul 31 2010 Alasdair Kergon - 2.02.72-3 +- Address lvm2-cluster security flaw CVE-2010-2526. + https://bugzilla.redhat.com/CVE-2010-2526 +- Change clvmd to communicate with lvm2 via a socket in /var/run/lvm. +- Return controlled error if clvmd is run by non-root user. +- Never use clvmd singlenode unless explicitly requested with -Isinglenode. +- Fix exported_symbols generation to use standard compiler arguments. +- Use #include <> not "" in lvm2app.h which gets installed on the system. +- Make liblvm.device-mapper wait for include file generation. +- Fix configure to supply DEFAULT_RUN_DIR to Makefiles. +- Fix wrong number of mirror log at allocate policy + +* Wed Jul 28 2010 Alasdair Kergon - 2.02.71-1 +- Make vgck warn about missing PVs. +- Revert failed table load preparation after "create, load and resume". +- Check if cluster log daemon is running before allowing cmirror create. +- Add dm_create_lockfile to libdm and use for pidfiles for all daemons. +- Correct LV list order used by lvconvert when splitting a mirror. +- Check if LV with specified name already exists when splitting a mirror. +- Fix suspend/resume logic for LVs resulting from splitting a mirror. +- Fix possible hang when all mirror images of a mirrored log fail. +- Adjust auto-metadata repair and caching logic to try to cope with empty mdas. +- Update pvcreate, {pv|vg}change, and lvm.conf man pages about metadataignore. +- Prompt if metadataignore with vgextend or pvchange would adjust vg_mda_copies. +- Adjust vg_mda_copies if metadataignore given with vgextend or pvchange. +- Speed up the regex matcher. +- Use "nowatch" udev rule for inappropriate devices. +- Document LVM fault handling in lvm_fault_handling.txt. +- Clarify help text for vg_mda_count. +- Add more verbose messages while checking volume_list and hosttags settings. +- Add log_error when strdup fails in {vg|lv}_change_tag(). +- Do not log backtrace in valid _lv_resume() code path. + +* Wed Jul 7 2010 Alasdair Kergon - 2.02.70-1 +- Remove log directly if all mirror images of a mirrored log fail. +- Randomly select which mdas to use or ignore. +- Add printf format attributes to yes_no_prompt and fix a caller. +- Always pass unsuspended dm devices through persistent filter to other filters. +- Move test for suspended dm devices ahead of other filters. +- Fix another segfault in clvmd -R if no response from daemon received. (2.02.68) +- Remove superfluous suspended device counter from clvmd. +- Fix lvm shell crash when input is entirely whitespace. +- Update partial mode warning message. +- Preserve memlock balance in clvmd when activation triggers a resume. +- Restore the removemissing behaviour of lvconvert --repair --use-policies. + +* Wed Jun 30 2010 Alasdair Kergon - 2.02.69-1 +- Fix vgremove to allow removal of VG with missing PVs. (2.02.52) +- Add metadata/vgmetadatacopies to lvm.conf. +- Add --metadataignore to pvcreate and vgextend. +- Add vg_mda_copies, pv_mda_used_count and vg_mda_used_count to reports. +- Describe --vgmetadatacopies in lvm.conf and other man pages. +- Add --[vg]metadatacopies to select number of mdas to use in a VG. +- Make the metadata ignore bit control read/write metadata areas in a PV. +- Add pvchange --metadataignore to set or clear a metadata ignore bit. +- Refactor metadata code to prepare for --metadataignore / --vgmetadatacopies. +- Ensure region_size of mirrored log does not exceed its full size. +- Preload libc locale messages to prevent reading it in memory locked state. +- Fix handling of simultaneous mirror image and mirrored log image failure. + +* Thu Jun 24 2010 Peter Rajnoha - 2.02.68-2 +- Fix udev rules to handle spurious events properly. +- Add Requires: udev >= 158-1 (needed for the change in udev rules). + +* Wed Jun 23 2010 Alasdair Kergon - 2.02.68-1 +- Have device-mapper-libs require device-mapper (circular) for udev rules. +- Clear exec_prefix. +- Use early udev synchronisation and update of dev nodes for clustered mirrors. +- Add lv_path to reports to offer full /dev pathname. +- Avoid abort when generating cmirror status. +- Fix clvmd initscript status to print only active clustered LVs. +- Fix segfault in clvmd -R if no response from daemon received. +- Honour log argument when down-converting stacked mirror. +- Sleep to workaround clvmd -S race: socket closed early and server drops cmd. +- Exit successfully when using -o help (but not -o +help) with LVM reports. +- Add man pages for lvmconf, dmeventd and non-existent lvmsadc and lvmsar tools. +- Add --force, --nofsck and --resizefs to lvresize/extend/reduce man pages. +- Fix lvm2cmd example in documentation. +- Fix typo in warning message about missing device with allocated data areas. +- Add device name and offset to raw_read_mda_header error messages. +- Allow use of lvm2app and lvm2cmd headers in C++ code. + +* Fri Jun 4 2010 Alasdair Kergon - 2.02.67-1 +- Require partial option in lvchange --refresh for partial LVs. +- Don't merge unchanged persistent cache file before dumping if tool scanned. +- Avoid selecting names under /dev/block if there is an alternative. +- Fix semctl parameter (union) to avoid misaligned parameter on some arches. +- Fix clvmd initscript restart command to start clvmd if not yet running. +- Handle failed restart of clvmd using -S switch properly. +- Use built-in absolute paths in clvmd (clvmd restart and PV and LV queries). +- Consistently return ECMD_FAILED if interrupted processing multiple LVs. +- Add --type parameter description to the lvcreate man page. +- Document 'clear' in dmsetup man page. +- Replace strncmp kernel version number checks with proper ones. +- Update clustered log kernel module name to log-userspace for 2.6.31 onwards. +- Support autoloading of dm-mod module for kernels from 2.6.35. +- Add dm_tree_node_set_presuspend_node() to presuspend child when deactivating. +- Do not fail lvm_init() if init_logging() or _init_rand() generates an errno. +- Fix incorrect memory pool deallocation while using vg_read for files. + +* Thu May 20 2010 Alasdair Kergon - 2.02.66-2 +- Simplify and fix Requires package headers. +- If unable to obtain snapshot percentage leave value blank on reports. +- Use new install_system_dirs and install_initscripts makefile targets. +- Add lvm2app functions to lookup a vgname from a pvid and pvname. +- Change internal processing of PVs in pvchange. +- Validate internal lock ordering of orphan and VG_GLOBAL locks. + +* Mon May 17 2010 Alasdair Kergon - 2.02.65-1 +- Disallow vgchange --clustered if there are active mirrors or snapshots. +- Fix truncated total size displayed by pvscan. +- Skip internal lvm devices in scan if ignore_suspended_devices is set. +- Do not merge old device cache after we run full scan. (2.02.56) +- Add new --sysinit compound option to vgchange and lvchange. +- Fix clvmd init script never to deactivate non-clustered volume groups. +- Drop duplicate errors for read failures and missing devices to verbose level. +- Do not print encryption key in message debug output (cryptsetup luksResume). +- Use -d to control level of messages sent to syslog by dmeventd. +- Change -d to -f to run dmeventd in foreground. +- Fix udev flags on remove in create_and_load error path. +- Add dm_list_splice() function to join two lists together. +- Use /bin/bash for scripts with bashisms. +- Switch Libs.private to Requires.private in devmapper.pc and lvm2app.pc. +- Use pkgconfig Requires.private for devmapper-event.pc. + +* Fri Apr 30 2010 Alasdair Kergon - 2.02.64-1 +- Avoid pointless initialisation when the 'version' command is run directly. +- Fix memory leak for invalid regex pattern input. +- Display invalid regex pattern for filter configuration in case of error. +- Fix -M and --type to use strings, not pointers that change on config refresh. +- Fix lvconvert error message when existing mirrored LV is not found. +- Set appropriate udev flags for reserved LVs. +- Disallow the direct removal of a merging snapshot. +- Don't preload the origin when removing a snapshot whose merge is pending. +- Disallow the addition of mirror images while a conversion is happening. +- Disallow primary mirror image removal when mirror is not in-sync. +- Remove obsolete --name parameter from vgcfgrestore. +- Add -S command to clvmd to restart the daemon preserving exclusive locks. +- Increment lvm2app version from 1 to 2 (memory allocation changes). +- Change lvm2app memory alloc/free for pv/vg/lv properties. +- Change daemon lock filename from lvm2_monitor to lvm2-monitor for consistency. +- Add support for new IMPORT{db} udev rule. +- Add DM_UDEV_PRIMARY_SOURCE_FLAG udev flag to recognize proper DM events. +- Also include udev libs in libdevmapper.pc. +- Cache bitset locations to speed up _calc_states. +- Add a regex optimisation pass for shared prefixes and suffixes. +- Add dm_bit_and and dm_bitset_equal to libdevmapper. +- Speed up dm_bit_get_next with ffs(). + +* Thu Apr 15 2010 Alasdair Kergon - 2.02.63-2 +- Remove 'lvmconf --lockinglibdir' from cluster post: locking is now built-in. +- Move libdevmapper-event-lvm2.so to devel package. +- Explicitly specify libdevmapper-event.so* attributes. +- Drop support for upgrades from very old versions that used lvm not lvm2. +- Move libdevmapper-event plug-in libraries into new device-mapper subdirectory. +- Don't verify lvm.conf contents when using rpm --verify. + +* Wed Apr 14 2010 Alasdair Kergon - 2.02.63-1 +- Move development links to shared objects to /usr (hard-coded temporarily). +- Change libdevmapper deactivation to fail if device is open. +- Wipe memory buffers for libdevmapper dm-ioctl parameters before releasing. +- Strictly require libudev if udev_sync is used. +- Add support for ioctl's DM_UEVENT_GENERATED_FLAG. +- Allow incomplete mirror restore in lvconvert --repair upon insufficient space. +- Do not reset position in metadata ring buffer on vgrename and vgcfgrestore. +- Allow VGs with active LVs to be renamed. +- Only pass visible LVs to tools in cmdline VG name/tag expansions without -a. +- Use C locale and mlockall in clvmd and dmeventd. +- Mask LCK_HOLD in cluster VG locks for upgrade compatibility with older clvmd. +- Add activation/polling_interval to lvm.conf as --interval default. +- Don't ignore error if resuming any LV fails when resuming groups of LVs. +- Skip closing persistent filter cache file if open failed. +- Permit mimage LVs to be striped in lvcreate, lvresize and lvconvert. +- Fix pvmove allocation to take existing parallel stripes into account. +- Fix incorrect removal of symlinks after LV deactivation fails. +- Fix is_partitioned_dev not to attempt to reopen device. +- Fix another thread race in clvmd. +- Improve vg_validate to detect some loops in lists. +- Change most remaining log_error WARNING messages to log_warn. +- Always use blocking lock for VGs and orphan locks. +- Allocate all memory for segments from private VG mempool. +- Optimise searching PV segments for seeking the most recently-added. +- Remove duplicated vg_validate checks when parsing cached metadata. +- Use hash table of LVs to speed up parsing of text metadata with many LVs. +- Fix two vg_validate messages, adding whitespace and parentheses. +- When dmeventd is not forking because of -d flag, don't kill parent process. +- Fix dso resource leak in error path of dmeventd. +- Fix --alloc contiguous policy only to allocate one set of parallel areas. +- Do not allow {vg|lv}change --ignoremonitoring if on clustered VG. +- Add ability to create mirrored logs for mirror LVs. +- Fix clvmd cluster propagation of dmeventd monitoring mode. +- Allow ALLOC_ANYWHERE to split contiguous areas. +- Add some assertions to allocation code. +- Introduce pv_area_used into allocation algorithm and add debug messages. +- Add activation/monitoring to lvm.conf. +- Add --monitor and --ignoremonitoring to lvcreate. +- Don't allow resizing of internal logical volumes. +- Fix libdevmapper-event pkgconfig version string to match libdevmapper. +- Avoid scanning all pvs in the system if operating on a device with mdas. +- Disable long living process flag in lvm2app library. +- Fix pvcreate device md filter check. +- Suppress repeated errors about the same missing PV uuids. +- Bypass full device scans when using internally-cached VG metadata. +- Only do one full device scan during each read of text format metadata. +- Look up missing PVs by uuid not dev_name in pvs to avoid invalid stat. + +* Tue Mar 09 2010 Alasdair Kergon - 2.02.62-1 +- Rewrite clvmd init script. +- Add default alternative to mlockall using mlock to reduce pinned memory size. +- Add use_mlockall and mlock_filter to activation section of lvm.conf. +- Handle misaligned devices that report alignment_offset of -1. +- Extend core allocation code in preparation for mirrored log areas. +- No longer fall back to looking up active devices by name if uuid not found. +- Don't touch /dev in vgmknodes if activation is disabled. +- Add --showkeys parameter description to dmsetup man page. +- Add --help option as synonym for help command. +- Add lvm2app functions lvm_{vg|lv}_{get|add|remove}_tag() functions. +- Refactor snapshot-merge deptree and device removal to support info-by-uuid. + +* Fri Mar 05 2010 Peter Rajnoha - 2.02.61-2 +- Change spec file to support excluding cluster components from the build. + +* Tue Feb 16 2010 Alasdair Kergon - 2.02.61-1 +- Add %%ORIGIN support to lv{create,extend,reduce,resize} --extents. +- Accept a list of LVs with 'lvconvert --merge @tag' using process_each_lv. +- Remove false "failed to find tree node" error when activating merging origin. +- Exit with success when lvconvert --repair --use-policies performs no action. +- Avoid unnecessary second resync when adding mimage to core-logged mirror. +- Make clvmd -V return status zero. +- Fix cmirrord segfault in clog_cpg list processing when converting mirror log. +- Deactivate temporary pvmove mirror cluster-wide when activating it fails. +- Add missing metadata vg_reverts in pvmove error paths. +- Unlock shared lock in clvmd if activation calls fail. +- Add lvm_pv_get_size, lvm_pv_get_free and lvm_pv_get_dev_size to lvm2app. +- Change lvm2app to return all sizes in bytes as documented (not sectors). +- Exclude internal VG names and uuids from lists returned through lvm2app. +- Add LVM_SUPPRESS_LOCKING_FAILURE_MESSAGES environment variable. +- Add DM_UDEV_DISABLE_LIBRARY_FALLBACK udev flag to rely on udev only. +- Remove hard-coding that skipped _mimage devices from 11-dm-lvm.rules. +- Export dm_udev_create_cookie function to create new cookies on demand. +- Add --udevcookie, udevcreatecookie and udevreleasecookie to dmsetup. +- Set udev state automatically instead of using DM_UDEV_DISABLE_CHECKING. +- Set udev state automatically instead of using LVM_UDEV_DISABLE_CHECKING. +- Remove pointless versioned symlinks to dmeventd plugin libraries. + +* Fri Jan 29 2010 Alasdair Kergon - 2.02.60-5 +- Replace spaces with tabs in a couple of places in spec file. + +* Sat Jan 23 2010 Alasdair Kergon - 2.02.60-4 +- Extend cmirrord man page. +- Sleep before first progress check iff pvmove/lvconvert interval has prefix '+'. +- Fix cmirror initscript syntax problems. +- Fix first syslog message prefix for dmeventd plugins. +- Make failed locking initialisation messages more descriptive. + +* Fri Jan 22 2010 Alasdair Kergon - 2.02.59-3 +- Fix dmeventd lvm2 wrapper (plug-ins unusable in last build). +- Make failed locking initialisation messages more descriptive. + +* Fri Jan 22 2010 Fabio M. Di Nitto - 2.02.59-2 +- Drop duplicated BuildRequires on openaislib-devel. +- Drop Requires on clusterlib for cmirror subpackage. +- clvmd subpackage should Requires cman (#506592). + +* Fri Jan 22 2010 Alasdair Kergon - 2.02.59-1 +- Add cmirror subpackage for clustered mirrors. +- Set 'preferred_names' in default lvm.conf. +- Add libdevmapper-event-lvm2.so to serialise dmeventd plugin liblvm2cmd use. +- Stop dmeventd trying to access already-removed snapshots. +- Fix clvmd to never scan suspended devices. +- Fix detection of completed snapshot merge. +- Improve snapshot merge metadata import validation. + +* Thu Jan 14 2010 Alasdair Kergon - 2.02.58-1 +- Fix clvmd automatic target module loading crash. +- Fix allocation code not to stop at the first area of a PV that fits. +- Add support for the "snapshot-merge" kernel target (2.6.33-rc1). +- Add --merge to lvconvert to merge a snapshot into its origin. + +* Tue Jan 12 2010 Alasdair Kergon - 2.02.57-1 +- Add --splitmirrors to lvconvert to split off part of a mirror. +- Allow vgremove to remove a VG with PVs missing after a prompt. +- Add activation/udev_rules config option in lvm.conf. +- Add --poll flag to vgchange and lvchange to control background daemon launch. +- Impose limit of 8 mirror images to match the in-kernel kcopyd restriction. +- Log failure type and recognise type 'F' (flush) in dmeventd mirror plugin. +- Add --noudevrules option for dmsetup to disable /dev node management by udev. +- Fix 'dmsetup info -c -o all' to show all fields. +- Fix coredump and memory leak for 'dmsetup help -c'. +- Rename mirror_device_fault_policy to mirror_image_fault policy. +- Use extended status of new kernel snapshot target 1.8.0 to detect when empty. +- Allow use of precommitted metadata when a PV is missing. +- Add global/abort_on_internal_errors to lvm.conf to assist testing. +- If aborting due to internal error, always send that message to stderr. +- Keep log type consistent when changing mirror image count. +- Exit with success in lvconvert --repair --use-policies on failed allocation. +- Ensure any background daemon exits without duplicating parent's functionality. +- Change background daemon process names to "(lvm2)". +- Fix internal lock state after forking. +- Remove empty PV devices if lvconvert --repair is using defined policies. +- Use fixed buffer to prevent stack overflow in persistent filter dump. +- Propagate metadata commit and revert notifications to other cluster nodes. +- Fix metadata caching and lock state propagation to remote nodes in clvmd. +- Properly decode all flags in clvmd messages including VG locks. +- Drop cached metadata after device was auto-repaired and removed from VG. +- Clear MISSING_PV flag if PV reappeared and is empty. +- Fix removal of multiple devices from a mirror. +- Also clean up PVs flagged as missing in vgreduce --removemissing --force. +- Fix some pvresize and toollib error paths with missing VG releases/unlocks. +- Explicitly call suspend for temporary mirror layer. +- Add memlock information to do_lock_lv debug output. +- Always bypass calls to remote cluster nodes for non-clustered VGs. +- Permit implicit cluster lock conversion in pre/post callbacks on local node. +- Permit implicit cluster lock conversion to the lock mode already held. +- Fix lock flag masking in clvmd so intended code paths get invoked. +- Remove newly-created mirror log from metadata if initial deactivation fails. +- Improve pvmove error message when all source LVs are skipped. +- Fix memlock imbalance in lv_suspend if already suspended. +- Fix pvmove test mode not to poll (and fail). +- Fix vgcreate error message if VG already exists. +- Fix tools to use log_error when aborted due to user response to prompt. +- Fix ignored readahead setting in lvcreate --readahead. +- Fix clvmd memory leak in lv_info_by_lvid by calling release_vg. +- If LVM_UDEV_DISABLE_CHECKING is set in environment, disable udev warnings. +- If DM_UDEV_DISABLE_CHECKING is set in environment, disable udev warnings. +- Always set environment variables for an LVM2 device in 11-dm-lvm.rules. +- Disable udev rules for change events with DISK_RO set. +- Add dm_tree_add_dev_with_udev_flags to provide wider support for udev flags. +- Correct activated or deactivated text in vgchange summary message. +- Fix fsadm man page typo (fsdam). + +* Tue Nov 24 2009 Alasdair Kergon - 2.02.56-2 +- Revert vg_read_internal change as clvmd was not ready for vg_read. (2.02.55) +- Fix unbalanced memory locking when deactivating LVs. +- Add missing vg_release to pvs and pvdisplay to fix memory leak. +- Do not try to unlock VG which is not locked when processing a VG. +- Update .cache file after every full device rescan in clvmd. +- Refresh all device filters (including sysfs) before each full device rescan. +- Return error status if vgchange fails to activate any volume. + +* Thu Nov 19 2009 Alasdair Kergon - 2.02.55-1 +- Fix deadlock when changing mirrors due to unpaired memlock refcount changes. +- Fix pvmove region_size overflow for very large PVs. +- Fix lvcreate and lvresize %%PVS argument always to use sensible total size. +- Directly restrict vgchange to activating visible LVs. +- Fix hash lookup segfault when keys compared are different lengths. +- Flush stdout after yes/no prompt. +- Recognise DRBD devices and handle them like md devices. +- Add dmsetup --inactive support (requires kernel support targetted for 2.6.33). + +* Fri Nov 13 2009 Peter Rajnoha - 2.02.54-3 +- Support udev flags even when udev_sync is disabled. +- Remove last_rule from udev_rules. +- Udev rules cleanup. + +* Tue Nov 3 2009 Peter Rajnoha - 2.02.54-2 +- Enable udev synchronisation code. +- Install default udev rules for device-mapper and LVM2. +- Add BuildRequires: libudev-devel. +- Add Requires: libudev (to check udev is running). +- Add Requires: util-linux-ng (blkid used in udev rules). +- Add Conflicts: dracut < 002-18 (for dracut to install required udev rules) + +* Tue Oct 27 2009 Alasdair Kergon - 2.02.54-1 +- Add implict pvcreate support to vgcreate and vgextend. +- Add --pvmetadatacopies for pvcreate, vgcreate, vgextend, vgconvert. +- Distinguish between powers of 1000 and powers of 1024 in unit suffixes. +- Restart lvconverts in vgchange. +- Don't attempt to deactivate an LV if any of its snapshots are in use. +- Return error if lv_deactivate fails to remove device from kernel. +- Treat input units of both 's' and 'S' as 512-byte sectors. (2.02.49) +- Use standard output units for 'PE Size' and 'Stripe size' in pv/lvdisplay. +- Add global/si_unit_consistency to enable cleaned-up use of units in output. +- Only do lock conversions in clvmd if we are explicitly asked for one. +- Fix clvmd segfault when refresh_toolcontext fails. +- Cleanup mimagetmp LV if allocation fails for new lvconvert mimage. +- Handle metadata with unknown segment types more gracefully. +- Make clvmd return 0 on success rather than 1. +- Correct example.conf to indicate that lvm2 not lvm1 is the default format. +- Delay announcing mirror monitoring to syslog until initialisation succeeded. +- Update lvcreate/lvconvert man pages to explain PhysicalVolume parameter. +- Document --all option in man pages and cleanup {pv|vg|lv}{s|display} pages. + +* Mon Oct 19 2009 Fabio M. Di Nitto - 2.02.53-3 +- Enable openais support in clvmd. + +* Fri Sep 25 2009 Alasdair Kergon - 2.02.53-2 +- Reissued tarball to fix compilation warning from lvm2_log_fn prototype. + +* Fri Sep 25 2009 Alasdair Kergon - 2.02.53-1 +- Create any directories in /dev with umask 022. (#507397) +- Handle paths supplied to dm_task_set_name by getting name from /dev/mapper. +- Add splitname and --yes to dmsetup man page. + +* Thu Sep 24 2009 Peter Rajnoha - 2.02.52-4 +- Disable udev synchronisation code (revert previous build). + +* Mon Sep 21 2009 Peter Rajnoha - 2.02.52-3 +- Enable udev synchronisation code. +- Install default udev rules for device-mapper and LVM2. +- Add BuildRequires: libudev-devel. +- Add Requires: libudev (to check udev is running). +- Add Requires: util-linux-ng (blkid used in udev rules). + +* Wed Sep 16 2009 Alasdair Kergon - 2.02.52-2 +- Build dmeventd and place into a separate set of subpackages. +- Remove no-longer-needed BuildRoot tag and buildroot emptying at install. + +* Tue Sep 15 2009 Alasdair Kergon - 2.02.52-1 +- Prioritise write locks over read locks by default for file locking. +- Add local lock files with suffix ':aux' to serialise locking requests. +- Fix readonly locking to permit writeable global locks (for vgscan). (2.02.49) +- Make readonly locking available as locking type 4. +- Fix global locking in PV reporting commands (2.02.49). +- Make lvchange --refresh only take a read lock on volume group. +- Fix race where non-blocking file locks could be granted in error. +- Fix pvcreate string termination in duplicate uuid warning message. +- Don't loop reading sysfs with pvcreate on a non-blkext partition (2.02.51). +- Fix vgcfgrestore error paths when locking fails (2.02.49). +- Make clvmd check corosync to see what cluster interface it should use. +- Fix vgextend error path - if ORPHAN lock fails, unlock / release vg (2.02.49). +- Clarify use of PE ranges in lv{convert|create|extend|resize} man pages. +- Restore umask when device node creation fails. +- Check kernel vsn to use 'block_on_error' or 'handle_errors' in mirror table. + +* Mon Aug 24 2009 Milan Broz - 2.02.51-3 +- Fix global locking in PV reporting commands (2.02.49). +- Fix pvcreate on a partition (2.02.51). +- Build clvmd with both cman and corosync support. + +* Thu Aug 6 2009 Alasdair Kergon - 2.02.51-2 +- Fix clvmd locking broken in 2.02.50-1. +- Only change LV /dev symlinks on ACTIVATE not PRELOAD (so not done twice). +- Make lvconvert honour log mirror options combined with downconversion. +- Add devices/data_alignment_detection to lvm.conf. +- Add devices/data_alignment_offset_detection to lvm.conf. +- Add --dataalignmentoffset to pvcreate to shift start of aligned data area. +- Update synopsis in lvconvert manpage to mention --repair. +- Document -I option of clvmd in the man page. + +* Thu Jul 30 2009 Alasdair Kergon - 2.02.50-2 +- lvm2-devel requires device-mapper-devel. +- Fix lvm2app.pc filename. + +* Tue Jul 28 2009 Alasdair Kergon - 2.02.50-1 +- Add libs and devel subpackages to include shared libraries for applications. + N.B. The liblvm2app API is not frozen yet and may still be changed + Send any feedback to the mailing list lvm-devel@redhat.com. +- Remove obsolete --with-dmdir from configure. +- Add global/wait_for_locks to lvm.conf so blocking for locks can be disabled. +- Fix race condition with vgcreate and vgextend on same device since 2.02.49. +- Add an API version number, LVM_LIBAPI, to the VERSION string. +- Return EINVALID_CMD_LINE not success when invalid VG name format is used. +- Remove unnecessary messages after vgcreate/vgsplit code change in 2.02.49. +- Store any errno and error messages issued while processing each command. + +* Sat Jul 25 2009 Fedora Release Engineering - 2.02.49-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 15 2009 Alasdair Kergon - 2.02.49-1 +- Exclude VG_GLOBAL from vg_write_lock_held so scans open devs read-only again. +- Fix dev name mismatch in vgcreate man page example. +- Check md devices for a partition table during device scan. +- Add extended device (blkext) and md partition (mdp) types to filters. +- Make text metadata read errors for segment areas more precise. +- Fix text segment metadata read errors to mention correct segment name. +- Include segment and LV names in text segment import error messages. +- Fix memory leak in vgsplit when re-reading the vg. +- Permit several segment types to be registered by a single shared object. +- Update the man pages to document size units uniformly. +- Allow commandline sizes to be specified in terms of bytes and sectors. +- Update 'md_chunk_alignment' to use stripe-width to align PV data area. +- Fix segfault in vg_release when vg->cmd is NULL. +- Add dm_log_with_errno and dm_log_with_errno_init, deprecating the old fns. +- Fix whitespace in linear target line to fix identical table line detection. +- Add device number to more log messages during activation. + +* Fri Jul 10 2009 Fabio M. Di Nitto 2.02.48-2 +- BuildRequires and Requires on stable versions of both corosync-lib (1.0.0-1) + and cluster-lib (3.0.0-20). + +* Tue Jun 30 2009 Alasdair Kergon - 2.02.48-1 +- Abort if automatic metadata correction fails when reading VG to update it. +- Don't fallback to default major number in libdm: use dm_task_set_major_minor. +- Explicitly request fallback to default major number in device mapper. +- Ignore suspended devices during repair. +- Suggest using lvchange --resync when adding leg to not-yet-synced mirror. +- Destroy toolcontext on clvmd exit to avoid memory pool leaks. +- Fix lvconvert not to poll mirror if no conversion in progress. +- Fix memory leaks in toolcontext error path. +- Reinstate partial activation support in clustered mode. +- Allow metadata correction even when PVs are missing. +- Use 'lvm lvresize' instead of 'lvresize' in fsadm. +- Do not use '-n' realine option in fsadm for rescue disk compatiblity. +- Round up requested readahead to at least one page and print warning. +- Try to repair vg before actual vgremove when force flag provided. +- Unify error messages when processing inconsistent volume group. +- Introduce lvconvert --use_policies (repair policy according to lvm.conf). +- Fix rename of active snapshot with virtual origin. +- Fix convert polling to ignore LV with different UUID. +- Cache underlying device readahead only before activation calls. +- Fix segfault when calculating readahead on missing device in vgreduce. +- Remove verbose 'visited' messages. +- Handle multi-extent mirror log allocation when smallest PV has only 1 extent. +- Add LSB standard headers and functions (incl. reload) to clvmd initscript. +- When creating new LV, double-check that name is not already in use. +- Remove /dev/vgname/lvname symlink automatically if LV is no longer visible. +- Rename internal vorigin LV to match visible LV. +- Suppress 'removed' messages displayed when internal LVs are removed. +- Fix lvchange -a and -p for sparse LVs. +- Fix lvcreate --virtualsize to activate the new device immediately. +- Make --snapshot optional with lvcreate --virtualsize. +- Generalise --virtualoriginsize to --virtualsize. +- Skip virtual origins in process_each_lv_in_vg() without --all. +- Fix counting of virtual origin LVs in vg_validate. +- Attempt to load dm-zero module if zero target needed but not present. +- Add crypt target handling to libdevmapper tree nodes. +- Add splitname command to dmsetup. +- Add subsystem, vg_name, lv_name, lv_layer fields to dmsetup reports. +- Make mempool optional in dm_split_lvm_name() in libdevmapper. + +* Wed Jun 10 2009 Fabio M. Di Nitto - 2.02.47-2 +- BuildRequire newer version of corosynclib (0.97-1) to link against + latest libraries version (soname 4.0.0). +- Add lvm2-2_02_48-cluster-cpg-new-api.patch to port clvmd-corosync + to new corosync cpg API. + +* Fri May 22 2009 Alasdair Kergon - 2.02.47-1 +- Inherit readahead setting from underlying devices during activation. +- Detect LVs active on remote nodes by querying locks if supported. +- Enable online resizing of mirrors. +- Use suspend with flush when device size was changed during table preload. +- Implement query_resource_fn for cluster_locking. +- Support query_resource_fn in locking modules. +- Fix pvmove to revert operation if temporary mirror creation fails. +- Fix metadata export for VG with missing PVs. +- Add vgimportclone and install it and the man page by default. +- Force max_lv restriction only for newly created LV. +- Do not query nonexistent devices for readahead. +- Reject missing PVs from allocation in toollib. +- Fix PV datalignment for values starting prior to MDA area. (2.02.45) +- Add sparse devices: lvcreate -s --virtualoriginsize (hidden zero origin). +- Fix minimum width of devices column in reports. +- Add lvs origin_size field. +- Implement lvconvert --repair for repairing partially-failed mirrors. +- Fix vgreduce --removemissing failure exit code. +- Fix remote metadata backup for clvmd. +- Fix metadata backup to run after vg_commit always. +- Fix pvs report for orphan PVs when segment attributes are requested. +- Fix pvs -a output to not read volume groups from non-PV devices. +- Introduce memory pools per volume group (to reduce memory for large VGs). +- Always return exit error status when locking of volume group fails. +- Fix mirror log convert validation question. +- Enable use of cached metadata for pvs and pvdisplay commands. +- Fix memory leak in mirror allocation code. +- Save and restore the previous logging level when log level is changed. +- Fix error message when archive initialization fails. +- Make sure clvmd-corosync releases the lockspace when it exits. +- Fix segfault for vgcfgrestore on VG with missing PVs. +- Block SIGTERM & SIGINT in clvmd subthreads. +- Detect and conditionally wipe swapspace signatures in pvcreate. +- Fix maximal volume count check for snapshots if max_lv set for volume group. +- Fix lvcreate to remove unused cow volume if the snapshot creation fails. +- Fix error messages when PV uuid or pe_start reading fails. +- Flush memory pool and fix locking in clvmd refresh and backup command. +- Fix unlocks in clvmd-corosync. (2.02.45) +- Fix error message when adding metadata directory to internal list fails. +- Fix size and error message of memory allocation at backup initialization. +- Remove old metadata backup file after renaming VG. +- Restore log_suppress state when metadata backup file is up-to-date. +- Export dm_tree_node_size_changed() from libdevmapper. +- Fix segfault when getopt processes dmsetup -U, -G and -M options. +- Add _smp_mflags to compilation and remove DESTDIR. + +* Fri Apr 17 2009 Milan Broz - 2.02.45-4 +- Add MMC (mmcblk) device type to filters. (483686) + +* Mon Mar 30 2009 Jussi Lehtola 2.02.45-3 +- Add FTP server location to Source0. + +* Mon Mar 30 2009 Fabio M. Di Nitto - 2.02.45-2 +- BuildRequires a newer version of corosync (0.95-2) to fix linking. + +* Tue Mar 3 2009 Alasdair Kergon - 2.02.45-1 +- Update clusterlib and corosync dependencies. +- Attempt proper clean up in child before executing fsadm or modprobe. +- Do not scan devices if reporting only attributes from PV label. +- Use pkgconfig to obtain corosync library details during configuration. +- Fix error returns in clvmd-corosync interface to DLM. +- Add --refresh to vgchange and vgmknodes man pages. +- Pass --test from lvresize to fsadm as --dry-run. +- Prevent fsadm from checking mounted filesystems. +- No longer treats any other key as 'no' when prompting in fsadm. +- Add --dataalignment to pvcreate to specify alignment of data area. +- Fix unblocking of interrupts after several commands. +- Provide da and mda locations in debug message when writing text format label. +- Mention the restriction on file descriptors at invocation on the lvm man page. +- Index cached vgmetadata by vgid not vgname to cope with duplicate vgnames. +- No longer require kernel and metadata major numbers to match. +- If kernel supports only one dm major number, use in place of any supplied. +- Add option to /etc/sysconfig/cluster to select cluster type for clvmd. +- Allow clvmd to start up if its lockspace already exists. +- Separate PV label attributes which do not need parse metadata when reporting. +- Remove external dependency on the 'cut' command from fsadm. +- Fix pvs segfault when pv mda attributes requested for unavailable PV. +- Add fsadm support for reszing ext4 filesysystems. +- Change lvm2-cluster to corosync instead of cman. +- Fix some old changelog typos in email addresses. + +* Wed Feb 25 2009 Fedora Release Engineering - 2.02.44-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Tue Jan 27 2009 Alasdair Kergon - 2.02.44-1 +- Add --nameprefixes, --unquoted, --rows to pvs, vgs, lvs man pages. +- Fix lvresize size conversion for fsadm when block size is not 1K. +- Fix pvs segfault when run with orphan PV and some VG fields. +- Display a 'dev_size' of zero for missing devices in reports. +- Add pv_mda_size to pvs and vg_mda_size to vgs. +- Fix lvmdump /sys listing to include virtual devices directory. +- Add "--refresh" functionality to vgchange and vgmknodes. +- Avoid exceeding LV size when wiping device. +- Calculate mirror log size instead of using 1 extent. +- Ensure requested device number is available before activating with it. +- Fix incorrect exit status from 'help '. +- Fix vgrename using UUID if there are VGs with identical names. +- Fix segfault when invalid field given in reporting commands. +- Use better random seed value in temp file creation. +- Add read_urandom to read /dev/urandom. Use in uuid calculation. +- Fix race in vgcreate that would result in second caller overwriting first. +- Fix uninitialised lv_count in vgdisplay -c. +- Don't skip updating pvid hash when lvmcache_info struct got swapped. +- Fix startup race in clvmd. +- Cope with snapshot dependencies when removing a whole VG with lvremove. +- Make man pages and tool help text consistent using | for alternative options. +- Add "all" field to reports expanding to all fields of report type. +- Enforce device name length and character limitations in libdm. + +* Mon Nov 10 2008 Alasdair Kergon - 2.02.43-1 +- Upstream merge of device-mapper and lvm2 source. +- Correct prototype for --permission on lvchange and lvcreate man pages. +- Exit with non-zero status from vgdisplay if couldn't show any requested VG. +- libdevmapper.pc: Use simplified x.y.z version number. +- Accept locking fallback_to_* options in the global section as documented. +- Several fixes to lvconvert involving mirrors. +- Avoid overwriting in-use on-disk text metadata when metadataarea fills up. +- Generate man pages from templates and include version. +- Fix misleading error message when there are no allocatable extents in VG. +- Fix handling of PVs which reappeared with old metadata version. +- Fix validation of --minor and --major in lvcreate to require -My always. +- Allow lvremove to remove LVs from VGs with missing PVs. +- In VG with PVs missing, by default allow activation of LVs that are complete. +- Require --force with --removemissing in vgreduce to remove partial LVs. +- No longer write out PARTIAL flag into metadata backups. +- Treat new default activation/missing_stripe_filler "error" as an error target. +- Add devices/md_chunk_alignment to lvm.conf. +- Pass struct physical_volume to pe_align and adjust for md chunk size. +- Avoid shuffling remaining mirror images when removing one, retaining primary. +- Prevent resizing an LV while lvconvert is using it. +- Avoid repeatedly wiping cache while VG_GLOBAL is held in vgscan & pvscan. +- Fix pvresize to not allow resize if PV has two metadata areas. +- Fix setting of volume limit count if converting to lvm1 format. +- Fix vgconvert logical volume id metadata validation. +- Fix lvmdump metadata gather option (-m) to work correctly. +- Fix allocation bug in text metadata format write error path. +- Fix vgcfgbackup to properly check filename if template is used. +- vgremove tries to remove lv snapshot first. +- Improve file descriptor leak detection to display likely culprit and filename. +- Avoid looping forever in _pv_analyze_mda_raw used by pvck. +- Change lvchange exit status to indicate if any part of the operation failed. +- Fix pvchange and pvremove to handle PVs without mdas. +- Fix pvchange -M1 -u to preserve existing extent locations when there's a VG. +- Cease recognising snapshot-in-use percentages returned by early devt kernels. +- Add backward-compatible flags field to on-disk format_text metadata. +- libdevmapper: Only resume devices in dm_tree_preload_children if size changes. +- libdevmapper: Extend deptree buffers so the largest possible device numbers fit. +- libdevmapper: Underline longer report help text headings. + +* Tue Oct 7 2008 Alasdair Kergon - 2.02.39-6 +- Only set exec_prefix once and configure explicit directories to work with + new version of rpm. + +* Fri Sep 26 2008 Fabio M. Di Nitto - 2.02.39-5 +- Add BuildRequires on cmanlib-devel. This is required after libcman split + from cman and cman-devel into cmanlib and cmanlib-devel. +- Make versioned BuildRequires on cman-devel and cmanlib-devel more strict + to guarantee to get the right version. + +* Thu Sep 25 2008 Fabio M. Di Nitto - 2.02.39-5 +- Add versioned BuildRequires on new cman-devel. + +* Sun Sep 21 2008 Ville Skyttä - 2.02.39-5 +- Change %%patch to %%patch0 to match Patch0 as required by RPM package update. + +* Thu Aug 7 2008 Tom "spot" Callaway - 2.02.39-4 +- Fix license tag. + +* Fri Jun 27 2008 Alasdair Kergon - 2.02.39-3 +- Fix up cache for PVs without mdas after consistent VG metadata is processed. +- Update validation of safe mirror log type conversions in lvconvert. +- Fix lvconvert to disallow snapshot and mirror combinations. +- Fix reporting of LV fields alongside unallocated PV segments. +- Add --unquoted and --rows to reporting tools. +- Avoid undefined status code after _memlock commands in lvm shell. +- Fix and improve readahead 'auto' calculation for stripe_size. +- Fix lvchange output for -r auto setting if auto is already set. +- Fix add_mirror_images not to dereference uninitialized log_lv upon failure. +- Add --force to lvextend and lvresize. +- Fix vgchange to not activate component mirror volumes directly. + +* Wed Jun 25 2008 Alasdair Kergon - 2.02.38-2 +- dmsetup: Add --unquoted and --rows to 'info -c' command. +- libdevmapper: Fix inverted no_flush debug message. + +* Fri Jun 13 2008 Alasdair Kergon - 2.02.38-1 +- libdevmapper: Make dm_hash_iter safe against deletion. +- libdevmapper: Accept a NULL pointer to dm_free silently. +- libdevmapper: Calculate string size within dm_pool_grow_object. +- libdevmapper: Send reporting field help text to stderr not stdout. + +- dmsetup: Add tables_loaded, readonly and suspended columns to reports. +- dmsetup: Add --nameprefixes for new report output format FIELD=VALUE. + +- Add --nameprefixes to reporting tools for field name prefix output format. +- Fix return values for reporting commands when run with no PVs, LVs, or VGs. +- Add omitted unlock_vg() call when sigint_caught() during vg processing. +- Fix free_count when reading pool metadata. +- Fix segfault when using pvcreate on a device containing pool metadata. +- In script-processing mode, stop if any command fails. +- Warn if command exits with non-zero status code without a prior log_error. +- Correct config file line numbers in messages when parsing comments. +- Add missing deactivation after activation failure in lvcreate -Zy. +- When removing LV symlinks, skip any where the VG name is not determined. +- Fix vgsplit internal counting of snapshot LVs. +- Update vgsplit to only restrict split with active LVs involved in split. +- Fix vgsplit to only move hidden 'snapshotN' LVs when necessary. +- Update vgsplit man page to reflect lvnames on the cmdline. +- Update vgsplit to take "-n LogicalVolumeName" on the cmdline. +- Fix vgsplit error paths to release vg_to lock. +- Avoid spurious duplicate VG messages referring to VGs that are gone. +- Drop dev_name_confirmed error message to debug level. +- Fix setpriority error message to signed int. +- Add assertions to trap deprecated P_ and V_ lock usage. +- Avoid using DLM locks with LCK_CACHE type P_ lock requests. +- Don't touch /dev in vgrename if activation is disabled. +- Exclude VG_GLOBAL from internal concurrent VG lock counter. +- Fix vgmerge snapshot_count when source VG contains snapshots. +- Fix internal LV counter when a snapshot is removed. +- Fix metadata corruption writing lvm1-formatted metadata with snapshots. +- Fix lvconvert -m0 allocatable space check. +- Don't attempt remote metadata backups of non-clustered VGs. +- Improve preferred_names lvm.conf example. +- Fix vgdisplay 'Cur LV' field to match lvdisplay output. +- Fix lv_count report field to exclude hidden LVs. +- Fix some pvmove error status codes. +- Indicate whether or not VG is clustered in vgcreate log message. +- Mention default --clustered setting in vgcreate man page. +- Fix vgreduce to use vg_split_mdas to check sufficient mdas remain. +- Update lvmcache VG lock state for all locking types now. +- Fix output if overriding command_names on cmdline. +- Add check to vg_commit() ensuring VG lock held before writing new VG metadata. +- Add validation of LV name to pvmove -n. +- Add some basic internal VG lock validation. +- Fix vgsplit internal counting of snapshot LVs. +- Update vgsplit to only restrict split with active LVs involved in split. +- Fix vgsplit to only move hidden 'snapshotN' LVs when necessary. +- Update vgsplit man page to reflect lvnames on the cmdline. +- Update vgsplit to take "-n LogicalVolumeName" on the cmdline. +- Fix vgsplit error paths to release vg_to lock. +- Fix vgsplit locking of new VG. +- Avoid erroneous vgsplit error message for new VG. +- Suppress duplicate message when lvresize fails because of invalid vgname. +- Cache VG metadata internally while VG lock is held. +- Fix redundant lvresize message if vg doesn't exist. +- Make clvmd-cman use a hash rather than an array for node updown info. +- Decode numbers in clvmd debugging output. +- Fix uninitialised mutex in clvmd if all daemons are not running at startup. +- Add config file overrides to clvmd when it reads the active LVs list. +- Make clvmd refresh the context correctly when lvm.conf is updated. +- Fix another allocation bug with clvmd and large node IDs. +- Fix uninitialised variable in clvmd that could cause odd hangs. +- Correct command name in lvmdiskscan man page. +- clvmd no longer crashes if it sees nodeids over 50. +- Fix potential deadlock in clvmd thread handling. +- Update usage message for clvmd. +- Fix clvmd man page not to print
and clarified debug options. +- Escape double quotes and backslashes in external metadata and config data. +- Correct a function name typo in _line_append error message. +- Fix resetting of MIRROR_IMAGE and VISIBLE_LV after removal of LV. +- Fix remove_layer_from_lv to empty the LV before removing it. +- Add missing no-longer-used segs_using_this_lv test to check_lv_segments. +- Fix lvconvert detection of mirror conversion in progress. +- Avoid automatic lvconvert polldaemon invocation when -R specified. +- Fix 'pvs -a' to detect VGs of PVs without metadata areas. +- Divide up internal orphan volume group by format type. +- Fix lvresize to support /dev/mapper prefix in the LV name. +- Fix lvresize to pass new size to fsadm when extending device. +- Fix unfilled parameter passed to fsadm from lvresize. +- Update fsadm to call lvresize if the partition size differs (with option -l). +- Fix fsadm to support VG/LV names. + +* Wed Apr 2 2008 Jeremy Katz - 2.02.33-11 +- Adjust for new name for vio disks (from danpb) +- And fix the build (also from danpb) + +* Wed Mar 5 2008 Jeremy Katz - 2.02.33-10 +- recognize vio disks + +* Thu Jan 31 2008 Alasdair Kergon - 2.02.33-9 +- Improve internal label caching performance while locks are held. +- Fix mirror log name construction during lvconvert. + +* Tue Jan 29 2008 Alasdair Kergon - 2.02.32-8 +- Fix pvs, vgs, lvs error exit status on some error paths. +- Fix new parameter validation in vgsplit and test mode. +- Fix internal metadata corruption in lvchange --resync. + +* Sat Jan 19 2008 Alasdair Kergon - 2.02.31-7 +- Avoid readahead error message when using default setting of lvcreate -M1. +- Fix lvcreate --nosync not to wait for non-happening sync. +- Add very_verbose lvconvert messages. + +* Thu Jan 17 2008 Alasdair Kergon - 2.02.30-6 +- Remove static libraries and binaries and move most binaries out of /usr. +- Fix a segfault if using pvs with --all argument. +- Fix vgreduce PV list processing not to process every PV in the VG. +- Reinstate VG extent size and stripe size defaults (halved). +- Set default readahead to twice maximium stripe size. +- Detect non-orphans without MDAs correctly. +- Prevent pvcreate from overwriting MDA-less PVs belonging to active VGs. +- Don't use block_on_error with mirror targets version 1.12 and above. +- Change vgsplit -l (for unimplemented --list) into --maxlogicalvolumes. +- Update vgsplit to accept vgcreate options when new VG is destination. +- Update vgsplit to accept existing VG as destination. +- Major restructuring of pvmove and lvconvert code, adding stacking support. +- Add new convert_lv field to lvs output. +- Permit LV segment fields with PV segment reports. +- Extend lvconvert to use polldaemon and wait for completion of initial sync. +- Add seg_start_pe and seg_pe_ranges to reports. +- Add fsadm interface to filesystem resizing tools. +- Update --uuid argument description in man pages. +- Print warning when lvm tools are running as non-root. + +* Thu Dec 20 2007 Alasdair Kergon - 2.02.29-5 +- Fix libdevmapper readahead processing with snapshots (for example). + +* Thu Dec 13 2007 Alasdair Kergon - 2.02.29-4 +- Add missing lvm2 build & runtime dependencies on module-init-tools (modprobe). + +* Thu Dec 6 2007 Jeremy Katz - 2.02.29-3 +- fix requirements + +* Thu Dec 06 2007 Alasdair Kergon - 2.02.29-2 +- Fold device-mapper build into this lvm2 spec file. + +* Wed Dec 05 2007 Alasdair Kergon - 2.02.29-1 +- Make clvmd backup vg metadata on remote nodes. +- Decode cluster locking state in log message. +- Change file locking state messages from debug to very verbose. +- Fix --addtag to drop @ prefix from name. +- Stop clvmd going haywire if a pre_function fails. +- Avoid nested vg_reads when processing PVs in VGs and fix associated locking. +- Attempt to remove incomplete LVs with lvcreate zeroing/activation problems. +- Add full read_ahead support. +- Add lv_read_ahead and lv_kernel_read_ahead fields to reports and lvdisplay. +- Prevent lvconvert -s from using same LV as origin and snapshot. +- Fix human-readable output of odd numbers of sectors. +- Add pv_mda_free and vg_mda_free fields to reports for raw text format. +- Add LVM2 version to 'Generated by' comment in metadata. +- Show 'not usable' space when PV is too large for device in pvdisplay. +- Ignore and fix up any excessive device size found in metadata. +- Fix error message when fixing up PV size in lvm2 metadata (2.02.11). +- Fix orphan-related locking in pvdisplay and pvs. +- Fix missing VG unlocks in some pvchange error paths. +- Add some missing validation of VG names. +- Detect md superblocks version 1.0, 1.1 and 1.2. +- Add some pv-related error paths. +- Handle future sysfs subsystem/block/devices directory structure. +- Fix a bug in lvm_dump.sh checks for lvm/dmsetup binaries. +- Fix underquotations in lvm_dump.sh. +- Print --help output to stdout, not stderr. +- After a cmdline processing error, don't print help text but suggest --help. +- Add %%PVS extents option to lvresize, lvextend, and lvcreate. +- Remove no-longer-correct restrictions on PV arg count with stripes/mirrors. +- Fix strdup memory leak in str_list_dup(). +- Link with -lpthread when static SELinux libraries require that. +- Detect command line PE values that exceed their 32-bit range. +- Include strerror string in dev_open_flags' stat failure message. +- Avoid error when --corelog is provided without --mirrorlog. (2.02.28) +- Correct --mirrorlog argument name in man pages (not --log). +- Clear MIRROR_NOTSYNCED LV flag when converting from mirror to linear. +- Modify lvremove to prompt for removal if LV active on other cluster nodes. +- Add '-f' to vgremove to force removal of VG even if LVs exist. + +* Fri Aug 24 2007 Alasdair Kergon - 2.02.28-1 +- vgscan and pvscan now trigger clvmd -R, which should now work. +- Fix clvmd logging so you can get lvm-level debugging out of it. +- Allow clvmd debug to be turned on in a running daemon using clvmd -d [-C]. +- Add more cluster info to lvmdump. +- Fix lvdisplay man page to say LV size is reported in sectors, not KB. +- Fix loading of persistent cache if cache_dir is used. +- Only permit --force, --verbose and --debug arguments to be repeated. +- Add support for renaming mirrored LVs. +- Add --mirrorlog argument to specify log type for mirrors. +- Don't leak a file descriptor if flock or fcntl fails. +- Detect stream write failure reliably. +- Reduce severity of lstat error messages to very_verbose. +- Update to use autoconf 2.61, while still supporting 2.57. + +* Thu Aug 09 2007 Alasdair Kergon - 2.02.27-3 +- Clarify GPL licence as being version 2. + +* Wed Aug 01 2007 Milan Broz - 2.02.27-2 +- Add SUN's LDOM virtual block device (vdisk) and ps3disk to filters. + +* Wed Jul 18 2007 Alasdair Kergon - 2.02.27-1 +- Add -f to vgcfgrestore to list metadata backup files. +- Add pvdisplay --maps implementation. +- Add devices/preferred_names config regex list for displayed device names. +- Add vg_mda_count and pv_mda_count columns to reports. +- Change cling alloc policy attribute character from 'C' to l'. +- Print warnings to stderr instead of stdout. +- Fix snapshot cow area deactivation if origin is not active. +- Reinitialise internal lvmdiskscan variables when called repeatedly. +- Allow keyboard interrupt during user prompts when appropriate. +- Fix deactivation code to follow dependencies and remove symlinks. +- Fix a segfault in device_is_usable() if a device has no table. +- Fix creation and conversion of mirrors with tags. +- Add command stub for pvck. +- Handle vgsplit of an entire VG as a vgrename. +- Fix vgsplit for lvm1 format (set and validate VG name in PVs metadata). +- Split metadata areas in vgsplit properly. +- Fix and clarify vgsplit error messages. +- Update lists of attribute characters in man pages. +- Remove unsupported LVM1 options from vgcfgrestore man page. +- Update vgcfgrestore man page to show mandatory VG name. +- Update vgrename man page to include UUID and be consistent with lvrename. +- Add some more debug messages to clvmd startup. +- Fix thread race in clvmd. +- Make clvmd cope with quorum devices. +- Add extra internal error checking to clvmd. +- Fix missing lvm_shell symbol in lvm2cmd library. +- Move regex functions into libdevmapper. +- Add kernel and device-mapper targets versions to lvmdump. +- Add /sys/block listings to lvmdump. +- Make lvmdump list /dev recursively. +- Mark /etc/lvm subdirectories as directories in spec file. + +* Mon Mar 19 2007 Alasdair Kergon - 2.02.24-1 +- Add BuildRequires readline-static until makefiles get fixed. +- Fix processing of exit status in init scripts +- Fix vgremove to require at least one vg argument. +- Fix reading of striped LVs in LVM1 format. +- Flag nolocking as clustered so clvmd startup sees clustered LVs. +- Add a few missing pieces of vgname command line validation. +- Support the /dev/mapper prefix on most command lines. + +* Thu Mar 08 2007 Alasdair Kergon - 2.02.23-1 +- Fix vgrename active LV check to ignore differing vgids. +- Fix two more segfaults if an empty config file section encountered. +- Fix a leak in a reporting error path. +- Add devices/cache_dir & devices/cache_file_prefix, deprecating devices/cache. + +* Tue Feb 27 2007 Alasdair Kergon - 2.02.22-3 +- Move .cache file to /etc/lvm/cache. + +* Wed Feb 14 2007 Alasdair Kergon - 2.02.22-2 +- Rebuild after device-mapper package split. + +* Wed Feb 14 2007 Alasdair Kergon - 2.02.22-1 +- Add ncurses-static BuildRequires after package split. +- Fix loading of segment_libraries. +- If a PV reappears after it was removed from its VG, make it an orphan. +- Don't update metadata automatically if VGIDs don't match. +- Fix some vgreduce --removemissing command line validation. +- Trivial man page corrections (-b and -P). +- Add global/units to example.conf. +- Remove readline support from lvm.static. + +* Mon Feb 05 2007 Alasdair Kergon - 2.02.21-4 +- Remove file wildcards and unintentional lvmconf installation. + +* Mon Feb 05 2007 Alasdair Kergon - 2.02.21-3 +- Add build dependency on new device-mapper-devel package. + +* Wed Jan 31 2007 Alasdair Kergon - 2.02.21-2 +- Remove superfluous execute perm from .cache data file. + +* Tue Jan 30 2007 Alasdair Kergon - 2.02.21-1 +- Fix vgsplit to handle mirrors. +- Reorder fields in reporting field definitions. +- Fix vgs to treat args as VGs even when PV fields are displayed. +- Fix md signature check to handle both endiannesses. + +* Fri Jan 26 2007 Alasdair Kergon - 2.02.20-1 +- Fix exit statuses of reporting tools. +- Add some missing close() and fclose() return code checks. +- Add devices/ignore_suspended_devices to ignore suspended dm devices. +- Fix refresh_toolcontext() always to wipe persistent device filter cache. +- Long-lived processes write out persistent dev cache in refresh_toolcontext(). +- Streamline dm_report_field_* interface. +- Update reporting man pages. +- Add --clustered to man pages. +- Add field definitions to report help text. + +* Mon Jan 22 2007 Milan Broz - 2.02.19-2 +- Remove BuildRequires libtermcap-devel + Resolves: #223766 + +* Wed Jan 17 2007 Alasdair Kergon - 2.02.19-1 +- Fix a segfault if an empty config file section encountered. +- Fix partition table processing after sparc changes. +- Fix cmdline PE range processing segfault. +- Move basic reporting functions into libdevmapper. + +* Fri Jan 12 2007 Alasdair Kergon - 2.02.18-2 +- Rebuild. + +* Thu Jan 11 2007 Alasdair Kergon - 2.02.18-1 +- Use CFLAGS when linking so mixed sparc builds can supply -m64. +- Prevent permission changes on active mirrors. +- Print warning instead of error message if lvconvert cannot zero volume. +- Add snapshot options to lvconvert man page. +- dumpconfig accepts a list of configuration variables to display. +- Change dumpconfig to use --file to redirect output to a file. +- Avoid vgreduce error when mirror code removes the log LV. +- Fix ambiguous vgsplit error message for split LV. +- Fix lvextend man page typo. +- Use no flush suspending for mirrors. +- Fix create mirror with name longer than 22 chars. + +* Thu Dec 14 2006 Alasdair Kergon - 2.02.17-1 +- Add missing pvremove error message when device doesn't exist. +- When lvconvert allocates a mirror log, respect parallel area constraints. +- Check for failure to allocate just the mirror log. +- Support mirror log allocation when there is only one PV: area_count now 0. +- Fix detection of smallest area in _alloc_parallel_area() for cling policy. +- Add manpage entry for clvmd -T +- Fix hang in clvmd if a pre-command failed. + +* Fri Dec 01 2006 Alasdair Kergon - 2.02.16-1 +- Fix VG clustered read locks to use PR not CR. +- Adjust some alignments for ia64/sparc. +- Fix mirror segment removal to use temporary error segment. +- Always compile debug logging into clvmd. +- Add startup timeout to clvmd startup script. +- Add -T (startup timeout) switch to clvmd. +- Improve lvm_dump.sh robustness. + +* Tue Nov 21 2006 Alasdair Kergon - 2.02.15-3 +- Fix clvmd init script line truncation. + +* Tue Nov 21 2006 Alasdair Kergon - 2.02.15-2 +- Fix lvm.conf segfault. + +* Mon Nov 20 2006 Alasdair Kergon - 2.02.15-1 +- New upstream - see WHATS_NEW. + +* Sat Nov 11 2006 Alasdair Kergon - 2.02.14-1 +- New upstream - see WHATS_NEW. + +* Mon Oct 30 2006 Alasdair Kergon - 2.02.13-2 +- Fix high-level free-space check on partial allocation. + Resolves: #212774 + +* Fri Oct 27 2006 Alasdair Kergon - 2.02.13-1 +- New upstream - see WHATS_NEW. + Resolves: #205818 + +* Fri Oct 20 2006 Alasdair Kergon - 2.02.12-2 +- Remove no-longer-used ldconfig from lvm2-cluster and fix lvmconf + to cope without the shared library. + +* Mon Oct 16 2006 Alasdair Kergon - 2.02.12-1 +- New upstream. + +* Sat Oct 14 2006 Alasdair Kergon - 2.02.11-6 +- Incorporate lvm2-cluster as a subpackage. + +* Sat Oct 14 2006 Alasdair Kergon - 2.02.11-5 +- Install lvmdump script. + +* Sat Oct 14 2006 Alasdair Kergon - 2.02.11-4 +- Build in cluster locking with fallback if external locking fails to load. + +* Sat Oct 14 2006 Alasdair Kergon - 2.02.11-3 +- Drop .0 suffix from release. + +* Sat Oct 14 2006 Alasdair Kergon - 2.02.11-2.0 +- Append distribution to release. + +* Fri Oct 13 2006 Alasdair Kergon - 2.02.11-1.0 +- New upstream with numerous fixes and small enhancements. + (See the WHATS_NEW documentation file for complete upstream changelog.) + +* Thu Sep 28 2006 Peter Jones - 2.02.06-4 +- Fix metadata and map alignment problems on ppc64 (#206202) + +* Tue Aug 1 2006 Jeremy Katz - 2.02.06-3 +- require new libselinux to avoid segfaults on xen (#200783) + +* Thu Jul 27 2006 Jeremy Katz - 2.02.06-2 +- free trip through the buildsystem + +* Wed Jul 12 2006 Jesse Keating - 2.02.06-1.2.1 +- rebuild + +* Tue Jun 6 2006 Stephen C. Tweedie - 2.02.06-1.2 +- Rebuild to pick up new nosegneg libc.a for lvm.static + +* Mon May 22 2006 Alasdair Kergon - 2.02.06-1.1 +- Reinstate archs now build system is back. +- BuildRequires libsepol-devel. + +* Fri May 12 2006 Alasdair Kergon - 2.02.06-1.0 +- New upstream release. + +* Sat Apr 22 2006 Alasdair Kergon - 2.02.05-1.1 +- Exclude archs that aren't building. + +* Fri Apr 21 2006 Alasdair Kergon - 2.02.05-1.0 +- Fix VG uuid comparisons. + +* Wed Apr 19 2006 Alasdair Kergon - 2.02.04-1.0 +- New release upstream, including better handling of duplicated VG names. + +* Fri Feb 10 2006 Jesse Keating - 2.02.01-1.2.1 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 2.02.01-1.2 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Fri Dec 09 2005 Jesse Keating +- rebuilt + +* Fri Dec 2 2005 Peter Jones - 2.02.01-1 +- update to 2.02.01 + +* Tue Nov 8 2005 Jeremy Katz - 2.01.14-4 +- add patch for xen block devices + +* Sat Oct 15 2005 Florian La Roche +- add -lselinux -lsepol to the static linking -ldevice-mapper requires it + +* Wed Sep 14 2005 Jeremy Katz - 2.01.14-2 +- the distro doesn't really work without a 2.6 kernel, so no need to require it + +* Thu Aug 4 2005 Alasdair Kergon - 2.01.14-1.0 +- And a few more bugs fixes. + +* Wed Jul 13 2005 Alasdair Kergon - 2.01.13-1.0 +- Fix several bugs discovered in the last release. + +* Tue Jun 14 2005 Alasdair Kergon - 2.01.12-1.0 +- New version upstream with a lot of fixes and enhancements. + +* Wed Apr 27 2005 Alasdair Kergon - 2.01.08-2.1 +- Add /etc/lvm + +* Wed Apr 27 2005 Alasdair Kergon - 2.01.08-2.0 +- No longer abort read operations if archive/backup directories aren't there. +- Add runtime directories and file to the package. + +* Tue Mar 22 2005 Alasdair Kergon - 2.01.08-1.0 +- Improve detection of external changes affecting internal cache. +- Add clustered VG attribute. +- Suppress rmdir opendir error message. + +* Tue Mar 08 2005 Alasdair Kergon - 2.01.07-1.3 +* Tue Mar 08 2005 Alasdair Kergon - 2.01.07-1.2 +* Tue Mar 08 2005 Alasdair Kergon - 2.01.07-1.1 +- Suppress some new compiler messages. + +* Tue Mar 08 2005 Alasdair Kergon - 2.01.07-1.0 +- Remove build directory from built-in path. +- Extra /dev scanning required for clustered operation. + +* Thu Mar 03 2005 Alasdair Kergon - 2.01.06-1.0 +- Allow anaconda to suppress warning messages. + +* Fri Feb 18 2005 Alasdair Kergon - 2.01.05-1.0 +- Upstream changes not affecting Fedora. + +* Wed Feb 09 2005 Alasdair Kergon - 2.01.04-1.0 +- Offset pool minors; lvm2cmd.so skips open fd check; pvmove -f gone. + +* Tue Feb 01 2005 Alasdair Kergon - 2.01.03-1.0 +- Fix snapshot device size & 64-bit display output. + +* Fri Jan 21 2005 Alasdair Kergon - 2.01.02-1.0 +- Minor fixes. + +* Mon Jan 17 2005 Alasdair Kergon - 2.01.01-1.0 +- Update vgcreate man page. Preparation for snapshot origin extension fix. + +* Mon Jan 17 2005 Alasdair Kergon - 2.01.00-1.0 +- Fix metadata auto-correction. Only request open_count when needed. + +* Wed Jan 12 2005 Tim Waugh - 2.00.33-2.0 +- Rebuilt for new readline. + +* Fri Jan 7 2005 Alasdair Kergon - 2.00.33-1.0 +- pvcreate wipes ext label +- several clvm fixes + +* Thu Jan 6 2005 Alasdair Kergon - 2.00.32-2.0 +- Remove temporary /sbin symlinks no longer needed. +- Include read-only pool support in the build. + +* Wed Dec 22 2004 Alasdair Kergon - 2.00.32-1.0 +- More fixes (143501). + +* Sun Dec 12 2004 Alasdair Kergon - 2.00.31-1.0 +- Fix pvcreate install issues. + +* Fri Dec 10 2004 Alasdair Kergon - 2.00.30-1.0 +- Additional debugging code. +- Some trivial man page corrections. + +* Tue Nov 30 2004 Alasdair Kergon - 2.00.29-1.3 +- Reinstate all archs. + +* Sun Nov 28 2004 Alasdair Kergon - 2.00.29-1.2 +- Try excluding more archs. + +* Sat Nov 27 2004 Alasdair Kergon - 2.00.29-1.1 +- Exclude s390x which fails. + +* Sat Nov 27 2004 Alasdair Kergon - 2.00.29-1 +- Fix last fix. + +* Sat Nov 27 2004 Alasdair Kergon - 2.00.28-1 +- Endian fix to partition/md signature detection. + +* Wed Nov 24 2004 Alasdair Kergon - 2.00.27-1 +- Fix partition table detection & an out of memory segfault. + +* Tue Nov 23 2004 Alasdair Kergon - 2.00.26-1 +- Several installation-related fixes & man page updates. + +* Mon Oct 25 2004 Elliot Lee - 2.00.25-1.01 +- Fix 2.6 kernel requirement + +* Wed Sep 29 2004 Alasdair Kergon - 2.00.25-1 +- Fix vgmknodes return code & vgremove locking. + +* Fri Sep 17 2004 Alasdair Kergon - 2.00.24-2 +- Obsolete old lvm1 packages; refuse install if running kernel 2.4. [bz 128185] + +* Thu Sep 16 2004 Alasdair Kergon - 2.00.24-1 +- More upstream fixes. (Always check WHATS_NEW file for details.) +- Add requested BuildRequires. [bz 124916, 132408] + +* Wed Sep 15 2004 Alasdair Kergon - 2.00.23-1 +- Various minor upstream fixes. + +* Fri Sep 3 2004 Alasdair Kergon - 2.00.22-1 +- Permission fix included upstream; use different endian conversion macros. + +* Thu Sep 2 2004 Jeremy Katz - 2.00.21-2 +- fix permissions on vg dirs + +* Thu Aug 19 2004 Alasdair Kergon - 2.00.21-1 +- New upstream release incorporating fixes plus minor enhancements. + +* Tue Aug 17 2004 Jeremy Katz - 2.00.20-2 +- add patch for iSeries viodasd support +- add patch to check file type using stat(2) if d_type == DT_UNKNOWN (#129674) + +* Sat Jul 3 2004 Alasdair Kergon - 2.00.20-1 +- New upstream release fixes 2.6 kernel device numbers. + +* Tue Jun 29 2004 Alasdair Kergon - 2.00.19-1 +- Latest upstream release. Lots of changes (see WHATS_NEW). + +* Tue Jun 15 2004 Elliot Lee - 2.00.15-5 +- rebuilt + +* Wed May 26 2004 Alasdair Kergon - 2.00.15-4 +- clone %%description from LVM rpm + +* Wed May 26 2004 Alasdair Kergon - 2.00.15-3 +- vgscan shouldn't return error status when no VGs present + +* Thu May 06 2004 Warren Togami - 2.00.15-2 +- i2o patch from Markus Lidel + +* Tue Apr 20 2004 Bill Nottingham - 2.00.15-1.1 +- handle disabled SELinux correctly, so that LVMs can be detected in a + non-SELinux context + +* Mon Apr 19 2004 Alasdair Kergon - 2.00.15-1 +- Fix non-root build with current version of 'install'. + +* Fri Apr 16 2004 Alasdair Kergon - 2.00.14-1 +- Use 64-bit file offsets. + +* Fri Apr 16 2004 Alasdair Kergon - 2.00.13-1 +- Avoid scanning devices containing md superblocks. +- Integrate ENOTSUP patch. + +* Thu Apr 15 2004 Jeremy Katz - 2.00.12-4 +- don't die if we get ENOTSUP setting selinux contexts + +* Thu Apr 15 2004 Alasdair Kergon 2.00.12-3 +- Add temporary pvscan symlink for LVM1 until mkinitrd gets updated. + +* Wed Apr 14 2004 Alasdair Kergon 2.00.12-2 +- Mark config file noreplace. + +* Wed Apr 14 2004 Alasdair Kergon 2.00.12-1 +- Install default /etc/lvm/lvm.conf. +- Move non-static binaries to /usr/sbin. +- Add temporary links in /sbin to lvm.static until rc.sysinit gets updated. + +* Thu Apr 08 2004 Alasdair Kergon 2.00.11-1 +- Fallback to using LVM1 tools when using a 2.4 kernel without device-mapper. + +* Wed Apr 07 2004 Alasdair Kergon 2.00.10-2 +- Install the full toolset, not just 'lvm'. + +* Wed Apr 07 2004 Alasdair Kergon 2.00.10-1 +- Update to version 2.00.10, which incorporates the RH-specific patches + and includes various fixes and enhancements detailed in WHATS_NEW. + +* Wed Mar 17 2004 Jeremy Katz 2.00.08-5 +- Fix sysfs patch to find sysfs +- Take patch from dwalsh and tweak a little for setting SELinux contexts on + device node creation and also do it on the symlink creation. + Part of this should probably be pushed down to device-mapper instead + +* Thu Feb 19 2004 Stephen C. Tweedie 2.00.08-4 +- Add sysfs filter patch +- Allow non-root users to build RPM + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Fri Dec 5 2003 Jeremy Katz 2.00.08-2 +- add static lvm binary + +* Tue Dec 2 2003 Jeremy Katz +- Initial build. + +