[PATCH 3/3] Fix handling of devices activated as a side-effect of actions.

Vratislav Podzimek vpodzime at redhat.com
Mon May 5 11:31:10 UTC 2014


On Fri, 2014-05-02 at 13:58 -0500, David Lehman wrote:
> Removing a partition triggers a udev change event for the disk, which
> then triggers udev rules which activate all md arrays on that disk.
> 
> getDependentDevices doesn't always work because of various effects of
> action registration. Perhaps most importantly, devices that exist but
> whose removal is pending are not in the list of devices checked by
> getDependentDevices.
> ---
>  blivet/devicetree.py | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/blivet/devicetree.py b/blivet/devicetree.py
> index 8941c7e..d3361cb 100644
> --- a/blivet/devicetree.py
> +++ b/blivet/devicetree.py
> @@ -346,13 +346,13 @@ class DeviceTree(object):
>                  try:
>                      action.execute()
>                  except DiskLabelCommitError:
> -                    if not flags.installer_mode:
> -                        raise
> -
> -                    # it's likely that a previous format destroy action
> +                    # it's likely that a previous action
>                      # triggered setup of an lvm or md device.
> -                    for dep in self.getDependentDevices(action.device.disk):
> -                        dep.teardown(recursive=True)
> +                    # include deps no longer in the tree due to pending removal
> +                    devs = self._devices + [a.device for a in self._actions]
> +                    for dep in list(set(devs)):
I believe the list() call can be omitted here.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list