[PATCH 1/3] Remove an obsolete block related to unpredictable md device names.

Anne Mulhern amulhern at redhat.com
Fri Aug 1 09:11:59 UTC 2014





----- Original Message -----
> From: "Anne Mulhern" <amulhern at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Friday, August 1, 2014 11:09:47 AM
> Subject: Re: [PATCH 1/3] Remove an obsolete block related to unpredictable	md	device names.
> 
> 
> 
> 
> 
> ----- Original Message -----
> > From: "David Lehman" <dlehman at redhat.com>
> > To: anaconda-patches at lists.fedorahosted.org
> > Sent: Friday, August 1, 2014 12:16:02 AM
> > Subject: [PATCH 1/3] Remove an obsolete block related to unpredictable md
> > 	device names.
> > 
> > The functionality this block originally provided should be covered by the
> > UUID lookup we do in addUdevMDDevice.
> > 
> > This block no longer works because it relies on md-specific data being in
> > the udev database itself, which is no longer the case. It hasn't been
> > since we removed anaconda's udev rules.
> > ---
> >  blivet/devicetree.py | 36 ++----------------------------------
> >  1 file changed, 2 insertions(+), 34 deletions(-)
> > 
> > diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> > index a6b14d8..f8fc112 100644
> > --- a/blivet/devicetree.py
> > +++ b/blivet/devicetree.py
> > @@ -1594,42 +1594,10 @@ class DeviceTree(object):
> >                  log.warning("invalid data for %s: no RAID level",
> >                  device.name)
> >                  return
> >  
> > -            md_metadata = None
> > -            md_name = None
> > -
> > -            # check the list of devices udev knows about to see if the
> > array
> > -            # this device belongs to is already active
> > -            for dev in udev.get_devices():
> > -                if not udev.device_is_md(dev):
> > -                    continue
> > -
> > -                try:
> > -                    dev_uuid = udev.device_get_md_uuid(dev)
> > -                    dev_level = udev.device_get_md_level(dev)
> > -                except KeyError:
> > -                    continue
> > -
> > -                if dev_uuid is None or dev_level is None:
> > -                    continue
> > -
> > -                if dev_uuid == md_uuid and dev_level == md_level:
> > -                    md_name = udev.device_get_md_name(dev)
> > -                    md_metadata = udev.device_get_md_metadata(dev)
> > -                    if not md_name:
> > -                        # containers don't typically have names and they
> > also
> > -                        # don't have a symlink in /dev/md
> > -                        md_name = udev.device_get_name(dev)
> > -                        if md_level != "container" and \
> > -                           re.match(r'md\d+$', md_name):
> > -                            # md0 -> 0
> > -                            md_name = md_name[2:]
> > -
> > -                    break
> > -
> >              # mdexamine yields MD_METADATA only for metadata version >
> >              0.90
> >              # if MD_METADATA is missing, assume metadata version is 0.90
> > -            md_metadata = md_metadata or
> > udev.device_get_md_metadata(md_info) or "0.90"
> > -
> > +            md_metadata = udev.device_get_md_metadata(md_info) or "0.90"
> > +            md_name = udev.device_get_md_name(md_info)
> >              if not md_name:
> >                  md_path = md_info.get("DEVICE", "")
> >                  if md_path:
> > --
> > 1.9.3
> > 
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> > 
> 
> Ack.
> 
> - mulhern
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Except that the commit message is still a bit deceptive, since
md does set some of those things with its own rules.

- mulhern


More information about the anaconda-patches mailing list