forked from pool/s390-tools
Marcus Meissner
9b729e2acc
New package per "Factory first" policy. Please list me as bug owner and maintainer, if possible. OBS-URL: https://build.opensuse.org/request/show/459343 OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=1
38 lines
1.6 KiB
Diff
38 lines
1.6 KiB
Diff
Subject: [PATCH] [BZ 140500] libu2s: Fix busid parsing
|
|
From: Jan Höppner <hoeppner@linux.vnet.ibm.com>
|
|
|
|
Description: libu2s: Fix busid parsing
|
|
Symptom: dasdview displays a wrong busid and shows the error message
|
|
"Error: dasdview: Could not retrieve raw_track_access mode
|
|
information.", which is wrong as well.
|
|
Problem: dasdview retrieves the busid information from libu2s. Whenever
|
|
an FBA DASD is listed prior to the target DASD in
|
|
/proc/dasd/devices, the parsing will fail due to an additional
|
|
whitespace character. For example, an entry for ECKD devices
|
|
starts with "0.0.5e30(ECKD)...", while an entry for FBA starts
|
|
with "0.0.8000(FBA )...".
|
|
Solution: Change the busid parsing in libu2s by explicitly looking for the
|
|
closing bracket.
|
|
Reproduction: Add an FBA device and then an ECKD device to the system and use
|
|
dasdview to display information about the ECKD device.
|
|
# dasdview -i /dev/dasdX
|
|
Upstream-ID: -
|
|
Problem-ID: 140500
|
|
|
|
Signed-off-by: Jan Höppner <hoeppner@linux.vnet.ibm.com>
|
|
---
|
|
libu2s/u2s.c | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
--- a/libu2s/u2s.c
|
|
+++ b/libu2s/u2s.c
|
|
@@ -237,7 +237,7 @@ static int find_busid_in_proc(int maja,
|
|
filp = fopen("/proc/dasd/devices", "r");
|
|
if (!filp)
|
|
return rc;
|
|
- while (fscanf(filp, "%[^(] %*s at ( %d : %d %*[^\n]\n",
|
|
+ while (fscanf(filp, "%[^(] %*[^)] ) at ( %d : %d %*[^\n]\n",
|
|
bus, &majb, &minb) != EOF) {
|
|
if ((maja == majb) && (mina == minb)) {
|
|
strncpy(busid, bus, BUSIDSIZE + 1);
|