If pp->dev_loss is DEV_LOSS_TMO_UNSET and min_dev_loss is 0 (which is
the case if no_path_retry is NO_PATH_RETRY_FAIL or NO_PATH_RETRY_UNDEF),
we will set pp->dev_loss to 0, which is wrong. Fix it.

Fixes: 058b5f5 ("libmultipath: fix dev_loss_tmo even if not set in 
configuration")
Signed-off-by: Martin Wilck <mwi...@suse.com>
---
 libmultipath/discovery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
index ae9fc8f..b585156 100644
--- a/libmultipath/discovery.c
+++ b/libmultipath/discovery.c
@@ -942,7 +942,7 @@ sysfs_set_scsi_tmo (struct config *conf, struct multipath 
*mpp)
                        continue;
                }
 
-               if (pp->dev_loss == DEV_LOSS_TMO_UNSET)
+               if (pp->dev_loss == DEV_LOSS_TMO_UNSET && min_dev_loss != 0)
                        pp->dev_loss = min_dev_loss;
                else if (pp->dev_loss < min_dev_loss) {
                        pp->dev_loss = min_dev_loss;
-- 
2.47.0


Reply via email to