From: Petr Rockai <prockai@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Fix removal of multiple devices from a mirror.
Date: Thu, 17 Dec 2009 14:51:29 +0100 [thread overview]
Message-ID: <871vitg13y.fsf@twilight.int.mornfall.net.> (raw)
Hi,
the code for removing mirror images, as it is, shifts the first failed
leg twice and fails to shift the second failed one at all, which
reorders the mirror image array in such a way that a wrong leg is
removed as a result.
The trivial patch below fixes that behaviour by adjusting the array
pointer to accommodate for the shift. Fixes RHBZ 543225.
Yours,
Petr.
Index: lib/metadata/mirror.c
===================================================================
RCS file: /cvs/lvm2/LVM2/lib/metadata/mirror.c,v
retrieving revision 1.99
diff -u -p -r1.99 mirror.c
--- lib/metadata/mirror.c 9 Dec 2009 19:53:39 -0000 1.99
+++ lib/metadata/mirror.c 17 Dec 2009 13:43:30 -0000
@@ -533,6 +533,7 @@ static int _remove_mirror_images(struct
_is_mirror_image_removable(sub_lv, removable_pvs)) {
if (!shift_mirror_images(mirrored_seg, s))
return_0;
+ s--; /* adjust counter after shifting */
new_area_count--;
}
}
next reply other threads:[~2009-12-17 13:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-17 13:51 Petr Rockai [this message]
2009-12-17 14:12 ` [PATCH] Fix removal of multiple devices from a mirror Milan Broz
2009-12-17 14:50 ` Jonathan Brassow
2009-12-17 15:19 ` Jonathan Brassow
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=871vitg13y.fsf@twilight.int.mornfall.net. \
--to=prockai@redhat.com \
--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.