]> sourceware.org Git - lvm2.git/commitdiff
Fix wrong number of mirror log at allocate policy
authorTakahiro Yasui <tyasui@redhat.com>
Fri, 30 Jul 2010 17:50:15 +0000 (17:50 +0000)
committerTakahiro Yasui <tyasui@redhat.com>
Fri, 30 Jul 2010 17:50:15 +0000 (17:50 +0000)
With mirror_log_fault_policy of 'remove' and mirror_image_fault_policy
of 'allocate', the log type of the mirror volume is converted from
'disk' or 'mirrored' to 'core' when all mirror legs but one in a mirror
volume broke.

Keep new_log_count as a number of valid log devices by using log_count
variable for a temporary usage in the first phase of error recovery
in _lvconvert_mirrors_repair().

Signed-off-by: Takahiro Yasui <takahiro.yasui@hds.com>
Reviewed-by: Petr Rockai <prockai@redhat.com>
WHATS_NEW
tools/lvconvert.c

index eac3d3933266756f4e2777d8ffbc83484be17dfc..87303a5484ce8210ccf3f4839d3f3cec35e69ce5 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.73 - 
 ================================
+  Fix wrong number of mirror log at allocate policy
 
 Version 2.02.72 - 28th July 2010  [CVE-2010-2526]
 =================================================
index 03ecb01df87391fe5d6d452f255c09eac7575fb0..5dda2993ed7aa5f0e2550717a30c51cf34795c81 100644 (file)
@@ -1237,25 +1237,27 @@ static int _lvconvert_mirrors_repair(struct cmd_context *cmd,
        if (!(lp->failed_pvs = _failed_pv_list(lv->vg)))
                return_0;
 
+       log_count = new_log_count;
+
        /*
         * We must adjust the log first, or the entire mirror
         * will get stuck during a suspend.
         */
-       if (!_lv_update_mirrored_log(lv, lp->failed_pvs, new_log_count))
+       if (!_lv_update_mirrored_log(lv, lp->failed_pvs, log_count))
                return 0;
 
        if (lp->mirrors == 1)
-               new_log_count = 0;
+               log_count = 0;
 
        if (failed_mirrors) {
                if (!lv_remove_mirrors(cmd, lv, failed_mirrors,
-                                      new_log_count ? 0U : 1U,
+                                      log_count ? 0U : 1U,
                                       _is_partial_lv, NULL, 0))
                        return 0;
        }
 
        if (!_lv_update_log_type(cmd, lp, lv, lp->failed_pvs,
-                                new_log_count))
+                                log_count))
                return 0;
 
        if (!_reload_lv(cmd, lv))
This page took 0.048027 seconds and 5 git commands to generate.