Hello community,

here is the log from the commit of package powerpc-utils for openSUSE:Factory 
checked in at 2020-06-28 23:05:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/powerpc-utils (Old)
 and      /work/SRC/openSUSE:Factory/.powerpc-utils.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "powerpc-utils"

Sun Jun 28 23:05:58 2020 rev:103 rq:817286 version:1.3.7.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/powerpc-utils/powerpc-utils.changes      
2020-05-28 09:11:23.460324830 +0200
+++ /work/SRC/openSUSE:Factory/.powerpc-utils.new.3060/powerpc-utils.changes    
2020-06-28 23:07:47.507150688 +0200
@@ -1,0 +2,6 @@
+Fri Jun 26 14:48:23 UTC 2020 - Michal Suchanek <[email protected]>
+
+- ofpathname: Fix lookup of disk partitions (bsc#1173403 ltc#186427)
+  * Added ofpathname-make-goto_dir-canonicalize-directory-argu.patch
+
+-------------------------------------------------------------------

New:
----
  ofpathname-make-goto_dir-canonicalize-directory-argu.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ powerpc-utils.spec ++++++
--- /var/tmp/diff_new_pack.6rTTY1/_old  2020-06-28 23:07:48.731154753 +0200
+++ /var/tmp/diff_new_pack.6rTTY1/_new  2020-06-28 23:07:48.735154766 +0200
@@ -39,6 +39,7 @@
 Patch10:        bsc1171892-get-rid-of-trainling-NUL.patch
 Patch11:        Fix-ofpathname-Could-not-retrieve-logical-device-nam.patch
 Patch12:        ofpathname-Fix-udevadm-location.patch
+Patch13:        ofpathname-make-goto_dir-canonicalize-directory-argu.patch
 BuildRequires:  autoconf
 BuildRequires:  automake
 BuildRequires:  librtas-devel
@@ -77,6 +78,7 @@
 %patch10 -p1
 %patch11 -p1
 %patch12 -p1
+%patch13 -p1
 
 %build
 autoreconf -fvi

++++++ Fix-ofpathname-Could-not-retrieve-logical-device-nam.patch ++++++
--- /var/tmp/diff_new_pack.6rTTY1/_old  2020-06-28 23:07:48.759154846 +0200
+++ /var/tmp/diff_new_pack.6rTTY1/_new  2020-06-28 23:07:48.759154846 +0200
@@ -1,11 +1,11 @@
-From e77d74c81ec01abf14c2da96d22314e3088b50d1 Mon Sep 17 00:00:00 2001
+From 5a1e57363554fb609c27e18e9163956580f6632c Mon Sep 17 00:00:00 2001
 From: Michal Suchanek <[email protected]>
-Date: Mon, 25 May 2020 15:18:12 +0200
+Date: Wed, 27 May 2020 09:52:05 -0700
 Subject: [PATCH] Fix ofpathname: Could not retrieve logical device name for
  Open Firmware path
 
-Upstream: submitted 
https://github.com/ibm-power-utilities/powerpc-utils/pull/40
-References: bsc#1164068
+Upstream: pending - expected 1.3.8
+Git-commit: 5a1e57363554fb609c27e18e9163956580f6632c
 
 With commit 73839d6bab4d ("powerpc-utils: Suppress errors reading kernel 
files")
 the return status of tr rather than ofpathname is tested.
@@ -13,6 +13,7 @@
 Fixes: 73839d6bab4d ("powerpc-utils: Suppress errors reading kernel files")
 
 Signed-off-by: Michal Suchanek <[email protected]>
+Signed-off-by: Tyrel Datwyler <[email protected]>
 ---
  scripts/bootlist | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

++++++ ofpathname-Fix-udevadm-location.patch ++++++
--- /var/tmp/diff_new_pack.6rTTY1/_old  2020-06-28 23:07:48.791154952 +0200
+++ /var/tmp/diff_new_pack.6rTTY1/_new  2020-06-28 23:07:48.791154952 +0200
@@ -1,14 +1,15 @@
-From bfdb5433fc9afc7c6ee4fdeaf849d2e059680c2d Mon Sep 17 00:00:00 2001
+From 0f7abc7f08e088bbc9448b3a77def7c6da61c507 Mon Sep 17 00:00:00 2001
 From: Michal Suchanek <[email protected]>
-Date: Mon, 25 May 2020 16:25:34 +0200
+Date: Wed, 27 May 2020 09:52:07 -0700
 Subject: [PATCH] ofpathname: Fix udevadm location
 
-Upstream: submitted
-References: boo#1160890
+Upstream: pending - expected 1.3.8
+Git-commit: 0f7abc7f08e088bbc9448b3a77def7c6da61c507
 
 The canonical location for udevadm is /usr/bin.
 
 Signed-off-by: Michal Suchanek <[email protected]>
+Signed-off-by: Tyrel Datwyler <[email protected]>
 ---
  scripts/ofpathname | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

++++++ ofpathname-make-goto_dir-canonicalize-directory-argu.patch ++++++
>From 937780a5fcbd887352e458f32a860c67164a2c14 Mon Sep 17 00:00:00 2001
From: Tyrel Datwyler <[email protected]>
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 <[email protected]>
---
 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


Reply via email to