[PATCH 1/5] Fix accounting related to addition of md member devices.

Anne Mulhern amulhern at redhat.com
Tue Apr 22 17:23:18 UTC 2014





----- Original Message -----
> From: "David Lehman" <dlehman at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Tuesday, April 22, 2014 11:26:00 AM
> Subject: [PATCH 1/5] Fix accounting related to addition of md member devices.
> 
> We should not be incrementing memberDevices if we're just adding a member
> device as part of devicetree.populate. In that case we already know the
> number of memberDevices and shouldn't be changing it. It should be
> incremented when adding a new member to an existing array, like when
> scheduling a ContainerAddMember action.
> ---
>  blivet/devices.py | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/blivet/devices.py b/blivet/devices.py
> index 0ede0bd..9d876cf 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -3437,10 +3437,14 @@ class MDRaidArrayDevice(ContainerDevice):
>              # information about it
>              self._size = self.currentSize
>  
> -        if not self.exists:
> +        # These should be incremented when adding new member devices except
> +        # during devicetree.populate. When detecting existing arrays we will
> +        # have gotten these values from udev and will use them to determine
> +        # whether we found all of the members, so we shouldn't change them
> in
> +        # that case.
> +        if not member.format.exists:
>              self._totalDevices += 1
> -
> -        self.memberDevices += 1
> +            self.memberDevices += 1
>  
>      def _removeParent(self, member):
>          if self.level.name == "raid0" and self.exists and
>          member.format.exists:
> --
> 1.9.0
> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 


Probably memberDevices could stand to be commented a lot more heavily as to its purpose
where it is defined. Also, where the name occurs as the parameter for MDRaidArrayDevice constructor.

- mulhern






More information about the anaconda-patches mailing list