]> sourceware.org Git - lvm2.git/commitdiff
Adding a new mimage (leg/copy) to a mirror behaves differently
authorJonathan Earl Brassow <jbrassow@redhat.com>
Fri, 5 Feb 2010 21:49:16 +0000 (21:49 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Fri, 5 Feb 2010 21:49:16 +0000 (21:49 +0000)
depending on if the mirror has a 'core' or 'disk' log.  When there
is a disk log, the new leg is added by stacking a new mirror on
top of the old (one leg is the old mirror and the other leg is the newly
added device).  When the log is a 'core' log, the new leg is simply added
to the existing mirror and all the devices are re-synced.

The logic that handles collapsing the stacked 'disk' log mirror was
having the effect of causing 'core' logged mirrors to begin resync'ing
for a second time.  I have used the 'CONVERTING' flag to indicate that
a mirror is converting by way of stacking.  This is no longer set for
up-converting core logs.  The final 'collapse' logic can safely be skipped
for 'core' log mirrors - getting rid of the second resync.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
WHATS_NEW
tools/lvconvert.c

index 33266c52e1d06010432d7a5f0cec0fd371ba59cc..1c87a17b3f47c52a39b9f62bdc2dc122d38d6435 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.61 - 
 ===================================
+  Fix inappropriate second resync when adding mimage to core-logged mirror.
   Exclude internal VG names and uuids in lists returned via liblvm interface.
   Add %ORIGIN support to lv{create,extend,reduce,resize} --extents option.
   Add copy constructor for metadata_area.
index ce500b1a4a9f04f73de9835ae5ca469e5a7bfa6f..6e44829cdd745ebec545bcf820f4a4667d200639 100644 (file)
@@ -335,6 +335,9 @@ static int _finish_lvconvert_mirror(struct cmd_context *cmd,
 {
        int r = 0;
 
+       if (!(lv->status & CONVERTING))
+               return 1;
+
        if (!collapse_mirrored_lv(lv)) {
                log_error("Failed to remove temporary sync layer.");
                return 0;
@@ -967,7 +970,8 @@ static int _lvconvert_mirrors(struct cmd_context *cmd, struct logical_volume *lv
                        stack;
                        return failure_code;
                }
-               lv->status |= CONVERTING;
+               if (seg->log_lv)
+                       lv->status |= CONVERTING;
                lp->need_polling = 1;
        }
 
This page took 0.044708 seconds and 5 git commands to generate.