[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH] Re: [lvm-devel] lvconvert error when converting a linear to a mirror



Hi,

"Jun'ichi Nomura" <j-nomura ce jp nec com> writes:
> And a comment for this comment in the code:
>
>>          * FIXME This check used to precede mirror->mirror conversion
>> 	 * but didn't affect mirror->linear or linear->mirror. I do
>> 	 * not understand what is its intention, in fact.
>
> if the check wasn't done for mirror-to-linear conversion, that's a bug.
> It seems the bug has been there since the initial version of lvconvert.c. :)

I am the author of that FIXME comment there. It seems, that Dave's proposal of
adding a lv->status & MIRRORED check is the right solution here. Thanks both
for noticing and explaining the issue, at the time I was implementing lvconvert
--repair, it was not clear to me.

diff -rN -u -p old-upstream/tools/lvconvert.c new-upstream/tools/lvconvert.c
--- old-upstream/tools/lvconvert.c	2009-05-19 08:31:01.712102319 +0200
+++ new-upstream/tools/lvconvert.c	2009-05-19 08:31:01.776102911 +0200
@@ -542,11 +542,10 @@ static int lvconvert_mirrors(struct cmd_
 	}
 
 	/*
-	 * FIXME This check used to precede mirror->mirror conversion
-	 * but didn't affect mirror->linear or linear->mirror. I do
-	 * not understand what is its intention, in fact.
+	 * For the most part, we cannot handle multi-segment mirrors. Bail out
+	 * early if we have encountered one.
 	 */
-	if (dm_list_size(&lv->segments) != 1) {
+	if ((lv->status & MIRRORED) && dm_list_size(&lv->segments) != 1) {
 		log_error("Logical volume %s has multiple "
 			  "mirror segments.", lv->name);
 		return 0;
Yours,
   Petr.

-- 
Peter Rockai | me()mornfall!net | prockai()redhat!com
 http://blog.mornfall.net | http://web.mornfall.net

"In My Egotistical Opinion, most people's C programs should be
 indented six feet downward and covered with dirt."
     -- Blair P. Houghton on the subject of C program indentation

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]