From: jbrassow@sourceware.org <jbrassow@sourceware.org>
To: lvm-devel@redhat.com
Subject: LVM2/lib/metadata mirror.c
Date: 9 Jul 2010 17:57:52 -0000 [thread overview]
Message-ID: <20100709175752.32205.qmail@sourceware.org> (raw)
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: jbrassow at sourceware.org 2010-07-09 17:57:52
Modified files:
lib/metadata : mirror.c
Log message:
Failed to test for the case where a log was requested to be removed
even though there was no log. A simple run through the in-tree test
suite would have caught this. :(
- if (lv_is_mirrored(detached_log_lv) &&
+ if (detached_log_lv && lv_is_mirrored(detached_log_lv) &&
Also, made some cosmetic changes suggested by kabi after my last check-in
(e.g. s/return 0/return_0/ and adding an error message).
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/metadata/mirror.c.diff?cvsroot=lvm2&r1=1.124&r2=1.125
--- LVM2/lib/metadata/mirror.c 2010/07/09 15:34:45 1.124
+++ LVM2/lib/metadata/mirror.c 2010/07/09 17:57:51 1.125
@@ -879,7 +879,7 @@
* have failed, we must replace with error target - it is
* the only way to release the pending writes.
*/
- if (lv_is_mirrored(detached_log_lv) &&
+ if (detached_log_lv && lv_is_mirrored(detached_log_lv) &&
(detached_log_lv->status & PARTIAL_LV)) {
struct lv_segment *seg = first_seg(detached_log_lv);
@@ -896,8 +896,10 @@
seg_lv(seg, m)->status &= ~MIRROR_IMAGE;
lv_set_visible(seg_lv(seg, m));
if (!(lvl = dm_pool_alloc(lv->vg->cmd->mem,
- sizeof(*lvl))))
+ sizeof(*lvl)))) {
+ log_error("dm_pool_alloc failed");
return 0;
+ }
lvl->lv = seg_lv(seg, m);
dm_list_add(&tmp_orphan_lvs, &lvl->list);
}
@@ -905,7 +907,7 @@
if (!replace_lv_with_error_segment(detached_log_lv)) {
log_error("Failed error target substitution for %s",
detached_log_lv->name);
- return_0;
+ return 0;
}
if (!vg_write(detached_log_lv->vg)) {
@@ -926,7 +928,7 @@
if (!resume_lv(detached_log_lv->vg->cmd,
detached_log_lv))
- return 0;
+ return_0;
}
}
next reply other threads:[~2010-07-09 17:57 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-09 17:57 jbrassow [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-02-01 15:05 LVM2/lib/metadata mirror.c agk
2011-09-19 14:28 jbrassow
2011-09-16 16:41 jbrassow
2011-09-14 9:54 zkabelac
2011-09-14 4:10 jbrassow
2011-09-13 18:11 jbrassow
2011-06-24 23:39 agk
2011-04-12 14:13 zkabelac
2011-03-24 12:28 mornfall
2011-01-11 17:21 jbrassow
2010-06-23 13:57 jbrassow
2010-04-20 12:14 agk
2010-04-01 14:54 agk
2010-01-08 10:50 zkabelac
2009-12-17 15:59 mornfall
2009-12-09 19:43 mbroz
2009-11-19 13:42 mornfall
2009-11-19 12:09 mornfall
2009-11-18 18:23 mornfall
2009-10-14 14:55 jbrassow
2009-04-23 16:43 mornfall
2009-04-24 0:38 ` Alasdair G Kergon
2009-05-03 16:37 ` Petr Rockai
2008-09-19 4:30 agk
2008-09-19 0:20 agk
2008-01-17 13:37 agk
2008-01-16 19:50 agk
2008-01-16 19:38 agk
2008-01-16 19:11 agk
2008-01-16 19:09 agk
2006-11-10 20:15 agk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100709175752.32205.qmail@sourceware.org \
--to=jbrassow@sourceware.org \
--cc=lvm-devel@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.