|
|
aebebb |
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
aebebb |
From: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
aebebb |
Date: Wed, 13 Apr 2022 23:27:38 -0500
|
|
|
aebebb |
Subject: [PATCH] libmultipath: Set the scsi timeout parameters by path
|
|
|
aebebb |
|
|
|
aebebb |
Instead of dev_loss, fast_io_fail, and eh_deadline belonging to the
|
|
|
aebebb |
multipath structure, have them belong to the path structure. This means
|
|
|
aebebb |
that they are selected per path, and that sysfs_set_scsi_tmo() doesn't
|
|
|
aebebb |
assume that all paths of a multipath device will have the same value.
|
|
|
aebebb |
Currently they will all be the same, but a future patch will make it
|
|
|
aebebb |
possible for paths to have different values based on their protocol.
|
|
|
aebebb |
|
|
|
aebebb |
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
|
|
|
aebebb |
Reviewed-by: Martin Wilck <mwilck@suse.com>
|
|
|
aebebb |
---
|
|
|
aebebb |
libmultipath/configure.c | 5 +-
|
|
|
aebebb |
libmultipath/discovery.c | 158 ++++++++++++++++++++-------------------
|
|
|
aebebb |
libmultipath/discovery.h | 2 +-
|
|
|
aebebb |
libmultipath/propsel.c | 42 +++++------
|
|
|
aebebb |
libmultipath/propsel.h | 6 +-
|
|
|
aebebb |
libmultipath/structs.c | 1 -
|
|
|
aebebb |
libmultipath/structs.h | 6 +-
|
|
|
aebebb |
7 files changed, 112 insertions(+), 108 deletions(-)
|
|
|
aebebb |
|
|
|
aebebb |
diff --git a/libmultipath/configure.c b/libmultipath/configure.c
|
|
|
aebebb |
index 043e4232..70049f47 100644
|
|
|
aebebb |
--- a/libmultipath/configure.c
|
|
|
aebebb |
+++ b/libmultipath/configure.c
|
|
|
aebebb |
@@ -365,9 +365,6 @@ int setup_map(struct multipath *mpp, char **params, struct vectors *vecs)
|
|
|
aebebb |
select_mode(conf, mpp);
|
|
|
aebebb |
select_uid(conf, mpp);
|
|
|
aebebb |
select_gid(conf, mpp);
|
|
|
aebebb |
- select_fast_io_fail(conf, mpp);
|
|
|
aebebb |
- select_dev_loss(conf, mpp);
|
|
|
aebebb |
- select_eh_deadline(conf, mpp);
|
|
|
aebebb |
select_reservation_key(conf, mpp);
|
|
|
aebebb |
select_deferred_remove(conf, mpp);
|
|
|
aebebb |
select_marginal_path_err_sample_time(conf, mpp);
|
|
|
aebebb |
@@ -383,7 +380,7 @@ int setup_map(struct multipath *mpp, char **params, struct vectors *vecs)
|
|
|
aebebb |
select_ghost_delay(conf, mpp);
|
|
|
aebebb |
select_flush_on_last_del(conf, mpp);
|
|
|
aebebb |
|
|
|
aebebb |
- sysfs_set_scsi_tmo(mpp, conf->checkint);
|
|
|
aebebb |
+ sysfs_set_scsi_tmo(conf, mpp);
|
|
|
aebebb |
marginal_pathgroups = conf->marginal_pathgroups;
|
|
|
aebebb |
pthread_cleanup_pop(1);
|
|
|
aebebb |
|
|
|
aebebb |
diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c
|
|
|
aebebb |
index 6fb81c28..bcda8b09 100644
|
|
|
aebebb |
--- a/libmultipath/discovery.c
|
|
|
aebebb |
+++ b/libmultipath/discovery.c
|
|
|
aebebb |
@@ -596,13 +596,13 @@ sysfs_get_asymmetric_access_state(struct path *pp, char *buff, int buflen)
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
static int
|
|
|
aebebb |
-sysfs_set_eh_deadline(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
+sysfs_set_eh_deadline(struct path *pp)
|
|
|
aebebb |
{
|
|
|
aebebb |
struct udev_device *hostdev;
|
|
|
aebebb |
char host_name[HOST_NAME_LEN], value[16];
|
|
|
aebebb |
int ret, len;
|
|
|
aebebb |
|
|
|
aebebb |
- if (mpp->eh_deadline == EH_DEADLINE_UNSET)
|
|
|
aebebb |
+ if (pp->eh_deadline == EH_DEADLINE_UNSET)
|
|
|
aebebb |
return 0;
|
|
|
aebebb |
|
|
|
aebebb |
sprintf(host_name, "host%d", pp->sg_id.host_no);
|
|
|
aebebb |
@@ -611,12 +611,12 @@ sysfs_set_eh_deadline(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
if (!hostdev)
|
|
|
aebebb |
return 1;
|
|
|
aebebb |
|
|
|
aebebb |
- if (mpp->eh_deadline == EH_DEADLINE_OFF)
|
|
|
aebebb |
+ if (pp->eh_deadline == EH_DEADLINE_OFF)
|
|
|
aebebb |
len = sprintf(value, "off");
|
|
|
aebebb |
- else if (mpp->eh_deadline == EH_DEADLINE_ZERO)
|
|
|
aebebb |
+ else if (pp->eh_deadline == EH_DEADLINE_ZERO)
|
|
|
aebebb |
len = sprintf(value, "0");
|
|
|
aebebb |
else
|
|
|
aebebb |
- len = sprintf(value, "%d", mpp->eh_deadline);
|
|
|
aebebb |
+ len = sprintf(value, "%d", pp->eh_deadline);
|
|
|
aebebb |
|
|
|
aebebb |
ret = sysfs_attr_set_value(hostdev, "eh_deadline",
|
|
|
aebebb |
value, len + 1);
|
|
|
aebebb |
@@ -640,8 +640,8 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
unsigned int tmo;
|
|
|
aebebb |
int ret;
|
|
|
aebebb |
|
|
|
aebebb |
- if (mpp->dev_loss == DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
- mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
|
|
|
aebebb |
+ if (pp->dev_loss == DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
+ pp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
|
|
|
aebebb |
return;
|
|
|
aebebb |
|
|
|
aebebb |
sprintf(rport_id, "rport-%d:%d-%d",
|
|
|
aebebb |
@@ -683,14 +683,14 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
* then set fast_io_fail, and _then_ set dev_loss_tmo
|
|
|
aebebb |
* to the correct value.
|
|
|
aebebb |
*/
|
|
|
aebebb |
- if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET &&
|
|
|
aebebb |
- mpp->fast_io_fail != MP_FAST_IO_FAIL_ZERO &&
|
|
|
aebebb |
- mpp->fast_io_fail != MP_FAST_IO_FAIL_OFF) {
|
|
|
aebebb |
+ if (pp->fast_io_fail != MP_FAST_IO_FAIL_UNSET &&
|
|
|
aebebb |
+ pp->fast_io_fail != MP_FAST_IO_FAIL_ZERO &&
|
|
|
aebebb |
+ pp->fast_io_fail != MP_FAST_IO_FAIL_OFF) {
|
|
|
aebebb |
/* Check if we need to temporarily increase dev_loss_tmo */
|
|
|
aebebb |
- if ((unsigned int)mpp->fast_io_fail >= tmo) {
|
|
|
aebebb |
+ if ((unsigned int)pp->fast_io_fail >= tmo) {
|
|
|
aebebb |
/* Increase dev_loss_tmo temporarily */
|
|
|
aebebb |
snprintf(value, sizeof(value), "%u",
|
|
|
aebebb |
- (unsigned int)mpp->fast_io_fail + 1);
|
|
|
aebebb |
+ (unsigned int)pp->fast_io_fail + 1);
|
|
|
aebebb |
ret = sysfs_attr_set_value(rport_dev, "dev_loss_tmo",
|
|
|
aebebb |
value, strlen(value));
|
|
|
aebebb |
if (ret <= 0) {
|
|
|
aebebb |
@@ -704,20 +704,20 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
goto out;
|
|
|
aebebb |
}
|
|
|
aebebb |
}
|
|
|
aebebb |
- } else if (mpp->dev_loss > DEFAULT_DEV_LOSS_TMO &&
|
|
|
aebebb |
- mpp->no_path_retry != NO_PATH_RETRY_QUEUE) {
|
|
|
aebebb |
+ } else if (pp->dev_loss > DEFAULT_DEV_LOSS_TMO &&
|
|
|
aebebb |
+ mpp->no_path_retry != NO_PATH_RETRY_QUEUE) {
|
|
|
aebebb |
condlog(2, "%s: limiting dev_loss_tmo to %d, since "
|
|
|
aebebb |
"fast_io_fail is not set",
|
|
|
aebebb |
rport_id, DEFAULT_DEV_LOSS_TMO);
|
|
|
aebebb |
- mpp->dev_loss = DEFAULT_DEV_LOSS_TMO;
|
|
|
aebebb |
+ pp->dev_loss = DEFAULT_DEV_LOSS_TMO;
|
|
|
aebebb |
}
|
|
|
aebebb |
- if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
|
|
|
aebebb |
- if (mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF)
|
|
|
aebebb |
+ if (pp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
|
|
|
aebebb |
+ if (pp->fast_io_fail == MP_FAST_IO_FAIL_OFF)
|
|
|
aebebb |
sprintf(value, "off");
|
|
|
aebebb |
- else if (mpp->fast_io_fail == MP_FAST_IO_FAIL_ZERO)
|
|
|
aebebb |
+ else if (pp->fast_io_fail == MP_FAST_IO_FAIL_ZERO)
|
|
|
aebebb |
sprintf(value, "0");
|
|
|
aebebb |
else
|
|
|
aebebb |
- snprintf(value, 16, "%u", mpp->fast_io_fail);
|
|
|
aebebb |
+ snprintf(value, 16, "%u", pp->fast_io_fail);
|
|
|
aebebb |
ret = sysfs_attr_set_value(rport_dev, "fast_io_fail_tmo",
|
|
|
aebebb |
value, strlen(value));
|
|
|
aebebb |
if (ret <= 0) {
|
|
|
aebebb |
@@ -728,8 +728,8 @@ sysfs_set_rport_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
rport_id, value, -ret);
|
|
|
aebebb |
}
|
|
|
aebebb |
}
|
|
|
aebebb |
- if (mpp->dev_loss != DEV_LOSS_TMO_UNSET) {
|
|
|
aebebb |
- snprintf(value, 16, "%u", mpp->dev_loss);
|
|
|
aebebb |
+ if (pp->dev_loss != DEV_LOSS_TMO_UNSET) {
|
|
|
aebebb |
+ snprintf(value, 16, "%u", pp->dev_loss);
|
|
|
aebebb |
ret = sysfs_attr_set_value(rport_dev, "dev_loss_tmo",
|
|
|
aebebb |
value, strlen(value));
|
|
|
aebebb |
if (ret <= 0) {
|
|
|
aebebb |
@@ -745,15 +745,15 @@ out:
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
static void
|
|
|
aebebb |
-sysfs_set_session_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
+sysfs_set_session_tmo(struct path *pp)
|
|
|
aebebb |
{
|
|
|
aebebb |
struct udev_device *session_dev = NULL;
|
|
|
aebebb |
char session_id[64];
|
|
|
aebebb |
char value[11];
|
|
|
aebebb |
|
|
|
aebebb |
- if (mpp->dev_loss != DEV_LOSS_TMO_UNSET)
|
|
|
aebebb |
+ if (pp->dev_loss != DEV_LOSS_TMO_UNSET)
|
|
|
aebebb |
condlog(3, "%s: ignoring dev_loss_tmo on iSCSI", pp->dev);
|
|
|
aebebb |
- if (mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
|
|
|
aebebb |
+ if (pp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
|
|
|
aebebb |
return;
|
|
|
aebebb |
|
|
|
aebebb |
sprintf(session_id, "session%d", pp->sg_id.transport_id);
|
|
|
aebebb |
@@ -767,15 +767,15 @@ sysfs_set_session_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
condlog(4, "target%d:%d:%d -> %s", pp->sg_id.host_no,
|
|
|
aebebb |
pp->sg_id.channel, pp->sg_id.scsi_id, session_id);
|
|
|
aebebb |
|
|
|
aebebb |
- if (mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
|
|
|
aebebb |
- if (mpp->fast_io_fail == MP_FAST_IO_FAIL_OFF) {
|
|
|
aebebb |
+ if (pp->fast_io_fail != MP_FAST_IO_FAIL_UNSET) {
|
|
|
aebebb |
+ if (pp->fast_io_fail == MP_FAST_IO_FAIL_OFF) {
|
|
|
aebebb |
condlog(3, "%s: can't switch off fast_io_fail_tmo "
|
|
|
aebebb |
"on iSCSI", pp->dev);
|
|
|
aebebb |
- } else if (mpp->fast_io_fail == MP_FAST_IO_FAIL_ZERO) {
|
|
|
aebebb |
+ } else if (pp->fast_io_fail == MP_FAST_IO_FAIL_ZERO) {
|
|
|
aebebb |
condlog(3, "%s: can't set fast_io_fail_tmo to '0'"
|
|
|
aebebb |
"on iSCSI", pp->dev);
|
|
|
aebebb |
} else {
|
|
|
aebebb |
- snprintf(value, 11, "%u", mpp->fast_io_fail);
|
|
|
aebebb |
+ snprintf(value, 11, "%u", pp->fast_io_fail);
|
|
|
aebebb |
if (sysfs_attr_set_value(session_dev, "recovery_tmo",
|
|
|
aebebb |
value, strlen(value)) <= 0) {
|
|
|
aebebb |
condlog(3, "%s: Failed to set recovery_tmo, "
|
|
|
aebebb |
@@ -788,14 +788,14 @@ sysfs_set_session_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
static void
|
|
|
aebebb |
-sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
+sysfs_set_nexus_loss_tmo(struct path *pp)
|
|
|
aebebb |
{
|
|
|
aebebb |
struct udev_device *parent, *sas_dev = NULL;
|
|
|
aebebb |
const char *end_dev_id = NULL;
|
|
|
aebebb |
char value[11];
|
|
|
aebebb |
static const char ed_str[] = "end_device-";
|
|
|
aebebb |
|
|
|
aebebb |
- if (!pp->udev || mpp->dev_loss == DEV_LOSS_TMO_UNSET)
|
|
|
aebebb |
+ if (!pp->udev || pp->dev_loss == DEV_LOSS_TMO_UNSET)
|
|
|
aebebb |
return;
|
|
|
aebebb |
|
|
|
aebebb |
for (parent = udev_device_get_parent(pp->udev);
|
|
|
aebebb |
@@ -822,8 +822,8 @@ sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
condlog(4, "target%d:%d:%d -> %s", pp->sg_id.host_no,
|
|
|
aebebb |
pp->sg_id.channel, pp->sg_id.scsi_id, end_dev_id);
|
|
|
aebebb |
|
|
|
aebebb |
- if (mpp->dev_loss != DEV_LOSS_TMO_UNSET) {
|
|
|
aebebb |
- snprintf(value, 11, "%u", mpp->dev_loss);
|
|
|
aebebb |
+ if (pp->dev_loss != DEV_LOSS_TMO_UNSET) {
|
|
|
aebebb |
+ snprintf(value, 11, "%u", pp->dev_loss);
|
|
|
aebebb |
if (sysfs_attr_set_value(sas_dev, "I_T_nexus_loss_timeout",
|
|
|
aebebb |
value, strlen(value)) <= 0)
|
|
|
aebebb |
condlog(3, "%s: failed to update "
|
|
|
aebebb |
@@ -835,47 +835,59 @@ sysfs_set_nexus_loss_tmo(struct multipath *mpp, struct path *pp)
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
int
|
|
|
aebebb |
-sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint)
|
|
|
aebebb |
+sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp)
|
|
|
aebebb |
{
|
|
|
aebebb |
struct path *pp;
|
|
|
aebebb |
int i;
|
|
|
aebebb |
- unsigned int dev_loss_tmo = mpp->dev_loss;
|
|
|
aebebb |
- struct path *err_path = NULL;
|
|
|
aebebb |
+ unsigned int min_dev_loss = 0;
|
|
|
aebebb |
+ bool warn_dev_loss = false;
|
|
|
aebebb |
+ bool warn_fast_io_fail = false;
|
|
|
aebebb |
|
|
|
aebebb |
if (mpp->no_path_retry > 0) {
|
|
|
aebebb |
uint64_t no_path_retry_tmo =
|
|
|
aebebb |
- (uint64_t)mpp->no_path_retry * checkint;
|
|
|
aebebb |
+ (uint64_t)mpp->no_path_retry * conf->checkint;
|
|
|
aebebb |
|
|
|
aebebb |
if (no_path_retry_tmo > MAX_DEV_LOSS_TMO)
|
|
|
aebebb |
- no_path_retry_tmo = MAX_DEV_LOSS_TMO;
|
|
|
aebebb |
- if (no_path_retry_tmo > dev_loss_tmo)
|
|
|
aebebb |
- dev_loss_tmo = no_path_retry_tmo;
|
|
|
aebebb |
- } else if (mpp->no_path_retry == NO_PATH_RETRY_QUEUE) {
|
|
|
aebebb |
- dev_loss_tmo = MAX_DEV_LOSS_TMO;
|
|
|
aebebb |
- }
|
|
|
aebebb |
- if (mpp->dev_loss != DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
- mpp->dev_loss != dev_loss_tmo) {
|
|
|
aebebb |
- condlog(2, "%s: Using dev_loss_tmo=%u instead of %u because of no_path_retry setting",
|
|
|
aebebb |
- mpp->alias, dev_loss_tmo, mpp->dev_loss);
|
|
|
aebebb |
- mpp->dev_loss = dev_loss_tmo;
|
|
|
aebebb |
- }
|
|
|
aebebb |
- if (mpp->dev_loss != DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
- mpp->fast_io_fail != MP_FAST_IO_FAIL_UNSET &&
|
|
|
aebebb |
- (unsigned int)mpp->fast_io_fail >= mpp->dev_loss) {
|
|
|
aebebb |
- condlog(3, "%s: turning off fast_io_fail (%d is not smaller than dev_loss_tmo)",
|
|
|
aebebb |
- mpp->alias, mpp->fast_io_fail);
|
|
|
aebebb |
- mpp->fast_io_fail = MP_FAST_IO_FAIL_OFF;
|
|
|
aebebb |
- }
|
|
|
aebebb |
- if (mpp->dev_loss == DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
- mpp->fast_io_fail == MP_FAST_IO_FAIL_UNSET &&
|
|
|
aebebb |
- mpp->eh_deadline == EH_DEADLINE_UNSET)
|
|
|
aebebb |
- return 0;
|
|
|
aebebb |
+ min_dev_loss = MAX_DEV_LOSS_TMO;
|
|
|
aebebb |
+ else
|
|
|
aebebb |
+ min_dev_loss = no_path_retry_tmo;
|
|
|
aebebb |
+ } else if (mpp->no_path_retry == NO_PATH_RETRY_QUEUE)
|
|
|
aebebb |
+ min_dev_loss = MAX_DEV_LOSS_TMO;
|
|
|
aebebb |
|
|
|
aebebb |
vector_foreach_slot(mpp->paths, pp, i) {
|
|
|
aebebb |
- if (pp->bus != SYSFS_BUS_SCSI) {
|
|
|
aebebb |
- if (!err_path)
|
|
|
aebebb |
- err_path = pp;
|
|
|
aebebb |
+ select_fast_io_fail(conf, pp);
|
|
|
aebebb |
+ select_dev_loss(conf, pp);
|
|
|
aebebb |
+ select_eh_deadline(conf, pp);
|
|
|
aebebb |
+
|
|
|
aebebb |
+ if (pp->dev_loss == DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
+ pp->fast_io_fail == MP_FAST_IO_FAIL_UNSET &&
|
|
|
aebebb |
+ pp->eh_deadline == EH_DEADLINE_UNSET)
|
|
|
aebebb |
+ continue;
|
|
|
aebebb |
+
|
|
|
aebebb |
+ if (pp->bus != SYSFS_BUS_SCSI)
|
|
|
aebebb |
+ continue;
|
|
|
aebebb |
+
|
|
|
aebebb |
+ sysfs_set_eh_deadline(pp);
|
|
|
aebebb |
+
|
|
|
aebebb |
+ if (pp->dev_loss == DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
+ pp->fast_io_fail == MP_FAST_IO_FAIL_UNSET)
|
|
|
aebebb |
continue;
|
|
|
aebebb |
+
|
|
|
aebebb |
+ if (pp->sg_id.proto_id != SCSI_PROTOCOL_FCP &&
|
|
|
aebebb |
+ pp->sg_id.proto_id != SCSI_PROTOCOL_ISCSI &&
|
|
|
aebebb |
+ pp->sg_id.proto_id != SCSI_PROTOCOL_SAS)
|
|
|
aebebb |
+ continue;
|
|
|
aebebb |
+
|
|
|
aebebb |
+ if (pp->dev_loss != DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
+ pp->dev_loss < min_dev_loss) {
|
|
|
aebebb |
+ warn_dev_loss = true;
|
|
|
aebebb |
+ pp->dev_loss = min_dev_loss;
|
|
|
aebebb |
+ }
|
|
|
aebebb |
+ if (pp->dev_loss != DEV_LOSS_TMO_UNSET &&
|
|
|
aebebb |
+ pp->fast_io_fail > 0 &&
|
|
|
aebebb |
+ (unsigned int)pp->fast_io_fail >= pp->dev_loss) {
|
|
|
aebebb |
+ warn_fast_io_fail = true;
|
|
|
aebebb |
+ pp->fast_io_fail = MP_FAST_IO_FAIL_OFF;
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
switch (pp->sg_id.proto_id) {
|
|
|
aebebb |
@@ -883,25 +895,21 @@ sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint)
|
|
|
aebebb |
sysfs_set_rport_tmo(mpp, pp);
|
|
|
aebebb |
break;
|
|
|
aebebb |
case SCSI_PROTOCOL_ISCSI:
|
|
|
aebebb |
- sysfs_set_session_tmo(mpp, pp);
|
|
|
aebebb |
+ sysfs_set_session_tmo(pp);
|
|
|
aebebb |
break;
|
|
|
aebebb |
case SCSI_PROTOCOL_SAS:
|
|
|
aebebb |
- sysfs_set_nexus_loss_tmo(mpp, pp);
|
|
|
aebebb |
+ sysfs_set_nexus_loss_tmo(pp);
|
|
|
aebebb |
break;
|
|
|
aebebb |
default:
|
|
|
aebebb |
- if (!err_path)
|
|
|
aebebb |
- err_path = pp;
|
|
|
aebebb |
+ break;
|
|
|
aebebb |
}
|
|
|
aebebb |
- sysfs_set_eh_deadline(mpp, pp);
|
|
|
aebebb |
- }
|
|
|
aebebb |
-
|
|
|
aebebb |
- if (err_path) {
|
|
|
aebebb |
- STRBUF_ON_STACK(proto_buf);
|
|
|
aebebb |
-
|
|
|
aebebb |
- snprint_path_protocol(&proto_buf, err_path);
|
|
|
aebebb |
- condlog(2, "%s: setting dev_loss_tmo is unsupported for protocol %s",
|
|
|
aebebb |
- mpp->alias, get_strbuf_str(&proto_buf));
|
|
|
aebebb |
}
|
|
|
aebebb |
+ if (warn_dev_loss)
|
|
|
aebebb |
+ condlog(2, "%s: Raising dev_loss_tmo to %u because of no_path_retry setting",
|
|
|
aebebb |
+ mpp->alias, min_dev_loss);
|
|
|
aebebb |
+ if (warn_fast_io_fail)
|
|
|
aebebb |
+ condlog(3, "%s: turning off fast_io_fail (not smaller than dev_loss_tmo)",
|
|
|
aebebb |
+ mpp->alias);
|
|
|
aebebb |
return 0;
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
diff --git a/libmultipath/discovery.h b/libmultipath/discovery.h
|
|
|
aebebb |
index a5446b4d..b6eea258 100644
|
|
|
aebebb |
--- a/libmultipath/discovery.h
|
|
|
aebebb |
+++ b/libmultipath/discovery.h
|
|
|
aebebb |
@@ -42,7 +42,7 @@ int alloc_path_with_pathinfo (struct config *conf, struct udev_device *udevice,
|
|
|
aebebb |
int store_pathinfo (vector pathvec, struct config *conf,
|
|
|
aebebb |
struct udev_device *udevice, int flag,
|
|
|
aebebb |
struct path **pp_ptr);
|
|
|
aebebb |
-int sysfs_set_scsi_tmo (struct multipath *mpp, unsigned int checkint);
|
|
|
aebebb |
+int sysfs_set_scsi_tmo (struct config *conf, struct multipath *mpp);
|
|
|
aebebb |
int sysfs_get_timeout(const struct path *pp, unsigned int *timeout);
|
|
|
aebebb |
int sysfs_get_host_pci_name(const struct path *pp, char *pci_name);
|
|
|
aebebb |
int sysfs_get_iscsi_ip_address(const struct path *pp, char *ip_address);
|
|
|
aebebb |
diff --git a/libmultipath/propsel.c b/libmultipath/propsel.c
|
|
|
aebebb |
index 677ab9e1..f146fe64 100644
|
|
|
aebebb |
--- a/libmultipath/propsel.c
|
|
|
aebebb |
+++ b/libmultipath/propsel.c
|
|
|
aebebb |
@@ -770,53 +770,53 @@ int select_minio(struct config *conf, struct multipath *mp)
|
|
|
aebebb |
return select_minio_bio(conf, mp);
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
-int select_fast_io_fail(struct config *conf, struct multipath *mp)
|
|
|
aebebb |
+int select_fast_io_fail(struct config *conf, struct path *pp)
|
|
|
aebebb |
{
|
|
|
aebebb |
const char *origin;
|
|
|
aebebb |
STRBUF_ON_STACK(buff);
|
|
|
aebebb |
|
|
|
aebebb |
- mp_set_ovr(fast_io_fail);
|
|
|
aebebb |
- mp_set_hwe(fast_io_fail);
|
|
|
aebebb |
- mp_set_conf(fast_io_fail);
|
|
|
aebebb |
- mp_set_default(fast_io_fail, DEFAULT_FAST_IO_FAIL);
|
|
|
aebebb |
+ pp_set_ovr(fast_io_fail);
|
|
|
aebebb |
+ pp_set_hwe(fast_io_fail);
|
|
|
aebebb |
+ pp_set_conf(fast_io_fail);
|
|
|
aebebb |
+ pp_set_default(fast_io_fail, DEFAULT_FAST_IO_FAIL);
|
|
|
aebebb |
out:
|
|
|
aebebb |
- print_undef_off_zero(&buff, mp->fast_io_fail);
|
|
|
aebebb |
- condlog(3, "%s: fast_io_fail_tmo = %s %s", mp->alias,
|
|
|
aebebb |
+ print_undef_off_zero(&buff, pp->fast_io_fail);
|
|
|
aebebb |
+ condlog(3, "%s: fast_io_fail_tmo = %s %s", pp->dev,
|
|
|
aebebb |
get_strbuf_str(&buff), origin);
|
|
|
aebebb |
return 0;
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
-int select_dev_loss(struct config *conf, struct multipath *mp)
|
|
|
aebebb |
+int select_dev_loss(struct config *conf, struct path *pp)
|
|
|
aebebb |
{
|
|
|
aebebb |
const char *origin;
|
|
|
aebebb |
STRBUF_ON_STACK(buff);
|
|
|
aebebb |
|
|
|
aebebb |
- mp_set_ovr(dev_loss);
|
|
|
aebebb |
- mp_set_hwe(dev_loss);
|
|
|
aebebb |
- mp_set_conf(dev_loss);
|
|
|
aebebb |
- mp->dev_loss = DEV_LOSS_TMO_UNSET;
|
|
|
aebebb |
+ pp_set_ovr(dev_loss);
|
|
|
aebebb |
+ pp_set_hwe(dev_loss);
|
|
|
aebebb |
+ pp_set_conf(dev_loss);
|
|
|
aebebb |
+ pp->dev_loss = DEV_LOSS_TMO_UNSET;
|
|
|
aebebb |
return 0;
|
|
|
aebebb |
out:
|
|
|
aebebb |
- print_dev_loss(&buff, mp->dev_loss);
|
|
|
aebebb |
- condlog(3, "%s: dev_loss_tmo = %s %s", mp->alias,
|
|
|
aebebb |
+ print_dev_loss(&buff, pp->dev_loss);
|
|
|
aebebb |
+ condlog(3, "%s: dev_loss_tmo = %s %s", pp->dev,
|
|
|
aebebb |
get_strbuf_str(&buff), origin);
|
|
|
aebebb |
return 0;
|
|
|
aebebb |
}
|
|
|
aebebb |
|
|
|
aebebb |
-int select_eh_deadline(struct config *conf, struct multipath *mp)
|
|
|
aebebb |
+int select_eh_deadline(struct config *conf, struct path *pp)
|
|
|
aebebb |
{
|
|
|
aebebb |
const char *origin;
|
|
|
aebebb |
STRBUF_ON_STACK(buff);
|
|
|
aebebb |
|
|
|
aebebb |
- mp_set_ovr(eh_deadline);
|
|
|
aebebb |
- mp_set_hwe(eh_deadline);
|
|
|
aebebb |
- mp_set_conf(eh_deadline);
|
|
|
aebebb |
- mp->eh_deadline = EH_DEADLINE_UNSET;
|
|
|
aebebb |
+ pp_set_ovr(eh_deadline);
|
|
|
aebebb |
+ pp_set_hwe(eh_deadline);
|
|
|
aebebb |
+ pp_set_conf(eh_deadline);
|
|
|
aebebb |
+ pp->eh_deadline = EH_DEADLINE_UNSET;
|
|
|
aebebb |
/* not changing sysfs in default cause, so don't print anything */
|
|
|
aebebb |
return 0;
|
|
|
aebebb |
out:
|
|
|
aebebb |
- print_undef_off_zero(&buff, mp->eh_deadline);
|
|
|
aebebb |
- condlog(3, "%s: eh_deadline = %s %s", mp->alias,
|
|
|
aebebb |
+ print_undef_off_zero(&buff, pp->eh_deadline);
|
|
|
aebebb |
+ condlog(3, "%s: eh_deadline = %s %s", pp->dev,
|
|
|
aebebb |
get_strbuf_str(&buff), origin);
|
|
|
aebebb |
return 0;
|
|
|
aebebb |
}
|
|
|
aebebb |
diff --git a/libmultipath/propsel.h b/libmultipath/propsel.h
|
|
|
aebebb |
index 72a7e33c..152ca44c 100644
|
|
|
aebebb |
--- a/libmultipath/propsel.h
|
|
|
aebebb |
+++ b/libmultipath/propsel.h
|
|
|
aebebb |
@@ -16,9 +16,9 @@ int select_minio(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
int select_mode(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
int select_uid(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
int select_gid(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
-int select_fast_io_fail(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
-int select_dev_loss(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
-int select_eh_deadline(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
+int select_fast_io_fail(struct config *conf, struct path *pp);
|
|
|
aebebb |
+int select_dev_loss(struct config *conf, struct path *pp);
|
|
|
aebebb |
+int select_eh_deadline(struct config *conf, struct path *pp);
|
|
|
aebebb |
int select_reservation_key(struct config *conf, struct multipath *mp);
|
|
|
aebebb |
int select_retain_hwhandler (struct config *conf, struct multipath * mp);
|
|
|
aebebb |
int select_detect_prio(struct config *conf, struct path * pp);
|
|
|
aebebb |
diff --git a/libmultipath/structs.c b/libmultipath/structs.c
|
|
|
aebebb |
index d20e1eea..acd4cbeb 100644
|
|
|
aebebb |
--- a/libmultipath/structs.c
|
|
|
aebebb |
+++ b/libmultipath/structs.c
|
|
|
aebebb |
@@ -246,7 +246,6 @@ alloc_multipath (void)
|
|
|
aebebb |
mpp->bestpg = 1;
|
|
|
aebebb |
mpp->mpcontext = NULL;
|
|
|
aebebb |
mpp->no_path_retry = NO_PATH_RETRY_UNDEF;
|
|
|
aebebb |
- mpp->fast_io_fail = MP_FAST_IO_FAIL_UNSET;
|
|
|
aebebb |
dm_multipath_to_gen(mpp)->ops = &dm_gen_multipath_ops;
|
|
|
aebebb |
}
|
|
|
aebebb |
return mpp;
|
|
|
aebebb |
diff --git a/libmultipath/structs.h b/libmultipath/structs.h
|
|
|
aebebb |
index 618ff4fb..8a07d470 100644
|
|
|
aebebb |
--- a/libmultipath/structs.h
|
|
|
aebebb |
+++ b/libmultipath/structs.h
|
|
|
aebebb |
@@ -340,6 +340,9 @@ struct path {
|
|
|
aebebb |
int marginal;
|
|
|
aebebb |
int vpd_vendor_id;
|
|
|
aebebb |
int recheck_wwid;
|
|
|
aebebb |
+ int fast_io_fail;
|
|
|
aebebb |
+ unsigned int dev_loss;
|
|
|
aebebb |
+ int eh_deadline;
|
|
|
aebebb |
/* configlet pointers */
|
|
|
aebebb |
vector hwe;
|
|
|
aebebb |
struct gen_path generic_path;
|
|
|
aebebb |
@@ -367,7 +370,6 @@ struct multipath {
|
|
|
aebebb |
int minio;
|
|
|
aebebb |
int flush_on_last_del;
|
|
|
aebebb |
int attribute_flags;
|
|
|
aebebb |
- int fast_io_fail;
|
|
|
aebebb |
int retain_hwhandler;
|
|
|
aebebb |
int deferred_remove;
|
|
|
aebebb |
bool in_recovery;
|
|
|
aebebb |
@@ -385,8 +387,6 @@ struct multipath {
|
|
|
aebebb |
int needs_paths_uevent;
|
|
|
aebebb |
int ghost_delay;
|
|
|
aebebb |
int ghost_delay_tick;
|
|
|
aebebb |
- unsigned int dev_loss;
|
|
|
aebebb |
- int eh_deadline;
|
|
|
aebebb |
uid_t uid;
|
|
|
aebebb |
gid_t gid;
|
|
|
aebebb |
mode_t mode;
|