[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH rhel6-branch] Resolve /dev/disk/ devices during rescue (#605312)

Assuming the path attribute of an element of DeviceTree._devices is
always a real path under /dev and getDeviceByPath should only always
search for such real path, i.e. not resolve symlinks itself
(but then again below is the only caller of getDeviceByPath currently),
and you tested this succesfully, it looks good to me.
I wonder, if there could be other cases besides /dev/disk/ that would
need similar treatment. Maybe always retrieve realpath unconditionally?

On 07/31/2010 12:25 AM, Brian C. Lane wrote:
> Convert symlinks in /dev/disk/ to their real paths before trying to
> resolve them when mounting the disks for rescue.
> Resolves: rhbz#605312
> ---
>  storage/devicetree.py |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> diff --git a/storage/devicetree.py b/storage/devicetree.py
> index a077e93..28f0dea 100644
> --- a/storage/devicetree.py
> +++ b/storage/devicetree.py
> @@ -2278,6 +2278,9 @@ class DeviceTree(object):
>              if device is None:
>                  log.error("failed to resolve device %s" % devspec)
>          elif devspec.startswith("/dev/"):
> +            if devspec.startswith("/dev/disk/"):
> +                devspec = os.path.realpath(devspec)
> +
>              # device path
>              device = self.getDeviceByPath(devspec)
>              if device is None:


Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Dirk Wittkopp
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]