public inbox for lvm2-cvs@sourceware.org
help / color / mirror / Atom feed
* LVM2/lib/metadata merge.c
@ 2011-09-29 9:03 zkabelac
0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2011-09-29 9:03 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2011-09-29 09:03:36
Modified files:
lib/metadata : merge.c
Log message:
Fix bad error message for thinp validation
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.50&r2=1.51
--- LVM2/lib/metadata/merge.c 2011/09/29 08:56:39 1.50
+++ LVM2/lib/metadata/merge.c 2011/09/29 09:03:36 1.51
@@ -239,7 +239,7 @@
}
if (seg->device_id >= (1 << 24)) {
- log_error("LV %s: thin volume segment %u pool LV to large device id %d",
+ log_error("LV %s: thin volume segment %u has too large device id %d",
lv->name, seg_count, seg->device_id);
inc_error_count;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* LVM2/lib/metadata merge.c
@ 2012-03-12 14:41 zkabelac
0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2012-03-12 14:41 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2012-03-12 14:41:42
Modified files:
lib/metadata : merge.c
Log message:
Using %u modifier to print unsigned values.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.57&r2=1.58
--- LVM2/lib/metadata/merge.c 2012/01/24 00:55:03 1.57
+++ LVM2/lib/metadata/merge.c 2012/03/12 14:41:42 1.58
@@ -204,7 +204,7 @@
if (seg->chunk_size < DM_THIN_MIN_DATA_BLOCK_SIZE ||
seg->chunk_size > DM_THIN_MAX_DATA_BLOCK_SIZE) {
- log_error("LV %s: thin pool segment %u chunk size %d is out of range",
+ log_error("LV %s: thin pool segment %u has chunk size %u out of range.",
lv->name, seg_count, seg->chunk_size);
inc_error_count;
}
@@ -240,7 +240,7 @@
}
if (seg->device_id > DM_THIN_MAX_DEVICE_ID) {
- log_error("LV %s: thin volume segment %u has too large device id %d",
+ log_error("LV %s: thin volume segment %u has too large device id %u",
lv->name, seg_count, seg->device_id);
inc_error_count;
}
@@ -316,7 +316,7 @@
seg_found++;
if (!seg_found) {
- log_error("LV %s segment %d uses LV %s,"
+ log_error("LV %s segment %u uses LV %s,"
" but missing ptr from %s to %s",
lv->name, seg_count,
seg_lv(seg, s)->name,
@@ -324,7 +324,7 @@
inc_error_count;
} else if (seg_found > 1) {
log_error("LV %s has duplicated links "
- "to LV %s segment %d",
+ "to LV %s segment %u",
seg_lv(seg, s)->name,
lv->name, seg_count);
inc_error_count;
@@ -383,9 +383,9 @@
seg->lv->name, lv->name);
inc_error_count;
} else if (seg_found != sl->count) {
- log_error("Reference count mismatch: LV %s has %d "
+ log_error("Reference count mismatch: LV %s has %u "
"links to LV %s:%" PRIu32 "-%" PRIu32
- ", which has %d links",
+ ", which has %u links",
lv->name, sl->count, seg->lv->name, seg->le,
seg->le + seg->len - 1, seg_found);
inc_error_count;
^ permalink raw reply [flat|nested] 4+ messages in thread
* LVM2/lib/metadata merge.c
@ 2011-09-16 11:53 zkabelac
0 siblings, 0 replies; 4+ messages in thread
From: zkabelac @ 2011-09-16 11:53 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac@sourceware.org 2011-09-16 11:53:14
Modified files:
lib/metadata : merge.c
Log message:
Trim spaces on EOL
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.48&r2=1.49
--- LVM2/lib/metadata/merge.c 2011/09/08 16:41:18 1.48
+++ LVM2/lib/metadata/merge.c 2011/09/16 11:53:14 1.49
@@ -202,7 +202,7 @@
inc_error_count;
}
} else {
- if (seg->pool_metadata_lv) {
+ if (seg->pool_metadata_lv) {
log_error("LV %s: segment %u must not have thin pool metadata LV set",
lv->name, seg_count);
inc_error_count;
@@ -222,7 +222,7 @@
inc_error_count;
}
- if (!seg->pool_lv) {
+ if (!seg->pool_lv) {
log_error("LV %s: segment %u is missing thin pool LV",
lv->name, seg_count);
inc_error_count;
@@ -232,7 +232,7 @@
inc_error_count;
}
} else {
- if (seg->pool_lv) {
+ if (seg->pool_lv) {
log_error("LV %s: segment %u must not have thin pool LV set",
lv->name, seg_count);
inc_error_count;
^ permalink raw reply [flat|nested] 4+ messages in thread
* LVM2/lib/metadata merge.c
@ 2010-04-01 12:14 agk
0 siblings, 0 replies; 4+ messages in thread
From: agk @ 2010-04-01 12:14 UTC (permalink / raw)
To: lvm-devel, lvm2-cvs
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: agk@sourceware.org 2010-04-01 12:14:21
Modified files:
lib/metadata : merge.c
Log message:
Limit number of error messages when checking LV segments.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/merge.c.diff?cvsroot=lvm2&r1=1.38&r2=1.39
--- LVM2/lib/metadata/merge.c 2010/03/31 17:23:19 1.38
+++ LVM2/lib/metadata/merge.c 2010/04/01 12:14:20 1.39
@@ -55,6 +55,11 @@
return 1;
}
+#define ERROR_MAX 100
+#define inc_error_count \
+ if (error_count++ > ERROR_MAX) \
+ goto out
+
/*
* Verify that an LV's segments are consecutive, complete and don't overlap.
*/
@@ -63,9 +68,9 @@
struct lv_segment *seg, *seg2;
uint32_t le = 0;
unsigned seg_count = 0, seg_found;
- int r = 1;
uint32_t area_multiplier, s;
struct seg_list *sl;
+ int error_count = 0;
dm_list_iterate_items(seg, &lv->segments) {
seg_count++;
@@ -73,7 +78,7 @@
log_error("LV %s invalid: segment %u should begin at "
"LE %" PRIu32 " (found %" PRIu32 ").",
lv->name, seg_count, le, seg->le);
- r = 0;
+ inc_error_count;
}
area_multiplier = segtype_is_striped(seg->segtype) ?
@@ -83,7 +88,7 @@
log_error("LV %s: segment %u has inconsistent "
"area_len %u",
lv->name, seg_count, seg->area_len);
- r = 0;
+ inc_error_count;
}
if (complete_vg && seg->log_lv) {
@@ -91,14 +96,14 @@
log_error("LV %s: segment %u has log LV but "
"is not mirrored",
lv->name, seg_count);
- r = 0;
+ inc_error_count;
}
if (!(seg->log_lv->status & MIRROR_LOG)) {
log_error("LV %s: segment %u log LV %s is not "
"a mirror log",
lv->name, seg_count, seg->log_lv->name);
- r = 0;
+ inc_error_count;
}
if (!(seg2 = first_seg(seg->log_lv)) ||
@@ -106,7 +111,7 @@
log_error("LV %s: segment %u log LV does not "
"point back to mirror segment",
lv->name, seg_count);
- r = 0;
+ inc_error_count;
}
}
@@ -116,7 +121,7 @@
log_error("LV %s: segment %u mirror image "
"is not mirrored",
lv->name, seg_count);
- r = 0;
+ inc_error_count;
}
}
@@ -125,7 +130,7 @@
log_error("LV %s: segment %u has same LV %s for "
"both origin and snapshot",
lv->name, seg_count, seg->cow->name);
- r = 0;
+ inc_error_count;
}
}
@@ -134,7 +139,7 @@
log_error("LV %s: segment %u has unassigned "
"area %u.",
lv->name, seg_count, s);
- r = 0;
+ inc_error_count;
} else if (seg_type(seg, s) == AREA_PV) {
if (!seg_pvseg(seg, s) ||
seg_pvseg(seg, s)->lvseg != seg ||
@@ -142,7 +147,7 @@
log_error("LV %s: segment %u has "
"inconsistent PV area %u",
lv->name, seg_count, s);
- r = 0;
+ inc_error_count;
}
} else {
if (!seg_lv(seg, s) ||
@@ -151,7 +156,7 @@
log_error("LV %s: segment %u has "
"inconsistent LV area %u",
lv->name, seg_count, s);
- r = 0;
+ inc_error_count;
}
if (complete_vg && seg_lv(seg, s) &&
@@ -162,7 +167,7 @@
log_error("LV %s: segment %u mirror "
"image %u missing mirror ptr",
lv->name, seg_count, s);
- r = 0;
+ inc_error_count;
}
/* FIXME I don't think this ever holds?
@@ -171,7 +176,7 @@
"inconsistent LV area %u "
"size",
lv->name, seg_count, s);
- r = 0;
+ inc_error_count;
}
*/
seg_found = 0;
@@ -184,13 +189,13 @@
lv->name, seg_count,
seg_lv(seg, s)->name,
seg_lv(seg, s)->name, lv->name);
- r = 0;
+ inc_error_count;
} else if (seg_found > 1) {
log_error("LV %s has duplicated links "
"to LV %s segment %d",
seg_lv(seg, s)->name,
lv->name, seg_count);
- r = 0;
+ inc_error_count;
}
}
}
@@ -215,14 +220,14 @@
lv->name, seg->lv->name, seg->le,
seg->le + seg->len - 1,
seg->lv->name, lv->name);
- r = 0;
+ inc_error_count;
} else if (seg_found != sl->count) {
log_error("Reference count mismatch: LV %s has %d "
"links to LV %s:%" PRIu32 "-%" PRIu32
", which has %d links",
lv->name, sl->count, seg->lv->name, seg->le,
seg->le + seg->len - 1, seg_found);
- r = 0;
+ inc_error_count;
}
seg_found = 0;
@@ -236,17 +241,18 @@
" is incorrectly listed as being used by LV %s",
seg->lv->name, seg->le, seg->le + seg->len - 1,
lv->name);
- r = 0;
+ inc_error_count;
}
}
if (le != lv->le_count) {
log_error("LV %s: inconsistent LE count %u != %u",
lv->name, le, lv->le_count);
- r = 0;
+ inc_error_count;
}
- return r;
+out:
+ return !error_count;
}
/*
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-03-12 14:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-29 9:03 LVM2/lib/metadata merge.c zkabelac
-- strict thread matches above, loose matches on Subject: below --
2012-03-12 14:41 zkabelac
2011-09-16 11:53 zkabelac
2010-04-01 12:14 agk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).