[PATCH 2/2] Fix a bug and catch a change in lvm's thin pool layout.

Anne Mulhern amulhern at redhat.com
Wed Apr 2 20:50:30 UTC 2014





----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: "anaconda patch review" <anaconda-patches at lists.fedorahosted.org>
> Sent: Wednesday, April 2, 2014 4:28:56 PM
> Subject: Re: [PATCH 2/2] Fix a bug and catch a change in lvm's thin pool	layout.
> 
> On Wed, 2014-04-02 at 15:00 -0400, Anne Mulhern wrote:
> > 
> > 
> > 
> > ----- Original Message -----
> > > From: "David Lehman" <dlehman at redhat.com>
> > > To: anaconda-patches at lists.fedorahosted.org
> > > Sent: Wednesday, April 2, 2014 10:40:24 AM
> > > Subject: [PATCH 2/2] Fix a bug and catch a change in lvm's thin pool
> > > layout.
> > > 
> > > ---
> > >  blivet/devicetree.py | 5 ++---
> > >  1 file changed, 2 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> > > index 0a39e76..a1f74a8 100644
> > > --- a/blivet/devicetree.py
> > > +++ b/blivet/devicetree.py
> > > @@ -1390,7 +1390,7 @@ class DeviceTree(object):
> > >                      return
> > >  
> > >                  # raid metadata volume
> > > -                lv_name = re.sub(r'_rmeta.+', '', lv_name[1:-1])
> > > +                lv_name = re.sub(r'_[tr]meta.*', '', lv_name[1:-1])
> > >                  name = "%s-%s" % (vg_name, lv_name)
> > >                  addRequiredLV(name, "failed to look up raid lv")
> > >                  raid[name]["meta"] += lv_size
> > > @@ -1437,8 +1437,7 @@ class DeviceTree(object):
> > >                      # do format handling now
> > >                      self.addUdevDevice(lv_info)
> > >  
> > > -        raid = dict(("%s-%s" % (vg_device.name,
> > > -                                n.replace("[", "").replace("]", "")),
> > > +        raid = dict((n.replace("[", "").replace("]", ""),
> > >                       {"copies": 0, "log": Size(bytes=0), "meta":
> > >                       Size(bytes=0)})
> > >                       for n in lv_info.keys())
> > >          for lv in lv_info.values():
> > > --
> > > 1.9.0
> > > 
> > > _______________________________________________
> > > anaconda-patches mailing list
> > > anaconda-patches at lists.fedorahosted.org
> > > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> > > 
> > 
> > A couple of things:
> > 
> > *) I'm not sure that lv_info is guaranteed to be set when its used in the
> > second chunk.
> 
> It is. It gets set at the top of the top-level method (handleVgLvs).
> 

Weird, dunno how I missed it.

> > *) I don't know the structure of the object returned by
> > udev_get_block_device, so I can't really
> > say much about the second chunk change.
> 
> The lv_info dict's keys are the LV names as they appear in /dev/mapper,
> ie: %vgname-%lvname, which is why we don't need to put the vg name on
> there in the generator inside the dict() call.
> 
> > *) The commit message should have more information in it.
> 
> I'll add a bit about each change to the commit message.
> 
> > 
> > - mulhern
> > _______________________________________________
> > anaconda-patches mailing list
> > anaconda-patches at lists.fedorahosted.org
> > https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 

Sounds good, that's all I've got then.

- mulhern


More information about the anaconda-patches mailing list