master - tests: remove debug.log in enable_dev
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=4ed831e7ef4cc8...
Commit: 4ed831e7ef4cc82c84731294f0189620ff5439c5
Parent: 108ae0edc6a6c4bb771fa7931fc1e709793ddadf
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 11 13:42:03 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 19:00:06 2014 +0100
tests: remove debug.log in enable_dev
In aux functions we may drop debug log from
last running lvm command - so we do not
get debug log from properly executed command,
when we fail here.
---
test/lib/aux.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
index 3c02d40..9420528 100644
--- a/test/lib/aux.sh
+++ b/test/lib/aux.sh
@@ -393,6 +393,7 @@ disable_dev() {
enable_dev() {
local dev
+ rm -f debug.log
init_udev_transaction
for dev in "$@"; do
local name=$(echo "$dev" | sed -e 's,.*/,,')
10 years, 3 months
master - cleanup: fix some lvm.conf typos
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=108ae0edc6a6c4...
Commit: 108ae0edc6a6c4bb771fa7931fc1e709793ddadf
Parent: 9d69585b82d8bc2305f7ac197ef22751f9821a5f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 11 18:05:39 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 19:00:06 2014 +0100
cleanup: fix some lvm.conf typos
---
conf/example.conf.in | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/conf/example.conf.in b/conf/example.conf.in
index 08ce877..1572750 100644
--- a/conf/example.conf.in
+++ b/conf/example.conf.in
@@ -336,14 +336,14 @@ allocation {
# thin_pool_chunk_size_policy = "generic"
# Specify the minimal chunk size (in KB) for thin pool volumes.
- # Use of the larger chunk size may improve perfomance for plain
+ # Use of the larger chunk size may improve performance for plain
# thin volumes, however using them for snapshot volumes is less efficient,
# as it consumes more space and takes extra time for copying.
# When unset, lvm tries to estimate chunk size starting from 64KB
# Supported values are in range from 64 to 1048576.
# thin_pool_chunk_size = 64
- # Specify discards behavior of the thin pool volume.
+ # Specify discards behaviour of the thin pool volume.
# Select one of "ignore", "nopassdown", "passdown"
# thin_pool_discards = "passdown"
@@ -423,7 +423,7 @@ log {
# Configuration of metadata backups and archiving. In LVM2 when we
# talk about a 'backup' we mean making a copy of the metadata for the
# *current* system. The 'archive' contains old metadata configurations.
-# Backups are stored in a human readeable text format.
+# Backups are stored in a human readable text format.
backup {
# Should we maintain a backup of the current metadata configuration ?
@@ -614,7 +614,7 @@ global {
# "mirror" - LVM will layer the 'mirror' and 'stripe' segment types. It
# will do this by creating a mirror on top of striped sub-LVs;
# effectively creating a RAID 0+1 array. This is suboptimal
- # in terms of providing redunancy and performance. Changing to
+ # in terms of providing redundancy and performance. Changing to
# this setting is not advised.
# Specify the '--type <raid10|mirror>' option to override this default
# setting.
@@ -678,7 +678,7 @@ global {
# Array of string options passed with thin_check command. By default,
# option "-q" is for quiet output.
# With thin_check version 2.1 or newer you can add "--ignore-non-fatal-errors"
- # to let it pass through ignoreable errors and fix them later.
+ # to let it pass through ignorable errors and fix them later.
#
# thin_check_options = [ "-q" ]
@@ -838,7 +838,7 @@ activation {
# auto_set_activation_skip = 1
# For RAID or 'mirror' segment types, 'raid_region_size' is the
- # size (in kiB) of each:
+ # size (in KiB) of each:
# - synchronization operation when initializing
# - each copy operation when performing a 'pvmove' (using 'mirror' segtype)
# This setting has replaced 'mirror_region_size' since version 2.02.99
10 years, 3 months
master - cleanup: remove unneeded header files
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9d69585b82d8bc...
Commit: 9d69585b82d8bc2305f7ac197ef22751f9821a5f
Parent: e5d59d96187d4ba6efa88cca53f608cd646f461a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 9 21:32:57 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 19:00:06 2014 +0100
cleanup: remove unneeded header files
---
lib/cache_segtype/cache.c | 1 -
lib/label/label.c | 1 -
lib/metadata/pool_manip.c | 1 -
lib/metadata/thin_manip.c | 1 -
lib/misc/lvm-exec.c | 1 -
5 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 3e74495..7557a7d 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -17,7 +17,6 @@
#include "segtype.h"
#include "display.h"
#include "text_export.h"
-#include "text_import.h"
#include "config.h"
#include "str_list.h"
#include "targets.h"
diff --git a/lib/label/label.c b/lib/label/label.c
index 25e5f2c..703fef7 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -19,7 +19,6 @@
#include "xlate.h"
#include "lvmcache.h"
#include "lvmetad.h"
-#include "metadata.h"
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c
index afb77d6..0c7bf96 100644
--- a/lib/metadata/pool_manip.c
+++ b/lib/metadata/pool_manip.c
@@ -23,7 +23,6 @@
#include "segtype.h"
#include "lv_alloc.h"
#include "defaults.h"
-#include "display.h"
int attach_pool_metadata_lv(struct lv_segment *pool_seg,
struct logical_volume *metadata_lv)
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index 0449b45..c3f8e56 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -17,7 +17,6 @@
#include "locking.h"
#include "metadata.h"
#include "segtype.h"
-#include "lv_alloc.h"
#include "defaults.h"
#include "display.h"
diff --git a/lib/misc/lvm-exec.c b/lib/misc/lvm-exec.c
index 01704ad..e862bad 100644
--- a/lib/misc/lvm-exec.c
+++ b/lib/misc/lvm-exec.c
@@ -18,7 +18,6 @@
#include "locking.h"
#include "lvm-exec.h"
#include "toolcontext.h"
-#include "activate.h"
#include <unistd.h>
#include <sys/wait.h>
10 years, 3 months
master - cleanup: use string constant with '_'
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=e5d59d96187d4b...
Commit: e5d59d96187d4ba6efa88cca53f608cd646f461a
Parent: f86e18bfeb8f047ac3fdc2b7a95e2f80a0bcdbfb
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 9 21:33:36 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 19:00:06 2014 +0100
cleanup: use string constant with '_'
---
lib/device/dev-type.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 87a6659..81100ad 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -460,9 +460,9 @@ static int _blkid_wipe(blkid_probe probe, struct device *dev, const char *name,
uint32_t types_to_exclude, uint32_t types_no_prompt,
int yes, force_t force)
{
- static const char* msg_failed_offset = "Failed to get offset of the %s signature on %s.";
- static const char* msg_failed_length = "Failed to get length of the %s signature on %s.";
- static const char* msg_wiping = "Wiping %s signature on %s.";
+ static const char _msg_failed_offset[] = "Failed to get offset of the %s signature on %s.";
+ static const char _msg_failed_length[] = "Failed to get length of the %s signature on %s.";
+ static const char _msg_wiping[] = "Wiping %s signature on %s.";
const char *offset = NULL, *type = NULL, *magic = NULL,
*usage = NULL, *label = NULL, *uuid = NULL;
loff_t offset_value;
@@ -472,20 +472,20 @@ static int _blkid_wipe(blkid_probe probe, struct device *dev, const char *name,
if (_type_in_flag_list(type, types_to_exclude))
return 1;
if (blkid_probe_lookup_value(probe, "SBMAGIC_OFFSET", &offset, NULL)) {
- log_error(msg_failed_offset, type, name);
+ log_error(_msg_failed_offset, type, name);
return 0;
}
if (blkid_probe_lookup_value(probe, "SBMAGIC", &magic, &len)) {
- log_error(msg_failed_length, type, name);
+ log_error(_msg_failed_length, type, name);
return 0;
}
} else if (!blkid_probe_lookup_value(probe, "PTTYPE", &type, NULL)) {
if (blkid_probe_lookup_value(probe, "PTMAGIC_OFFSET", &offset, NULL)) {
- log_error(msg_failed_offset, type, name);
+ log_error(_msg_failed_offset, type, name);
return 0;
}
if (blkid_probe_lookup_value(probe, "PTMAGIC", &magic, &len)) {
- log_error(msg_failed_length, type, name);
+ log_error(_msg_failed_length, type, name);
return 0;
}
usage = "partition table";
@@ -508,9 +508,9 @@ static int _blkid_wipe(blkid_probe probe, struct device *dev, const char *name,
yes_no_prompt("WARNING: %s signature detected on %s at offset %s. "
"Wipe it? [y/n] ", type, name, offset) != 'y')
return_0;
- log_print_unless_silent(msg_wiping, type, name);
+ log_print_unless_silent(_msg_wiping, type, name);
} else
- log_verbose(msg_wiping, type, name);
+ log_verbose(_msg_wiping, type, name);
if (!dev_set(dev, offset_value, len, 0)) {
log_error("Failed to wipe %s signature on %s.", type, name);
10 years, 3 months
master - cleanup: condition reodering
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=f86e18bfeb8f04...
Commit: f86e18bfeb8f047ac3fdc2b7a95e2f80a0bcdbfb
Parent: bcd6b643be0aaef1df06a4df482a8e528d3cd36a
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 11 13:42:32 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 19:00:06 2014 +0100
cleanup: condition reodering
Check SEG_CANNOT_BE_ZEROED before even calling arg_str_value which
is not needed in this case.
Set it to 1 or 0 and not just result of strcmp call.
---
tools/lvcreate.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 638a868..bf719fe 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -1003,13 +1003,13 @@ static int _lvcreate_params(struct lvcreate_params *lp,
/*
* Should we zero/wipe signatures on the lv.
*/
- lp->zero = strcmp(arg_str_value(cmd, zero_ARG,
- (lp->segtype->flags & SEG_CANNOT_BE_ZEROED) ? "n" : "y"), "n");
+ lp->zero = (!(lp->segtype->flags & SEG_CANNOT_BE_ZEROED) &&
+ (strcmp(arg_str_value(cmd, zero_ARG, "y"), "y") == 0)) ? 1 : 0;
if (arg_count(cmd, wipesignatures_ARG)) {
/* If -W/--wipesignatures is given on command line directly, respect it. */
- lp->wipe_signatures = strcmp(arg_str_value(cmd, wipesignatures_ARG,
- (lp->segtype->flags & SEG_CANNOT_BE_ZEROED) ? "n" : "y"), "n");
+ lp->wipe_signatures =(!(lp->segtype->flags & SEG_CANNOT_BE_ZEROED) &&
+ (strcmp(arg_str_value(cmd, wipesignatures_ARG, "y"), "y") == 0)) ? 1 : 0;
} else {
/*
* If -W/--wipesignatures is not given on command line,
10 years, 3 months
master - cleanup: update clearing message
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=bcd6b643be0aae...
Commit: bcd6b643be0aaef1df06a4df482a8e528d3cd36a
Parent: 40a9c443a925ff2fbc7c12972c3cfa726b880580
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 11 13:30:41 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 18:59:22 2014 +0100
cleanup: update clearing message
Since some targets are using this routine to setup
other values then 0 and also may clear much more data then
just disk header - add better message.
---
lib/metadata/lv_manip.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 1b9a7ae..826dbb2 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -5550,8 +5550,9 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
if (zero_sectors > lv->size)
zero_sectors = lv->size;
- log_verbose("Clearing start of logical volume \"%s/%s\"",
- lv->vg->name, lv->name);
+ log_verbose("Initializing %s of logical volume \"%s/%s\" with value %d.",
+ display_size(lv->vg->cmd, zero_sectors),
+ lv->vg->name, lv->name, wp.zero_value);
if (!dev_set(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT, wp.zero_value))
stack;
10 years, 3 months
master - man: use some existing indentifier
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=40a9c443a925ff...
Commit: 40a9c443a925ff2fbc7c12972c3cfa726b880580
Parent: c1faa4048a7421c14456cb1761548f7907bfbf53
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 11 18:04:05 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 18:55:54 2014 +0100
man: use some existing indentifier
Avoid confusing user, since some may get impression there is
such variable (max_archives) in the config file.
Pick rather something existing.
---
man/lvm.conf.5.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/man/lvm.conf.5.in b/man/lvm.conf.5.in
index 2786df2..73fcf47 100644
--- a/man/lvm.conf.5.in
+++ b/man/lvm.conf.5.in
@@ -102,7 +102,7 @@ e.g. backup {
.br
An assignment associates a type with an identifier.
.br
-e.g. max_archives = 42
+e.g. level = 7
.br
.TP
.BR array " = '" [ "' ( " type " '" , "')* " type " '" ] "' | '" [ "' '" ] '
10 years, 3 months
master - lvm2app: access params after its checked
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c1faa4048a7421...
Commit: c1faa4048a7421c14456cb1761548f7907bfbf53
Parent: 38e457c4788d0d2e51bf46edbd82b4683d33ac8f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 9 21:36:02 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 18:50:37 2014 +0100
lvm2app: access params after its checked
Since params is checked for NULL, move code that dereferences
params after its check.
---
liblvm/lvm_lv.c | 19 ++++++++-----------
1 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/liblvm/lvm_lv.c b/liblvm/lvm_lv.c
index 9f3a9c6..d89e8ae 100644
--- a/liblvm/lvm_lv.c
+++ b/liblvm/lvm_lv.c
@@ -757,17 +757,15 @@ struct lvm_property_value lvm_lv_params_get_property(
const lv_create_params_t params,
const char *name)
{
- struct lvm_property_value rc = {
- .is_valid = 0
- };
- struct saved_env e = store_user_env(params->vg->cmd);
+ struct lvm_property_value rc = { .is_valid = 0 };
if (params && params->magic == LV_CREATE_PARAMS_MAGIC) {
+ struct saved_env e = store_user_env(params->vg->cmd);
rc = get_property(NULL, NULL, NULL, NULL, NULL, ¶ms->lvp, NULL, name);
- } else {
+ restore_user_env(&e);
+ } else
log_error("Invalid lv_create_params parameter");
- }
- restore_user_env(&e);
+
return rc;
}
@@ -775,15 +773,14 @@ int lvm_lv_params_set_property(lv_create_params_t params, const char *name,
struct lvm_property_value *prop)
{
int rc = -1;
- struct saved_env e = store_user_env(params->vg->cmd);
if (params && params->magic == LV_CREATE_PARAMS_MAGIC) {
+ struct saved_env e = store_user_env(params->vg->cmd);
rc = set_property(NULL, NULL, NULL, ¶ms->lvp, NULL, name, prop);
- } else {
+ restore_user_env(&e);
+ } else
log_error("Invalid lv_create_params parameter");
- }
- restore_user_env(&e);
return rc;
}
10 years, 3 months
master - raid: drop invalid modication of active parameter
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=38e457c4788d0d...
Commit: 38e457c4788d0d2e51bf46edbd82b4683d33ac8f
Parent: 8a21dcebac02884615b80fbe9d276991a50dc66b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Feb 11 13:34:22 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 18:48:38 2014 +0100
raid: drop invalid modication of active parameter
lv_active_change will enforce proper activation.
Modification of activation was wrong and lead to misuse of
autoactivation. Fix allows to use proper local exclusive activation,
while the removed code turned this into just exclusive
activation (losing required local property).
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 8 --------
2 files changed, 1 insertions(+), 8 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index a64f961..c8f622a 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Use local exclusive activation for creation of raid in cluster.
Use correctly signed 64b constant when selecting raid volumes.
Add systemd native service for clvmd, cmirrord and clustered LV activation.
Remove ExecReload from lvmetad systemd unit: lvmetad -R undefined. (2.02.98)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index d0b6c9e..1b9a7ae 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6153,14 +6153,6 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
} else if (seg_is_raid(lp)) {
first_seg(lv)->min_recovery_rate = lp->min_recovery_rate;
first_seg(lv)->max_recovery_rate = lp->max_recovery_rate;
- if (vg_is_clustered(lv->vg) &&
- is_change_activating(lp->activate) &&
- (lp->activate != CHANGE_AE)) {
- log_debug_activation("Creating RAID logical volume in a"
- " cluster: setting activation"
- " mode to EX");
- lp->activate = CHANGE_AE;
- }
}
if (lp->cache) {
10 years, 3 months
master - raid: use unsigned 64b constant for shift
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8a21dcebac0288...
Commit: 8a21dcebac02884615b80fbe9d276991a50dc66b
Parent: 1a5062c9a7136f93a00b998ff0de1a32bb347b5f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Sun Feb 9 21:34:55 2014 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Feb 11 18:47:15 2014 +0100
raid: use unsigned 64b constant for shift
---
WHATS_NEW | 1 +
lib/raid/raid.c | 4 ++--
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 918123f..a64f961 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.106 -
====================================
+ Use correctly signed 64b constant when selecting raid volumes.
Add systemd native service for clvmd, cmirrord and clustered LV activation.
Remove ExecReload from lvmetad systemd unit: lvmetad -R undefined. (2.02.98)
Do not fork lvmetad if running under systemd.
diff --git a/lib/raid/raid.c b/lib/raid/raid.c
index 956472e..9f7bbd1 100644
--- a/lib/raid/raid.c
+++ b/lib/raid/raid.c
@@ -221,11 +221,11 @@ static int _raid_add_target_line(struct dev_manager *dm __attribute__((unused)),
for (s = 0; s < seg->area_count; s++)
if (seg_lv(seg, s)->status & LV_REBUILD)
- rebuilds |= 1 << s;
+ rebuilds |= 1ULL << s;
for (s = 0; s < seg->area_count; s++)
if (seg_lv(seg, s)->status & LV_WRITEMOSTLY)
- writemostly |= 1 << s;
+ writemostly |= 1ULL << s;
if (mirror_in_sync())
flags = DM_NOSYNC;
10 years, 3 months