Skip to contentSkip to conversation

libmultipath: fix dev_loss_tmo even if not set in configuration

PATCH In review [email protected] 2 participants 2 messages Jun 30, 2023 Device mapper

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libmultipath: fix dev_loss_tmo even if not set in configuration

From: Martin Wilck <[email protected]>

If pp->dev_loss_tmo == DEV_LOSS_TMO_UNSET, sysfs_set_scsi_tmo() would not set it to min_dev_loss_tmo, causing the system dev_loss_tmo value (by default, 30s) to remain unchanged. Fix it.

Fixes 6ad77db ("libmultipath: Set the scsi timeout parameters by path")
---
 libmultipath/discovery.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
libmultipath/discovery.c +2 -3
index 2dcafe5..285cbd6 100644
@@ -895,9 +895,8 @@ sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp)
 			continue;
 		}
 
-		if (pp->dev_loss != DEV_LOSS_TMO_UNSET &&
-		    pp->dev_loss < min_dev_loss) {
-			warn_dev_loss = true;
+		if (pp->dev_loss < min_dev_loss) {
+			warn_dev_loss = (pp->dev_loss != DEV_LOSS_TMO_UNSET);
 			pp->dev_loss = min_dev_loss;
 		}
 		if (pp->dev_loss != DEV_LOSS_TMO_UNSET &&
Signature · 6 lines
2.41.0

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · On Fri, Jun 30, 2023 at 05:55:10PM +0200, [email protected] wrote:

From: Martin Wilck <[email protected]>

If pp->dev_loss_tmo == DEV_LOSS_TMO_UNSET, sysfs_set_scsi_tmo() would not set it to min_dev_loss_tmo, causing the system dev_loss_tmo value (by default, 30s) to remain unchanged. Fix it.

Fixes 6ad77db ("libmultipath: Set the scsi timeout parameters by path")
---
 libmultipath/discovery.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
libmultipath/discovery.c +0 -0
index 2dcafe5..285cbd6 100644
@@ -895,9 +895,8 @@ sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp)
 			continue;

libmultipath/discovery.c sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp) · line 902

Quoted 10 lines
libmultipath/discovery.c +2 -3
 		}
 
-		if (pp->dev_loss != DEV_LOSS_TMO_UNSET &&
-		    pp->dev_loss < min_dev_loss) {
-			warn_dev_loss = true;
+		if (pp->dev_loss < min_dev_loss) {
+			warn_dev_loss = (pp->dev_loss != DEV_LOSS_TMO_UNSET);
 			pp->dev_loss = min_dev_loss;
 		}
 		if (pp->dev_loss != DEV_LOSS_TMO_UNSET &&
Quoted 2 lines
Signature · 1 line
2.41.0

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel