diff mbox series

Fixup "libmultipath: fix dev_loss_tmo even if not set in configuration"

Message ID 20230704100818.30263-1-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series Fixup "libmultipath: fix dev_loss_tmo even if not set in configuration" | expand

Commit Message

Martin Wilck July 4, 2023, 10:08 a.m. UTC
From: Martin Wilck <mwilck@suse.com>

My previous patch "libmultipath: fix dev_loss_tmo even if not set in
configuration" implicitly assumed that DEV_LOSS_TMO is 0, which is true
but unclean. Make the intention of the code more explicit.

Signed-off-by: Martin Wilck <mwilck@suse.com>

---
Ben: If you ack this, I'll squash it into the previous patch.
     Also, please have a look at https://listman.redhat.com/archives/dm-devel/2023-June/055113.html
     (I know the commit message is truncated, will fix).
     If this passes, I'd like to submit to Christophe this week.

---
 libmultipath/discovery.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index 285cbd6..5626d48 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -895,9 +895,11 @@  sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp)
 			continue;
 		}
 
-		if (pp->dev_loss < min_dev_loss) {
-			warn_dev_loss = (pp->dev_loss != DEV_LOSS_TMO_UNSET);
+		if (pp->dev_loss == DEV_LOSS_TMO_UNSET)
 			pp->dev_loss = min_dev_loss;
+		else if (pp->dev_loss < min_dev_loss) {
+			pp->dev_loss = min_dev_loss;
+			warn_dev_loss = true;
 		}
 		if (pp->dev_loss != DEV_LOSS_TMO_UNSET &&
 		    pp->fast_io_fail > 0 &&