Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.5:Update
powerpc-utils.17788
ofpathname-make-goto_dir-canonicalize-directory...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ofpathname-make-goto_dir-canonicalize-directory-argu.patch of Package powerpc-utils.17788
From 937780a5fcbd887352e458f32a860c67164a2c14 Mon Sep 17 00:00:00 2001 From: Tyrel Datwyler <tyreld@linux.ibm.com> Date: Wed, 24 Jun 2020 17:25:35 -0500 Subject: [PATCH] ofpathname: make goto_dir canonicalize directory argument Upstream: accepted, expected v1.3.8 Git-commit: 937780a5fcbd887352e458f32a860c67164a2c14 Commit c97fe35b5b6d "ofpathname: speed up l2of_scsi()" attempted to optimize the look up of scsi devices by restricting the base directory input of the 'find' command to /sys/class/block instead of /sys. This works as intended for raw scsi disks such as sda, but broke for scsi disk partitions such as sda1. (0) root @ linux-td1r: /root/powerpc-utils $ ./scripts/ofpathname /dev/sda1 : Logical device "/dev/sda1" does not appear to be configured. (1) root @ linux-td1r: /root/powerpc-utils $ ./scripts/ofpathname /dev/sda /vdevice/v-scsi@30000066/disk@8100000000000000 The differences in looking up sda1 via /sys/class/block vs /sys: (0) root @ linux-td1r: /root/powerpc-utils $ find /sys/class/block -name sda1 /sys/class/block/sda1 (0) root @ linux-td1r: /root/powerpc-utils $ find /sys -name sda1 /sys/devices/vio/30000066/host0/target0:0:1/0:0:1:0/block/sda/sda1 /sys/class/block/sda1 In the end /sys/class/block/sda1 is just a symlink to sda1 under /sys/devices/vio/... (0) root @ linux-td1r: /root/powerpc-utils $ ll /sys/class/block/sda1 lrwxrwxrwx 1 root root 0 Jun 22 18:56 /sys/class/block/sda1 -> ../../devices/vio/30000066/host0/target0:0:1/0:0:1:0/block/sda/sda1 However, ofpathname assumes that by moving up to the parent we will eventually find the raw disk device, in the above example sda, and this will only happen for paths under /sys/devices in the case of scsi disk partitions. Fix this regression by using readlink in goto_dir() to canonicalize the path name of the device while following all symlinks. Fixes: c97fe35b5b6d ("ofpathname: speed up l2of_scsi()") Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com> --- scripts/ofpathname | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ofpathname b/scripts/ofpathname index cbdaa050eb2d..9c0d047cdf7a 100755 --- a/scripts/ofpathname +++ b/scripts/ofpathname @@ -288,7 +288,7 @@ get_usb_storage_no() # $3 on_exit behavior on error goto_dir() { - local start_dir=$1 + local start_dir=$(readlink -f $1) local fname=$2 local found=0 local on_exit=1 -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor