]> sourceware.org Git - lvm2.git/commitdiff
Fix for bug 737200 - Can't create mirrored-log mirror on a VG with small extents
authorJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 13 Sep 2011 18:42:57 +0000 (18:42 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 13 Sep 2011 18:42:57 +0000 (18:42 +0000)
Kernel requires a mirror to be at least 1 region large.  So,
if our mirror log is itself a mirror, it must be at least
1 region large.  This restriction may not be necessary for
non-mirrored logs, but we apply the rule anyway.

(The other option is to make the region size of the log
mirror smaller than the mirror it is acting as a log for,
but that really complicates things.  It's much easier to
keep the region_size the same for both.)

WHATS_NEW
lib/metadata/lv_manip.c

index b7a4994707d898109d05238bbc8f6e4ab223209e..dc3de424cd9933e4d50a0523ced6d29b8aa6934a 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Fix mirrored log creation when PE size is small - force log_size >= region_size
   Fix improper RAID 64-bit status flag reset when and'ing against 32-bit flag.
   Fix log size calculation when only a log is being added to a mirror.
   Work around resume_lv causing error LV scanning during splitmirror operation.
index 6870c685a1d6f3654b3586586e1505bebbcdf611..64aebcfa629685c2c665e0ac0a1e11a66bb31245 100644 (file)
@@ -687,8 +687,21 @@ static uint32_t mirror_log_extents(uint32_t region_size, uint32_t pe_size, uint3
        /* Log device holds both header and bitset. */
        log_size = dm_round_up((MIRROR_LOG_OFFSET << SECTOR_SHIFT) + bitset_size, 1 << SECTOR_SHIFT);
        log_size >>= SECTOR_SHIFT;
+       log_size = dm_div_up(log_size, pe_size);
 
-       return dm_div_up(log_size, pe_size);
+       /*
+        * Kernel requires a mirror to be at least 1 region large.  So,
+        * if our mirror log is itself a mirror, it must be at least
+        * 1 region large.  This restriction may not be necessary for
+        * non-mirrored logs, but we apply the rule anyway.
+        *
+        * (The other option is to make the region size of the log
+        * mirror smaller than the mirror it is acting as a log for,
+        * but that really complicates things.  It's much easier to
+        * keep the region_size the same for both.)
+        */
+       return (log_size > (region_size / pe_size)) ? log_size :
+               (region_size / pe_size);
 }
 
 /*
This page took 0.052261 seconds and 5 git commands to generate.