SHA256
1
0
forked from pool/s390-tools
s390-tools/s390-tools-sles12sp2-libu2s-Fix-busid-parsing.patch
2017-02-21 11:14:26 +00:00

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);