|
|
96a22b |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
96a22b |
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
96a22b |
Date: Thu, 25 Jun 2020 20:46:08 -0500
|
|
|
96a22b |
Subject: [PATCH] libmultipath: fix sysfs dev_loss_tmo parsing
|
|
|
96a22b |
|
|
|
96a22b |
dev_loss_tmo is a u32 value. However the kernel sysfs code prints it as
|
|
|
96a22b |
a signed integer. This means that if dev_loss_tmo is above INT_MAX, the
|
|
|
96a22b |
sysfs value will be a negative number. Parsing this was causing
|
|
|
96a22b |
sysfs_set_rport_tmo() to fail.
|
|
|
96a22b |
|
|
|
96a22b |
Signed-off-by: Martin Wilck <mwilck@suse.com>
|
|
|
96a22b |
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
96a22b |
---
|
|
|
96a22b |
libmultipath/discovery.c | 6 +++---
|
|
|
96a22b |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
96a22b |
|
|
|
96a22b |
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
|
|
96a22b |
index ffec5162..83a41a4a 100644
|
|
|
96a22b |
--- a/libmultipath/discovery.c
|
|
|
96a22b |
+++ b/libmultipath/discovery.c
|
|
|
96a22b |
@@ -583,7 +583,7 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
|
|
|
96a22b |
struct udev_device *rport_dev = NULL;
|
|
|
96a22b |
char value[16], *eptr;
|
|
|
96a22b |
char rport_id[32];
|
|
|
96a22b |
- unsigned long long tmo = 0;
|
|
|
96a22b |
+ unsigned int tmo;
|
|
|
96a22b |
int ret;
|
|
|
96a22b |
|
|
|
96a22b |
sprintf(rport_id, "rport-%d:%d-%d",
|
|
|
96a22b |
@@ -607,8 +607,8 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
|
|
|
96a22b |
"error %d", rport_id, -ret);
|
|
|
96a22b |
goto out;
|
|
|
96a22b |
}
|
|
|
96a22b |
- tmo = strtoull(value, &eptr, 0);
|
|
|
96a22b |
- if (value == eptr || tmo == ULLONG_MAX) {
|
|
|
96a22b |
+ tmo = strtoul(value, &eptr, 0);
|
|
|
96a22b |
+ if (value == eptr) {
|
|
|
96a22b |
condlog(0, "%s: Cannot parse dev_loss_tmo "
|
|
|
96a22b |
"attribute '%s'", rport_id, value);
|
|
|
96a22b |
goto out;
|
|
|
96a22b |
--
|
|
|
96a22b |
2.17.2
|
|
|
96a22b |
|