Blame SOURCES/0100-libmultipath-Set-the-scsi-timeout-parameters-by-path.patch

c90e5b
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
c90e5b
From: Benjamin Marzinski <bmarzins@redhat.com>
c90e5b
Date: Wed, 13 Apr 2022 23:27:38 -0500
c90e5b
Subject: [PATCH] libmultipath: Set the scsi timeout parameters by path
c90e5b
c90e5b
Instead of dev_loss, fast_io_fail, and eh_deadline belonging to the
c90e5b
multipath structure, have them belong to the path structure. This means
c90e5b
that they are selected per path, and that sysfs_set_scsi_tmo() doesn't
c90e5b
assume that all paths of a multipath device will have the same value.
c90e5b
Currently they will all be the same, but a future patch will make it
c90e5b
possible for paths to have different values based on their protocol.
c90e5b
c90e5b
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
c90e5b
Reviewed-by: Martin Wilck <mwilck@suse.com>
c90e5b
---
c90e5b
 libmultipath/configure.c |   5 +-
c90e5b
 libmultipath/discovery.c | 149 +++++++++++++++++++++++----------------
c90e5b
 libmultipath/discovery.h |   2 +-
c90e5b
 libmultipath/propsel.c   |  42 +++++------
c90e5b
 libmultipath/propsel.h   |   6 +-
c90e5b
 libmultipath/structs.c   |   1 -
c90e5b
 libmultipath/structs.h   |   6 +-
c90e5b
 7 files changed, 118 insertions(+), 93 deletions(-)
