Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian Kernel (http://www.linux-archive.org/debian-kernel/)
-   -   Handle v0.90 md metadata in preexisting arrays. (http://www.linux-archive.org/debian-kernel/607180-handle-v0-90-md-metadata-preexisting-arrays.html)

David Lehman 12-06-2011 06:43 PM

Handle v0.90 md metadata in preexisting arrays.
 
mdadm --examine doesn't output metadata version for 0.90 superblocks
to preserve backwards compatibility so if no metadata version is
indicated we must assume 0.90.
---
pyanaconda/storage/devices.py | 2 +-
pyanaconda/storage/devicetree.py | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/storage/devices.py b/pyanaconda/storage/devices.py
index 15c3e49..b8f8223 100644
--- a/pyanaconda/storage/devices.py
+++ b/pyanaconda/storage/devices.py
@@ -2731,7 +2731,7 @@ class MDRaidArrayDevice(StorageDevice):
self.chunkSize = 512.0 / 1024.0 # chunk size in MB
self.superBlockSize = 2.0 # superblock size in MB

- if not isinstance(metadataVersion, str):
+ if not self.exists and not isinstance(metadataVersion, str):
self.metadataVersion = "default"
else:
self.metadataVersion = metadataVersion
diff --git a/pyanaconda/storage/devicetree.py b/pyanaconda/storage/devicetree.py
index 7b411e6..265ba89 100644
--- a/pyanaconda/storage/devicetree.py
+++ b/pyanaconda/storage/devicetree.py
@@ -1397,6 +1397,7 @@ class DeviceTree(object):
return

md_name = None
+ md_metadata = None
minor = None

# check the list of devices udev knows about to see if the array
@@ -1417,10 +1418,12 @@ class DeviceTree(object):
if dev_uuid == md_uuid and dev_level == md_level:
md_name = udev_device_get_name(dev)
minor = udev_device_get_minor(dev)
+ md_metadata = dev.get("MD_METADATA")
break

md_info = devicelibs.mdraid.mdexamine(device.path)
- md_metadata = md_info.get("metadata")
+ if not md_metadata:
+ md_metadata = md_info.get("metadata", "0.90")

if not md_name:
# try to name the array based on the preferred minor
--
1.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

"Brian C. Lane" 12-06-2011 07:02 PM

Handle v0.90 md metadata in preexisting arrays.
 
On Tue, Dec 06, 2011 at 01:43:44PM -0600, David Lehman wrote:
> mdadm --examine doesn't output metadata version for 0.90 superblocks
> to preserve backwards compatibility so if no metadata version is
> indicated we must assume 0.90.

Ack to all 3

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


All times are GMT. The time now is 06:58 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.