master - metadata: log_debug only when BA found in metadata
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=0ca16881343737...
Commit: 0ca168813437375d8dc96326b0d74f97f3866b5e
Parent: 6de45db5b53636afff1e7e0a5d5efd012c1b7f20
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 27 16:03:35 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 27 16:03:35 2013 +0200
metadata: log_debug only when BA found in metadata
...not the other way round as it was before. This way it makes
more sense as BA use is exceptional and it's useless to
contaminate the log with messages about BA not being found
in metadata.
---
lib/format_text/import_vsn1.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index 852f2c5..99dd52a 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -246,19 +246,20 @@ static int _read_pv(struct format_instance *fid,
return 0;
}
- /* Bootloader area is not compulsory - just log_debug if not found. */
+ /* Bootloader area is not compulsory - just log_debug for the record if found. */
ba_start = size = 0;
- if (!_read_uint64(pvn, "ba_start", &ba_start))
- log_debug("PV Bootloader Area start value (ba_start) not found.");
- if (!_read_uint64(pvn, "ba_size", &size))
- log_debug("PV Bootloader Area size (ba_size) not found.");
- if ((!ba_start && size) || (ba_start && !size)) {
- log_error("Incomplete bootloader area specification for "
- "physical volume.");
- return 0;
- } else {
+ _read_uint64(pvn, "ba_start", &ba_start);
+ _read_uint64(pvn, "ba_size", &size);
+ if (ba_start && size) {
+ log_debug("Found bootloader area specification for PV %s "
+ "in metadata: ba_start=%" PRIu64 ", ba_size=%" PRIu64 ".",
+ pv_dev_name(pv), ba_start, size);
pv->ba_start = ba_start;
pv->ba_size = size;
+ } else if ((!ba_start && size) || (ba_start && !size)) {
+ log_error("Found incomplete bootloader area specification "
+ "for PV %s in metadata.", pv_dev_name(pv));
+ return 0;
}
dm_list_init(&pv->tags);
9 years, 11 months
master - cleanup: clear outdated comment (TODO already done)
by Peter Rajnoha
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=6de45db5b53636...
Commit: 6de45db5b53636afff1e7e0a5d5efd012c1b7f20
Parent: 9233e6d0bb5b3b21cc67fd0baae3fb4cb099bdcb
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Jun 27 15:26:39 2013 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Jun 27 15:26:39 2013 +0200
cleanup: clear outdated comment (TODO already done)
---
lib/format_text/format-text.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 3157252..fae3ad7 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -1544,9 +1544,6 @@ static int _text_pv_initialise(const struct format_type *fmt,
* value (e.g. backups). Also, if creating an EA, try to place
* it in between the final alignment and existing PE start
* if possible.
- * TODO: Support restoring existing EA from MDA instead like
- * we do for PE start? This would require adding EA info
- * in MDA then!
*/
pv->pe_start = rp->pe_start;
if (rp->ba_size) {
9 years, 11 months
master - dmeventd: fix cleanup commit
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=9233e6d0bb5b3b...
Commit: 9233e6d0bb5b3b21cc67fd0baae3fb4cb099bdcb
Parent: 939aeb7058e327686ff0e4f9e22b18893e0a7a3f
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 25 23:05:06 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 23:05:06 2013 +0200
dmeventd: fix cleanup commit
Fixing wrong rebase of cleanup commit.
Put back call to outth.
---
daemons/dmeventd/dmeventd.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c
index e9924f6..b912ead 100644
--- a/daemons/dmeventd/dmeventd.c
+++ b/daemons/dmeventd/dmeventd.c
@@ -988,7 +988,7 @@ static int _register_for_event(struct message_data *message_data)
almost as good as dead already... */
if ((thread_new->events & DM_EVENT_TIMEOUT) &&
(ret = -_register_for_timeout(thread_new)))
- goto out;
+ goto outth;
if (!(thread = _lookup_thread_status(message_data))) {
_unlock_mutex();
9 years, 11 months
master - debug: add pointer to -DDEBUG_POOL compilation
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=939aeb7058e327...
Commit: 939aeb7058e327686ff0e4f9e22b18893e0a7a3f
Parent: a4d6f7939c83f2b60be7e892af7588693e651789
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Feb 18 16:38:32 2010 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 13:47:39 2013 +0200
debug: add pointer to -DDEBUG_POOL compilation
Show 'at' pointer address with pool name.
It's useful for debugging to be able to locate pointer address in the
debug trace log. It's only available when compiled with extra debug
compilation flag DEBUG_POOL in make.tmpl.
---
libdm/mm/pool-debug.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libdm/mm/pool-debug.c b/libdm/mm/pool-debug.c
index 3bd6cab..afaa39e 100644
--- a/libdm/mm/pool-debug.c
+++ b/libdm/mm/pool-debug.c
@@ -62,7 +62,7 @@ struct dm_pool *dm_pool_create(const char *name, size_t chunk_hint)
mem->orig_pool = mem;
#ifdef DEBUG_POOL
- log_debug_mem("Created mempool %s", name);
+ log_debug_mem("Created mempool %s at %p", name, mem);
#endif
dm_list_add(&_dm_pools, &mem->list);
@@ -91,8 +91,8 @@ static void _free_blocks(struct dm_pool *p, struct block *b)
static void _pool_stats(struct dm_pool *p, const char *action)
{
#ifdef DEBUG_POOL
- log_debug_mem("%s mempool %s: %u/%u bytes, %u/%u blocks, "
- "%u allocations)", action, p->name, p->stats.bytes,
+ log_debug_mem("%s mempool %s at %p: %u/%u bytes, %u/%u blocks, "
+ "%u allocations)", action, p->name, p, p->stats.bytes,
p->stats.maxbytes, p->stats.blocks_allocated,
p->stats.blocks_max, p->stats.block_serialno);
#else
9 years, 11 months
master - thin: check for creation of pool
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a4d6f7939c83f2...
Commit: a4d6f7939c83f2b60be7e892af7588693e651789
Parent: d46588c2d7b051a69564bd862a5b2579c2cdb8f3
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 24 20:54:05 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 13:47:39 2013 +0200
thin: check for creation of pool
---
tools/lvcreate.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 43bb3d6..80ca1bc 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -393,12 +393,11 @@ static int _read_size_params(struct lvcreate_params *lp,
if (seg_is_thin(lp) && (arg_count(cmd, size_ARG) || arg_count(cmd, extents_ARG)))
lp->create_thin_pool = 1;
- if (arg_count(cmd, poolmetadatasize_ARG) && !seg_is_thin(lp)) {
+ if (!lp->create_thin_pool && arg_count(cmd, poolmetadatasize_ARG)) {
log_error("--poolmetadatasize may only be specified when allocating the thin pool.");
return 0;
}
- /* Size returned in kilobyte units; held in sectors */
if (arg_count(cmd, virtualsize_ARG)) {
if (seg_is_thin_pool(lp)) {
log_error("Virtual size in incompatible with thin_pool segment type.");
@@ -408,6 +407,7 @@ static int _read_size_params(struct lvcreate_params *lp,
log_error("Negative virtual origin size is invalid");
return 0;
}
+ /* Size returned in kilobyte units; held in sectors */
lp->voriginsize = arg_uint64_value(cmd, virtualsize_ARG,
UINT64_C(0));
if (!lp->voriginsize) {
9 years, 11 months
master - cleanup: add dot to lvchange message
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d46588c2d7b051...
Commit: d46588c2d7b051a69564bd862a5b2579c2cdb8f3
Parent: da9263905c946914f0c18fc25fb0d4d34875fd1e
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Jun 25 13:43:35 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 13:47:39 2013 +0200
cleanup: add dot to lvchange message
---
tools/lvchange.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tools/lvchange.c b/tools/lvchange.c
index d645da6..c88d8ef 100644
--- a/tools/lvchange.c
+++ b/tools/lvchange.c
@@ -1054,7 +1054,7 @@ static int lvchange_single(struct cmd_context *cmd, struct logical_volume *lv,
}
if (doit)
- log_print_unless_silent("Logical volume \"%s\" changed", lv->name);
+ log_print_unless_silent("Logical volume \"%s\" changed.", lv->name);
if (arg_count(cmd, resync_ARG))
if (!lvchange_resync(cmd, lv)) {
9 years, 11 months
master - cleanup: use "" around type in error message
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=da9263905c9469...
Commit: da9263905c946914f0c18fc25fb0d4d34875fd1e
Parent: 19b064a30939df25ef1f31337ac6b566023b7793
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 24 12:00:48 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 13:47:39 2013 +0200
cleanup: use "" around type in error message
A bit more cleaner error message for wrong discards paramater.
---
lib/metadata/thin_manip.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/thin_manip.c b/lib/metadata/thin_manip.c
index bd30458..7ddadcf 100644
--- a/lib/metadata/thin_manip.c
+++ b/lib/metadata/thin_manip.c
@@ -658,7 +658,7 @@ int get_pool_discards(const char *str, thin_discards_t *discards)
else if (!strcasecmp(str, "ignore"))
*discards = THIN_DISCARDS_IGNORE;
else {
- log_error("Thin pool discards type %s is unknown.", str);
+ log_error("Thin pool discards type \"%s\" is unknown.", str);
return 0;
}
9 years, 11 months
master - cleanup: move mirror check code closer
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=19b064a30939df...
Commit: 19b064a30939df25ef1f31337ac6b566023b7793
Parent: 09dc590b67518b3e90944aea981be196dd9387a0
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 24 11:55:18 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 13:47:39 2013 +0200
cleanup: move mirror check code closer
Group a bit more code related to mirrors.
---
tools/lvcreate.c | 23 ++++++++++++-----------
1 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index e9e00be..43bb3d6 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -771,7 +771,19 @@ static int _lvcreate_params(struct lvcreate_params *lp,
lp->mirrors = 2;
if (arg_count(cmd, mirrors_ARG)) {
+ if (arg_sign_value(cmd, mirrors_ARG, SIGN_NONE) == SIGN_MINUS) {
+ log_error("Mirrors argument may not be negative");
+ return 0;
+ }
+
lp->mirrors = arg_uint_value(cmd, mirrors_ARG, 0) + 1;
+
+ if (lp->mirrors > DEFAULT_MIRROR_MAX_IMAGES) {
+ log_error("Only up to " DM_TO_STRING(DEFAULT_MIRROR_MAX_IMAGES)
+ " images in mirror supported currently.");
+ return 0;
+ }
+
if (lp->mirrors == 1) {
if (segtype_is_mirrored(lp->segtype)) {
log_error("--mirrors must be at least 1 with segment type %s.", lp->segtype->name);
@@ -790,11 +802,6 @@ static int _lvcreate_params(struct lvcreate_params *lp,
"only 2-way mirroring (i.e. '-m 1')");
return 0;
}
-
- if (arg_sign_value(cmd, mirrors_ARG, SIGN_NONE) == SIGN_MINUS) {
- log_error("Mirrors argument may not be negative");
- return 0;
- }
}
if (lp->snapshot && arg_count(cmd, zero_ARG)) {
@@ -880,12 +887,6 @@ static int _lvcreate_params(struct lvcreate_params *lp,
return 0;
}
- if (lp->mirrors > DEFAULT_MIRROR_MAX_IMAGES) {
- log_error("Only up to " DM_TO_STRING(DEFAULT_MIRROR_MAX_IMAGES)
- " images in mirror supported currently.");
- return 0;
- }
-
/*
* Allocation parameters
*/
9 years, 11 months
master - cleanup: code swap
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=09dc590b67518b...
Commit: 09dc590b67518b3e90944aea981be196dd9387a0
Parent: 2a059f2358d0a339d4d8095fbde08b06409eb131
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 24 11:48:08 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 13:47:39 2013 +0200
cleanup: code swap
Use easier to read positive query and indent line.
---
tools/lvcreate.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/tools/lvcreate.c b/tools/lvcreate.c
index 972b36a..e9e00be 100644
--- a/tools/lvcreate.c
+++ b/tools/lvcreate.c
@@ -259,7 +259,7 @@ static int _update_extents_params(struct volume_group *vg,
*/
if (lcp->pv_count) {
if (!(lp->pvh = create_pv_list(vg->cmd->mem, vg,
- lcp->pv_count, lcp->pvs, 1)))
+ lcp->pv_count, lcp->pvs, 1)))
return_0;
} else
lp->pvh = &vg->pvs;
@@ -272,12 +272,11 @@ static int _update_extents_params(struct volume_group *vg,
lp->extents = percent_of_extents(lp->extents, vg->free_count, 0);
break;
case PERCENT_PVS:
- if (!lcp->pv_count)
- lp->extents = percent_of_extents(lp->extents, vg->extent_count, 0);
- else {
+ if (lcp->pv_count) {
pv_extent_count = pv_list_extents_free(lp->pvh);
lp->extents = percent_of_extents(lp->extents, pv_extent_count, 0);
- }
+ } else
+ lp->extents = percent_of_extents(lp->extents, vg->extent_count, 0);
break;
case PERCENT_LV:
log_error("Please express size as %%VG, %%PVS, or "
9 years, 11 months
master - cleanup: use log_print instead of log_error
by Zdenek Kabelac
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=2a059f2358d0a3...
Commit: 2a059f2358d0a339d4d8095fbde08b06409eb131
Parent: 01174b8b8b140280976182c143e764d525c54939
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 20 14:08:25 2013 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Jun 25 13:47:39 2013 +0200
cleanup: use log_print instead of log_error
Since reduce the message has informational character and doesn't lead
to exit of the command - reduce the log level to info print as we
use for other similar types.
Reindent next print message.
---
lib/metadata/lv_manip.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index b7c538b..8acca49 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4424,10 +4424,10 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
}
if (lp->stripe_size > vg->extent_size) {
- log_error("Reducing requested stripe size %s to maximum, "
- "physical extent size %s",
- display_size(cmd, (uint64_t) lp->stripe_size),
- display_size(cmd, (uint64_t) vg->extent_size));
+ log_print_unless_silent("Reducing requested stripe size %s to maximum, "
+ "physical extent size %s.",
+ display_size(cmd, (uint64_t) lp->stripe_size),
+ display_size(cmd, (uint64_t) vg->extent_size));
lp->stripe_size = vg->extent_size;
}
@@ -4442,8 +4442,8 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
if ((size_rest = lp->extents % lp->stripes)) {
log_print_unless_silent("Rounding size (%d extents) up to stripe boundary "
- "size (%d extents)", lp->extents,
- lp->extents - size_rest + lp->stripes);
+ "size (%d extents).", lp->extents,
+ lp->extents - size_rest + lp->stripes);
lp->extents = lp->extents - size_rest + lp->stripes;
}
9 years, 11 months