c90e5b
c90e5b
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
c90e5b
index 9a9890f5..6cad0468 100644
c90e5b
--- a/libmultipath/configure.c
c90e5b
+++ b/libmultipath/configure.c
c90e5b
@@ -338,9 +338,6 @@ int setup_map(struct multipath *mpp, char *params, int params_size,
c90e5b
 	select_mode(conf, mpp);
c90e5b
 	select_uid(conf, mpp);
c90e5b
 	select_gid(conf, mpp);
c90e5b
-	select_fast_io_fail(conf, mpp);
c90e5b
-	select_dev_loss(conf, mpp);
c90e5b
-	select_eh_deadline(conf, mpp);
c90e5b
 	select_reservation_key(conf, mpp);
c90e5b
 	select_deferred_remove(conf, mpp);
c90e5b
 	select_marginal_path_err_sample_time(conf, mpp);
c90e5b
@@ -356,7 +353,7 @@ int setup_map(struct multipath *mpp, char *params, int params_size,
c90e5b
 	select_ghost_delay(conf, mpp);
c90e5b
 	select_flush_on_last_del(conf, mpp);
c90e5b
 
c90e5b
-	sysfs_set_scsi_tmo(mpp, conf->checkint);
c90e5b
+	sysfs_set_scsi_tmo(conf, mpp);
c90e5b
 	marginal_pathgroups = conf->marginal_pathgroups;
c90e5b
 	pthread_cleanup_pop(1);
c90e5b
 
c90e5b
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
c90e5b
index 2404cb87..36cc389e 100644
c90e5b
--- a/libmultipath/discovery.c
c90e5b
+++ b/libmultipath/discovery.c
c90e5b
@@ -581,13 +581,13 @@ sysfs_get_asymmetric_access_state(struct path *pp, char *buff, int buflen)
c90e5b
 }
c90e5b
 
c90e5b
 static int
c90e5b
-sysfs_set_eh_deadline(struct multipath *mpp, struct path *pp)
c90e5b
+sysfs_set_eh_deadline(struct path *pp)
c90e5b
 {
c90e5b
 	struct udev_device *hostdev;
c90e5b
 	char host_name[HOST_NAME_LEN], value[16];
c90e5b
 	int ret;
c90e5b
 
c90e5b
-	if (mpp->eh_deadline == EH_DEADLINE_UNSET)
c90e5b
+	if (pp->eh_deadline == EH_DEADLINE_UNSET)
c90e5b
 		return 0;
c90e5b
 
c90e5b
 	sprintf(host_name, "host%d", pp->sg_id.host_no);
c90e5b
@@ -596,12 +596,12 @@ sysfs_set_eh_deadline(struct multipath *mpp, struct path *pp)
c90e5b
 	if (!hostdev)
c90e5b
 		return 1;
c90e5b
 
c90e5b
-	if (mpp->eh_deadline == EH_DEADLINE_OFF)
c90e5b
+	if (pp->eh_deadline == EH_DEADLINE_OFF)
c90e5b
 		sprintf(value, "off");
c90e5b
-	else if (mpp->eh_deadline == EH_DEADLINE_ZERO)
c90e5b
+	else if (pp->eh_deadline == EH_DEADLINE_ZERO)
c90e5b
 		sprintf(value, "0");
c90e5b
 	else
c90e5b
-		snprintf(value, 16, "%u", mpp->eh_deadline);
c90e5b
+		snprintf(value, 16, "%u", pp->eh_deadline);
c90e5b
 
c90e5b
 	ret = sysfs_attr_set_value(hostdev, "eh_deadline",
c90e5b
 				   value, strlen(value));
c90e5b
@@ -625,6 +625,9 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 	unsigned int tmo;
c90e5b
 	int ret;
c90e5b
 
c90e5b
+	if (!pp->dev_loss && pp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
c90e5b
+		return;
c90e5b
+
c90e5b
 	sprintf(rport_id, "rport-%d:%d-%d",
c90e5b
 		pp->sg_id.host_no, pp->sg_id.channel, pp->sg_id.transport_id);
c90e5b
 	rport_dev = udev_device_new_from_subsystem_sysname(udev,
c90e5b
@@ -664,14 +667,14 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 	 * then set fast_io_fail, and _then_ set dev_loss_tmo
c90e5b
 	 * to the correct value.
c90e5b
 	 */
c90e5b
-	if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET &&
c90e5b
-	    mpp->fast_io_fail != MP_FAST_IO_FAIL_ZERO &&
c90e5b
-	    mpp->fast_io_fail != MP_FAST_IO_FAIL_OFF) {
c90e5b
+	if (pp->fast_io_fail != MP_FAST_IO_FAIL_UNSET &&
c90e5b
+	    pp->fast_io_fail != MP_FAST_IO_FAIL_ZERO &&
c90e5b
+	    pp->fast_io_fail != MP_FAST_IO_FAIL_OFF) {
c90e5b
 		/* Check if we need to temporarily increase dev_loss_tmo */
c90e5b
-		if ((unsigned int)mpp->fast_io_fail >= tmo) {
c90e5b
+		if ((unsigned int)pp->fast_io_fail >= tmo) {
c90e5b
 			/* Increase dev_loss_tmo temporarily */
c90e5b
 			snprintf(value, sizeof(value), "%u",
c90e5b
-				 (unsigned int)mpp->fast_io_fail + 1);
c90e5b
+				 (unsigned int)pp->fast_io_fail + 1);
c90e5b
 			ret = sysfs_attr_set_value(rport_dev, "dev_loss_tmo",
c90e5b
 						   value, strlen(value));
c90e5b
 			if (ret <= 0) {
c90e5b
@@ -685,20 +688,20 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 				goto out;
c90e5b
 			}
c90e5b
 		}
c90e5b
-	} else if (mpp->dev_loss > DEFAULT_DEV_LOSS_TMO &&
c90e5b
-		mpp->no_path_retry != NO_PATH_RETRY_QUEUE) {
c90e5b
+	} else if (pp->dev_loss > DEFAULT_DEV_LOSS_TMO &&
c90e5b
+		   mpp->no_path_retry != NO_PATH_RETRY_QUEUE) {
c90e5b
 		condlog(3, "%s: limiting dev_loss_tmo to %d, since "
c90e5b
 			"fast_io_fail is not set",
c90e5b
 			rport_id, DEFAULT_DEV_LOSS_TMO);
c90e5b
-		mpp->dev_loss = DEFAULT_DEV_LOSS_TMO;
c90e5b
+		pp->dev_loss = DEFAULT_DEV_LOSS_TMO;
c90e5b
 	}
c90e5b
-	if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
c90e5b
-		if (mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF)
c90e5b
+	if (pp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
c90e5b
+		if (pp->fast_io_fail == MP_FAST_IO_FAIL_OFF)
c90e5b
 			sprintf(value, "off");
c90e5b
-		else if (mpp->fast_io_fail == MP_FAST_IO_FAIL_ZERO)
c90e5b
+		else if (pp->fast_io_fail == MP_FAST_IO_FAIL_ZERO)
c90e5b
 			sprintf(value, "0");
c90e5b
 		else
c90e5b
-			snprintf(value, 16, "%u", mpp->fast_io_fail);
c90e5b
+			snprintf(value, 16, "%u", pp->fast_io_fail);
c90e5b
 		ret = sysfs_attr_set_value(rport_dev, "fast_io_fail_tmo",
c90e5b
 					   value, strlen(value));
c90e5b
 		if (ret <= 0) {
c90e5b
@@ -709,8 +712,8 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 					rport_id, value, -ret);
c90e5b
 		}
c90e5b
 	}
c90e5b
-	if (mpp->dev_loss > 0) {
c90e5b
-		snprintf(value, 16, "%u", mpp->dev_loss);
c90e5b
+	if (pp->dev_loss > 0) {
c90e5b
+		snprintf(value, 16, "%u", pp->dev_loss);
c90e5b
 		ret = sysfs_attr_set_value(rport_dev, "dev_loss_tmo",
c90e5b
 					   value, strlen(value));
c90e5b
 		if (ret <= 0) {
c90e5b
@@ -726,7 +729,7 @@ out:
c90e5b
 }
c90e5b
 
c90e5b
 static void
c90e5b
-sysfs_set_session_tmo(struct multipath *mpp, struct path *pp)
c90e5b
+sysfs_set_session_tmo(struct path *pp)
c90e5b
 {
c90e5b
 	struct udev_device *session_dev = NULL;
c90e5b
 	char session_id[64];
c90e5b
@@ -743,18 +746,18 @@ sysfs_set_session_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 	condlog(4, "target%d:%d:%d -> %s", pp->sg_id.host_no,
c90e5b
 		pp->sg_id.channel, pp->sg_id.scsi_id, session_id);
c90e5b
 
c90e5b
-	if (mpp->dev_loss) {
c90e5b
+	if (pp->dev_loss) {
c90e5b
 		condlog(3, "%s: ignoring dev_loss_tmo on iSCSI", pp->dev);
c90e5b
 	}
c90e5b
-	if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
c90e5b
-		if (mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF) {
c90e5b
+	if (pp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
c90e5b
+		if (pp->fast_io_fail == MP_FAST_IO_FAIL_OFF) {
c90e5b
 			condlog(3, "%s: can't switch off fast_io_fail_tmo "
c90e5b
 				"on iSCSI", pp->dev);
c90e5b
-		} else if (mpp->fast_io_fail == MP_FAST_IO_FAIL_ZERO) {
c90e5b
+		} else if (pp->fast_io_fail == MP_FAST_IO_FAIL_ZERO) {
c90e5b
 			condlog(3, "%s: can't set fast_io_fail_tmo to '0'"
c90e5b
 				"on iSCSI", pp->dev);
c90e5b
 		} else {
c90e5b
-			snprintf(value, 11, "%u", mpp->fast_io_fail);
c90e5b
+			snprintf(value, 11, "%u", pp->fast_io_fail);
c90e5b
 			if (sysfs_attr_set_value(session_dev, "recovery_tmo",
c90e5b
 						 value, strlen(value)) <= 0) {
c90e5b
 				condlog(3, "%s: Failed to set recovery_tmo, "
c90e5b
@@ -767,12 +770,15 @@ sysfs_set_session_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 }
c90e5b
 
c90e5b
 static void
c90e5b
-sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp)
c90e5b
+sysfs_set_nexus_loss_tmo(struct path *pp)
c90e5b
 {
c90e5b
 	struct udev_device *sas_dev = NULL;
c90e5b
 	char end_dev_id[64];
c90e5b
 	char value[11];
c90e5b
 
c90e5b
+	if (!pp->udev || !pp->dev_loss)
c90e5b
+		return;
c90e5b
+
c90e5b
 	sprintf(end_dev_id, "end_device-%d:%d",
c90e5b
 		pp->sg_id.host_no, pp->sg_id.transport_id);
c90e5b
 	sas_dev = udev_device_new_from_subsystem_sysname(udev,
c90e5b
@@ -785,8 +791,8 @@ sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 	condlog(4, "target%d:%d:%d -> %s", pp->sg_id.host_no,
c90e5b
 		pp->sg_id.channel, pp->sg_id.scsi_id, end_dev_id);
c90e5b
 
c90e5b
-	if (mpp->dev_loss) {
c90e5b
-		snprintf(value, 11, "%u", mpp->dev_loss);
c90e5b
+	if (pp->dev_loss) {
c90e5b
+		snprintf(value, 11, "%u", pp->dev_loss);
c90e5b
 		if (sysfs_attr_set_value(sas_dev, "I_T_nexus_loss_timeout",
c90e5b
 					 value, strlen(value)) <= 0)
c90e5b
 			condlog(3, "%s: failed to update "
c90e5b
@@ -798,53 +804,76 @@ sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp)
c90e5b
 }
c90e5b
 
c90e5b
 int
c90e5b
-sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint)
c90e5b
+sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp)
c90e5b
 {
c90e5b
 	struct path *pp;
c90e5b
 	int i;
c90e5b
-	unsigned int dev_loss_tmo = mpp->dev_loss;
c90e5b
+	unsigned int min_dev_loss = 0;
c90e5b
+	bool warn_dev_loss = false;
c90e5b
+	bool warn_fast_io_fail = false;
c90e5b
 
c90e5b
 	if (mpp->no_path_retry > 0) {
c90e5b
 		uint64_t no_path_retry_tmo =
c90e5b
-			(uint64_t)mpp->no_path_retry * checkint;
c90e5b
+			(uint64_t)mpp->no_path_retry * conf->checkint;
c90e5b
 
c90e5b
 		if (no_path_retry_tmo > MAX_DEV_LOSS_TMO)
c90e5b
-			no_path_retry_tmo = MAX_DEV_LOSS_TMO;
c90e5b
-		if (no_path_retry_tmo > dev_loss_tmo)
c90e5b
-			dev_loss_tmo = no_path_retry_tmo;
c90e5b
-		condlog(3, "%s: update dev_loss_tmo to %u",
c90e5b
-			mpp->alias, dev_loss_tmo);
c90e5b
-	} else if (mpp->no_path_retry == NO_PATH_RETRY_QUEUE) {
c90e5b
-		dev_loss_tmo = MAX_DEV_LOSS_TMO;
c90e5b
-		condlog(3, "%s: update dev_loss_tmo to %u",
c90e5b
-			mpp->alias, dev_loss_tmo);
c90e5b
-	}
c90e5b
-	mpp->dev_loss = dev_loss_tmo;
c90e5b
-	if (mpp->dev_loss && mpp->fast_io_fail > 0 &&
c90e5b
-	    (unsigned int)mpp->fast_io_fail >= mpp->dev_loss) {
c90e5b
-		condlog(3, "%s: turning off fast_io_fail (%d is not smaller than dev_loss_tmo)",
c90e5b
-			mpp->alias, mpp->fast_io_fail);
c90e5b
-		mpp->fast_io_fail = MP_FAST_IO_FAIL_OFF;
c90e5b
-	}
c90e5b
-	if (!mpp->dev_loss && mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET &&
c90e5b
-	    mpp->eh_deadline == EH_DEADLINE_UNSET)
c90e5b
-		return 0;
c90e5b
+			min_dev_loss = MAX_DEV_LOSS_TMO;
c90e5b
+		else
c90e5b
+			min_dev_loss = no_path_retry_tmo;
c90e5b
+	} else if (mpp->no_path_retry == NO_PATH_RETRY_QUEUE)
c90e5b
+		min_dev_loss = MAX_DEV_LOSS_TMO;
c90e5b
 
c90e5b
 	vector_foreach_slot(mpp->paths, pp, i) {
c90e5b
+		select_fast_io_fail(conf, pp);
c90e5b
+		select_dev_loss(conf, pp);
c90e5b
+		select_eh_deadline(conf, pp);
c90e5b
+
c90e5b
+		if (!pp->dev_loss && pp->eh_deadline == EH_DEADLINE_UNSET &&
c90e5b
+		    pp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
c90e5b
+			continue;
c90e5b
+
c90e5b
 		if (pp->bus != SYSFS_BUS_SCSI)
c90e5b
 			continue;
c90e5b
+		sysfs_set_eh_deadline(pp);
c90e5b
+
c90e5b
+		if (!pp->dev_loss && pp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
c90e5b
+			continue;
c90e5b
+
c90e5b
+		if (pp->sg_id.proto_id != SCSI_PROTOCOL_FCP &&
c90e5b
+		    pp->sg_id.proto_id != SCSI_PROTOCOL_ISCSI &&
c90e5b
+		    pp->sg_id.proto_id != SCSI_PROTOCOL_SAS)
c90e5b
+			continue;
c90e5b
+
c90e5b
+		if (pp->dev_loss > 0 && pp->dev_loss < min_dev_loss) {
c90e5b
+			warn_dev_loss = true;
c90e5b
+			pp->dev_loss = min_dev_loss;
c90e5b
+		}
c90e5b
+		if (pp->dev_loss > 0 && pp->fast_io_fail > 0 &&
c90e5b
+		    (unsigned int)pp->fast_io_fail >= pp->dev_loss) {
c90e5b
+			warn_fast_io_fail = true;
c90e5b
+			pp->fast_io_fail = MP_FAST_IO_FAIL_OFF;
c90e5b
+		}
c90e5b
 
c90e5b
-		if (mpp->dev_loss ||
c90e5b
-		    mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
c90e5b
-			if (pp->sg_id.proto_id == SCSI_PROTOCOL_FCP)
c90e5b
-				sysfs_set_rport_tmo(mpp, pp);
c90e5b
-			else if (pp->sg_id.proto_id == SCSI_PROTOCOL_ISCSI)
c90e5b
-				sysfs_set_session_tmo(mpp, pp);
c90e5b
-			else if (pp->sg_id.proto_id == SCSI_PROTOCOL_SAS)
c90e5b
-				sysfs_set_nexus_loss_tmo(mpp, pp);
c90e5b
+		switch (pp->sg_id.proto_id) {
c90e5b
+		case SCSI_PROTOCOL_FCP:
c90e5b
+			sysfs_set_rport_tmo(mpp, pp);
c90e5b
+			break;
c90e5b
+		case SCSI_PROTOCOL_ISCSI:
c90e5b
+			sysfs_set_session_tmo(pp);
c90e5b
+			break;
c90e5b
+		case SCSI_PROTOCOL_SAS:
c90e5b
+			sysfs_set_nexus_loss_tmo(pp);
c90e5b
+			break;
c90e5b
+		default:
c90e5b
+			break;
c90e5b
 		}
c90e5b
-		sysfs_set_eh_deadline(mpp, pp);
c90e5b
 	}
c90e5b
+	if (warn_dev_loss)
c90e5b
+		condlog(2, "%s: Raising dev_loss_tmo to %u because of no_path_retry setting",
c90e5b
+			mpp->alias, min_dev_loss);
c90e5b
+	if (warn_fast_io_fail)
c90e5b
+		condlog(3, "%s: turning off fast_io_fail (not smaller than dev_loss_tmo)",
c90e5b
+			mpp->alias);
c90e5b
 	return 0;
c90e5b
 }
c90e5b
 
c90e5b
diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h
c90e5b
index a5446b4d..b6eea258 100644
c90e5b
--- a/libmultipath/discovery.h
c90e5b
+++ b/libmultipath/discovery.h
c90e5b
@@ -42,7 +42,7 @@ int alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
c90e5b
 int store_pathinfo (vector pathvec, struct config *conf,
c90e5b
 		    struct udev_device *udevice, int flag,
c90e5b
 		    struct path **pp_ptr);
c90e5b
-int sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint);
c90e5b
+int sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp);
c90e5b
 int sysfs_get_timeout(const struct path *pp, unsigned int *timeout);
c90e5b
 int sysfs_get_host_pci_name(const struct path *pp, char *pci_name);
c90e5b
 int sysfs_get_iscsi_ip_address(const struct path *pp, char *ip_address);
c90e5b
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
c90e5b
index 127b3370..25326eb6 100644
c90e5b
--- a/libmultipath/propsel.c
c90e5b
+++ b/libmultipath/propsel.c
c90e5b
@@ -766,51 +766,51 @@ int select_minio(struct config *conf, struct multipath *mp)
c90e5b
 		return select_minio_bio(conf, mp);
c90e5b
 }
c90e5b
 
c90e5b
-int select_fast_io_fail(struct config *conf, struct multipath *mp)
c90e5b
+int select_fast_io_fail(struct config *conf, struct path *pp)
c90e5b
 {
c90e5b
 	const char *origin;
c90e5b
 	char buff[12];
c90e5b
 
c90e5b
-	mp_set_ovr(fast_io_fail);
c90e5b
-	mp_set_hwe(fast_io_fail);
c90e5b
-	mp_set_conf(fast_io_fail);
c90e5b
-	mp_set_default(fast_io_fail, DEFAULT_FAST_IO_FAIL);
c90e5b
+	pp_set_ovr(fast_io_fail);
c90e5b
+	pp_set_hwe(fast_io_fail);
c90e5b
+	pp_set_conf(fast_io_fail);
c90e5b
+	pp_set_default(fast_io_fail, DEFAULT_FAST_IO_FAIL);
c90e5b
 out:
c90e5b
-	print_undef_off_zero(buff, 12, mp->fast_io_fail);
c90e5b
-	condlog(3, "%s: fast_io_fail_tmo = %s %s", mp->alias, buff, origin);
c90e5b
+	print_undef_off_zero(buff, 12, pp->fast_io_fail);
c90e5b
+	condlog(3, "%s: fast_io_fail_tmo = %s %s", pp->dev, buff, origin);
c90e5b
 	return 0;
c90e5b
 }
c90e5b
 
c90e5b
-int select_dev_loss(struct config *conf, struct multipath *mp)
c90e5b
+int select_dev_loss(struct config *conf, struct path *pp)
c90e5b
 {
c90e5b
 	const char *origin;
c90e5b
 	char buff[12];
c90e5b
 
c90e5b
-	mp_set_ovr(dev_loss);
c90e5b
-	mp_set_hwe(dev_loss);
c90e5b
-	mp_set_conf(dev_loss);
c90e5b
-	mp->dev_loss = 0;
c90e5b
+	pp_set_ovr(dev_loss);
c90e5b
+	pp_set_hwe(dev_loss);
c90e5b
+	pp_set_conf(dev_loss);
c90e5b
+	pp->dev_loss = 0;
c90e5b
 	return 0;
c90e5b
 out:
c90e5b
-	print_dev_loss(buff, 12, mp->dev_loss);
c90e5b
-	condlog(3, "%s: dev_loss_tmo = %s %s", mp->alias, buff, origin);
c90e5b
+	print_dev_loss(buff, 12, pp->dev_loss);
c90e5b
+	condlog(3, "%s: dev_loss_tmo = %s %s", pp->dev, buff, origin);
c90e5b
 	return 0;
c90e5b
 }
c90e5b
 
c90e5b
-int select_eh_deadline(struct config *conf, struct multipath *mp)
c90e5b
+int select_eh_deadline(struct config *conf, struct path *pp)
c90e5b
 {
c90e5b
 	const char *origin;
c90e5b
 	char buff[12];
c90e5b
 
c90e5b
-	mp_set_ovr(eh_deadline);
c90e5b
-	mp_set_hwe(eh_deadline);
c90e5b
-	mp_set_conf(eh_deadline);
c90e5b
-	mp->eh_deadline = EH_DEADLINE_UNSET;
c90e5b
+	pp_set_ovr(eh_deadline);
c90e5b
+	pp_set_hwe(eh_deadline);
c90e5b
+	pp_set_conf(eh_deadline);
c90e5b
+	pp->eh_deadline = EH_DEADLINE_UNSET;
c90e5b
 	/* not changing sysfs in default cause, so don't print anything */
c90e5b
 	return 0;
c90e5b
 out:
c90e5b
-	print_undef_off_zero(buff, 12, mp->eh_deadline);
c90e5b
-	condlog(3, "%s: eh_deadline = %s %s", mp->alias, buff, origin);
c90e5b
+	print_undef_off_zero(buff, 12, pp->eh_deadline);
c90e5b
+	condlog(3, "%s: eh_deadline = %s %s", pp->dev, buff, origin);
c90e5b
 	return 0;
c90e5b
 }
c90e5b
 
c90e5b
diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h
c90e5b
index 72a7e33c..152ca44c 100644
c90e5b
--- a/libmultipath/propsel.h
c90e5b
+++ b/libmultipath/propsel.h
c90e5b
@@ -16,9 +16,9 @@ int select_minio(struct config *conf, struct multipath *mp);
c90e5b
 int select_mode(struct config *conf, struct multipath *mp);
c90e5b
 int select_uid(struct config *conf, struct multipath *mp);
c90e5b
 int select_gid(struct config *conf, struct multipath *mp);
c90e5b
-int select_fast_io_fail(struct config *conf, struct multipath *mp);
c90e5b
-int select_dev_loss(struct config *conf, struct multipath *mp);
c90e5b
-int select_eh_deadline(struct config *conf, struct multipath *mp);
c90e5b
+int select_fast_io_fail(struct config *conf, struct path *pp);
c90e5b
+int select_dev_loss(struct config *conf, struct path *pp);
c90e5b
+int select_eh_deadline(struct config *conf, struct path *pp);
c90e5b
 int select_reservation_key(struct config *conf, struct multipath *mp);
c90e5b
 int select_retain_hwhandler (struct config *conf, struct multipath * mp);
c90e5b
 int select_detect_prio(struct config *conf, struct path * pp);
c90e5b
diff --git a/libmultipath/structs.c b/libmultipath/structs.c
c90e5b
index 19099bed..9f86eb69 100644
c90e5b
--- a/libmultipath/structs.c
c90e5b
+++ b/libmultipath/structs.c
c90e5b
@@ -230,7 +230,6 @@ alloc_multipath (void)
c90e5b
 		mpp->bestpg = 1;
c90e5b
 		mpp->mpcontext = NULL;
c90e5b
 		mpp->no_path_retry = NO_PATH_RETRY_UNDEF;
c90e5b
-		mpp->fast_io_fail = MP_FAST_IO_FAIL_UNSET;
c90e5b
 		dm_multipath_to_gen(mpp)->ops = &dm_gen_multipath_ops;
c90e5b
 	}
c90e5b
 	return mpp;
c90e5b
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
c90e5b
index ab99852f..875e726e 100644
c90e5b
--- a/libmultipath/structs.h
c90e5b
+++ b/libmultipath/structs.h
c90e5b
@@ -344,6 +344,9 @@ struct path {
c90e5b
 	int marginal;
c90e5b
 	int vpd_vendor_id;
c90e5b
 	int recheck_wwid;
c90e5b
+	int fast_io_fail;
c90e5b
+	unsigned int dev_loss;
c90e5b
+	int eh_deadline;
c90e5b
 	/* configlet pointers */
c90e5b
 	vector hwe;
c90e5b
 	struct gen_path generic_path;
c90e5b
@@ -371,7 +374,6 @@ struct multipath {
c90e5b
 	int minio;
c90e5b
 	int flush_on_last_del;
c90e5b
 	int attribute_flags;
c90e5b
-	int fast_io_fail;
c90e5b
 	int retain_hwhandler;
c90e5b
 	int deferred_remove;
c90e5b
 	bool in_recovery;
c90e5b
@@ -389,8 +391,6 @@ struct multipath {
c90e5b
 	int needs_paths_uevent;
c90e5b
 	int ghost_delay;
c90e5b
 	int ghost_delay_tick;
c90e5b
-	unsigned int dev_loss;
c90e5b
-	int eh_deadline;
c90e5b
 	uid_t uid;
c90e5b
 	gid_t gid;
c90e5b
 	mode_t mode;