[master 2/3] Calculate the MD RAID superblock size from the right size

vpodzime installerbot-noreply at redhat.com
Tue Sep 1 09:29:19 UTC 2015


From: Vratislav Podzimek <vpodzime at redhat.com>

libblockdev inherited from blivet a very precise algorithm to calculate MD RAID
superblock (meta data) size which was taken from the mdadm's sources. However,
in mdadm, this algorithm is applied to a size of a single member device not the
size of the whole RAID. Which makes sense, because the superblock area is on
every member and it contains meta data about that particular member. Thus we
need to pass the size of the smallest member device to the algorithm calculating
the superblock size, not the total size of the whole RAID.
---
 blivet/devicelibs/raid.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/blivet/devicelibs/raid.py b/blivet/devicelibs/raid.py
index 0f0f1b4..17ea0e8 100644
--- a/blivet/devicelibs/raid.py
+++ b/blivet/devicelibs/raid.py
@@ -281,8 +281,7 @@ def get_size(self, member_sizes, num_members=None, chunk_size=None, superblock_s
             raise RaidError("superblock_size_func value of None is not acceptable")
 
         min_size = min(member_sizes)
-        total_space = self.get_net_array_size(num_members, min_size)
-        superblock_size = superblock_size_func(total_space)
+        superblock_size = superblock_size_func(min_size)
         min_data_size = self._trim(min_size - superblock_size, chunk_size)
         return self.get_net_array_size(num_members, min_data_size)
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/716d9627e08912a993f759601f3c70b89cd082bf


More information about the anaconda-patches mailing list