FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 03-16-2011, 03:53 PM
David Lehman
 
Default Only pass --update=super-minor when activating v0 metadata md arrays.

To minimize behavioral changes from 6.0 to 6.1 we track existing arrays'
metadata version so we know which ones can take --update=super-minor. In
Fedora we are discontinuing use of --update=super-minor.

Resolves: rhbz#681136
---
storage/devices.py | 25 ++++++++++++++++---------
storage/devicetree.py | 2 ++
2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index d21172b..7e4c56a 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -2540,7 +2540,7 @@ class MDRaidArrayDevice(StorageDevice):

def __init__(self, name, level=None, major=None, minor=None, size=None,
memberDevices=None, totalDevices=None,
- uuid=None, format=None, exists=None,
+ uuid=None, format=None, exists=None, metadataVersion=None,
parents=None, sysfsPath='):
""" Create a MDRaidArrayDevice instance.

@@ -2551,6 +2551,7 @@ class MDRaidArrayDevice(StorageDevice):
Keyword Arguments:

level -- the device's RAID level (a string, eg: '1' or 'raid1')
+ metadataVersion -- the version of the device's md metadata
parents -- list of member devices (StorageDevice instances)
size -- the device's size (units/format TBD)
uuid -- the device's UUID
@@ -2582,7 +2583,11 @@ class MDRaidArrayDevice(StorageDevice):
self.chunkSize = 512.0 / 1024.0 # chunk size in MB
self.superBlockSize = 2.0 # superblock size in MB

- self.createMetadataVer = "1.1"
+ if not isinstance(metadataVersion, str):
+ self.metadataVersion = "1.1"
+ else:
+ self.metadataVersion = metadataVersion
+
# bitmaps are not meaningful on raid0 according to mdadm-3.0.3
self.createBitmap = self.level != 0

@@ -2667,9 +2672,12 @@ class MDRaidArrayDevice(StorageDevice):
s = StorageDevice.__str__(self)
s += (" level = %(level)s spares = %(spares)s
"
" members = %(memberDevices)s
"
- " total devices = %(totalDevices)s" %
+ " total devices = %(totalDevices)s"
+ " metadata version = %(metadataVersion)s" %
{"level": self.level, "spares": self.spares,
- "memberDevices": self.memberDevices, "totalDevices": self.totalDevices})
+ "memberDevices": self.memberDevices,
+ "totalDevices": self.totalDevices,
+ "metadataVersion": self.metadataVersion})
return s

@property
@@ -2677,7 +2685,8 @@ class MDRaidArrayDevice(StorageDevice):
d = super(MDRaidArrayDevice, self).dict
d.update({"level": self.level,
"spares": self.spares, "memberDevices": self.memberDevices,
- "totalDevices": self.totalDevices})
+ "totalDevices": self.totalDevices,
+ "metadataVersion": self.metadataVersion})
return d

def writeKS(self, f, preexisting=False, noformat=False, s=None):
@@ -2905,9 +2914,7 @@ class MDRaidArrayDevice(StorageDevice):
member.setup(orig=orig)
disks.append(member.path)

- update_super_minor = True
- if self.type == "mdcontainer" or self.type == "mdbiosraidarray":
- update_super_minor = False
+ update_super_minor = self.metadataVersion in ("0", "0.90")

mdraid.mdactivate(self.path,
members=disks,
@@ -2963,7 +2970,7 @@ class MDRaidArrayDevice(StorageDevice):
if getattr(self.format, "mountpoint", None) == bootmountpoint or
getattr(self.format, "mountpoint", None) == "/boot/efi" or
self.format.type == "prepboot":
- self.createMetadataVer = "1.0"
+ self.metadataVersion = "1.0"

# Bitmaps are not useful for swap and small partitions
if self.size < 1000 or self.format.type == "swap":
diff --git a/storage/devicetree.py b/storage/devicetree.py
index c9f84cb..63e8b8b 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -1660,6 +1660,7 @@ class DeviceTree(object):
# try to name the array based on the preferred minor
md_info = devicelibs.mdraid.mdexamine(device.path)
md_path = md_info.get("device", "")
+ md_metadata = md_info.get("metadata")
md_name = devicePathToName(md_info.get("device", ""))
if md_name:
try:
@@ -1695,6 +1696,7 @@ class DeviceTree(object):
minor=minor,
memberDevices=md_devices,
uuid=md_uuid,
+ metadataVersion=md_metadata,
sysfsPath=sysfs_path,
exists=True)
md_array._addDevice(device)
--
1.7.3.5

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 03-16-2011, 06:08 PM
David Cantrell
 
Default Only pass --update=super-minor when activating v0 metadata md arrays.

Ack.

David Lehman <dlehman@redhat.com> wrote:

> To minimize behavioral changes from 6.0 to 6.1 we track existing arrays'
> metadata version so we know which ones can take --update=super-minor. In
> Fedora we are discontinuing use of --update=super-minor.
>
> Resolves: rhbz#681136
> ---
> storage/devices.py | 25 ++++++++++++++++---------
> storage/devicetree.py | 2 ++
> 2 files changed, 18 insertions(+), 9 deletions(-)
>
> diff --git a/storage/devices.py b/storage/devices.py
> index d21172b..7e4c56a 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -2540,7 +2540,7 @@ class MDRaidArrayDevice(StorageDevice):
>
> def __init__(self, name, level=None, major=None, minor=None, size=None,
> memberDevices=None, totalDevices=None,
> - uuid=None, format=None, exists=None,
> + uuid=None, format=None, exists=None, metadataVersion=None,
> parents=None, sysfsPath='):
> """ Create a MDRaidArrayDevice instance.
>
> @@ -2551,6 +2551,7 @@ class MDRaidArrayDevice(StorageDevice):
> Keyword Arguments:
>
> level -- the device's RAID level (a string, eg: '1' or 'raid1')
> + metadataVersion -- the version of the device's md metadata
> parents -- list of member devices (StorageDevice instances)
> size -- the device's size (units/format TBD)
> uuid -- the device's UUID
> @@ -2582,7 +2583,11 @@ class MDRaidArrayDevice(StorageDevice):
> self.chunkSize = 512.0 / 1024.0 # chunk size in MB
> self.superBlockSize = 2.0 # superblock size in MB
>
> - self.createMetadataVer = "1.1"
> + if not isinstance(metadataVersion, str):
> + self.metadataVersion = "1.1"
> + else:
> + self.metadataVersion = metadataVersion
> +
> # bitmaps are not meaningful on raid0 according to mdadm-3.0.3
> self.createBitmap = self.level != 0
>
> @@ -2667,9 +2672,12 @@ class MDRaidArrayDevice(StorageDevice):
> s = StorageDevice.__str__(self)
> s += (" level = %(level)s spares = %(spares)s
"
> " members = %(memberDevices)s
"
> - " total devices = %(totalDevices)s" %
> + " total devices = %(totalDevices)s"
> + " metadata version = %(metadataVersion)s" %
> {"level": self.level, "spares": self.spares,
> - "memberDevices": self.memberDevices, "totalDevices": self.totalDevices})
> + "memberDevices": self.memberDevices,
> + "totalDevices": self.totalDevices,
> + "metadataVersion": self.metadataVersion})
> return s
>
> @property
> @@ -2677,7 +2685,8 @@ class MDRaidArrayDevice(StorageDevice):
> d = super(MDRaidArrayDevice, self).dict
> d.update({"level": self.level,
> "spares": self.spares, "memberDevices": self.memberDevices,
> - "totalDevices": self.totalDevices})
> + "totalDevices": self.totalDevices,
> + "metadataVersion": self.metadataVersion})
> return d
>
> def writeKS(self, f, preexisting=False, noformat=False, s=None):
> @@ -2905,9 +2914,7 @@ class MDRaidArrayDevice(StorageDevice):
> member.setup(orig=orig)
> disks.append(member.path)
>
> - update_super_minor = True
> - if self.type == "mdcontainer" or self.type == "mdbiosraidarray":
> - update_super_minor = False
> + update_super_minor = self.metadataVersion in ("0", "0.90")
>
> mdraid.mdactivate(self.path,
> members=disks,
> @@ -2963,7 +2970,7 @@ class MDRaidArrayDevice(StorageDevice):
> if getattr(self.format, "mountpoint", None) == bootmountpoint or
> getattr(self.format, "mountpoint", None) == "/boot/efi" or
> self.format.type == "prepboot":
> - self.createMetadataVer = "1.0"
> + self.metadataVersion = "1.0"
>
> # Bitmaps are not useful for swap and small partitions
> if self.size < 1000 or self.format.type == "swap":
> diff --git a/storage/devicetree.py b/storage/devicetree.py
> index c9f84cb..63e8b8b 100644
> --- a/storage/devicetree.py
> +++ b/storage/devicetree.py
> @@ -1660,6 +1660,7 @@ class DeviceTree(object):
> # try to name the array based on the preferred minor
> md_info = devicelibs.mdraid.mdexamine(device.path)
> md_path = md_info.get("device", "")
> + md_metadata = md_info.get("metadata")
> md_name = devicePathToName(md_info.get("device", ""))
> if md_name:
> try:
> @@ -1695,6 +1696,7 @@ class DeviceTree(object):
> minor=minor,
> memberDevices=md_devices,
> uuid=md_uuid,
> + metadataVersion=md_metadata,
> sysfsPath=sysfs_path,
> exists=True)
> md_array._addDevice(device)
> --
> 1.7.3.5
>
> _______________________________________________
> Anaconda-devel-list mailing list
> Anaconda-devel-list@redhat.com
> https://www.redhat.com/mailman/listinfo/anaconda-devel-list

--
David Cantrell <dcantrell@redhat.com>
Supervisor, Installer Engineering Team
Red Hat, Inc. | Honolulu, HI | UTC-10

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

Thread Tools




All times are GMT. The time now is 01:08 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org