|
@@ -2042,6 +2042,7 @@ iscsi_alloc_session(struct Scsi_Host *shost, struct iscsi_transport *transport,
|
|
session->transport = transport;
|
|
session->transport = transport;
|
|
session->creator = -1;
|
|
session->creator = -1;
|
|
session->recovery_tmo = 120;
|
|
session->recovery_tmo = 120;
|
|
|
|
+ session->recovery_tmo_sysfs_override = false;
|
|
session->state = ISCSI_SESSION_FREE;
|
|
session->state = ISCSI_SESSION_FREE;
|
|
INIT_DELAYED_WORK(&session->recovery_work, session_recovery_timedout);
|
|
INIT_DELAYED_WORK(&session->recovery_work, session_recovery_timedout);
|
|
INIT_LIST_HEAD(&session->sess_list);
|
|
INIT_LIST_HEAD(&session->sess_list);
|
|
@@ -2786,7 +2787,8 @@ iscsi_set_param(struct iscsi_transport *transport, struct iscsi_uevent *ev)
|
|
switch (ev->u.set_param.param) {
|
|
switch (ev->u.set_param.param) {
|
|
case ISCSI_PARAM_SESS_RECOVERY_TMO:
|
|
case ISCSI_PARAM_SESS_RECOVERY_TMO:
|
|
sscanf(data, "%d", &value);
|
|
sscanf(data, "%d", &value);
|
|
- session->recovery_tmo = value;
|
|
|
|
|
|
+ if (!session->recovery_tmo_sysfs_override)
|
|
|
|
+ session->recovery_tmo = value;
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
err = transport->set_param(conn, ev->u.set_param.param,
|
|
err = transport->set_param(conn, ev->u.set_param.param,
|
|
@@ -4049,13 +4051,15 @@ store_priv_session_##field(struct device *dev, \
|
|
if ((session->state == ISCSI_SESSION_FREE) || \
|
|
if ((session->state == ISCSI_SESSION_FREE) || \
|
|
(session->state == ISCSI_SESSION_FAILED)) \
|
|
(session->state == ISCSI_SESSION_FAILED)) \
|
|
return -EBUSY; \
|
|
return -EBUSY; \
|
|
- if (strncmp(buf, "off", 3) == 0) \
|
|
|
|
|
|
+ if (strncmp(buf, "off", 3) == 0) { \
|
|
session->field = -1; \
|
|
session->field = -1; \
|
|
- else { \
|
|
|
|
|
|
+ session->field##_sysfs_override = true; \
|
|
|
|
+ } else { \
|
|
val = simple_strtoul(buf, &cp, 0); \
|
|
val = simple_strtoul(buf, &cp, 0); \
|
|
if (*cp != '\0' && *cp != '\n') \
|
|
if (*cp != '\0' && *cp != '\n') \
|
|
return -EINVAL; \
|
|
return -EINVAL; \
|
|
session->field = val; \
|
|
session->field = val; \
|
|
|
|
+ session->field##_sysfs_override = true; \
|
|
} \
|
|
} \
|
|
return count; \
|
|
return count; \
|
|
}
|
|
}
|
|
@@ -4066,6 +4070,7 @@ store_priv_session_##field(struct device *dev, \
|
|
static ISCSI_CLASS_ATTR(priv_sess, field, S_IRUGO | S_IWUSR, \
|
|
static ISCSI_CLASS_ATTR(priv_sess, field, S_IRUGO | S_IWUSR, \
|
|
show_priv_session_##field, \
|
|
show_priv_session_##field, \
|
|
store_priv_session_##field)
|
|
store_priv_session_##field)
|
|
|
|
+
|
|
iscsi_priv_session_rw_attr(recovery_tmo, "%d");
|
|
iscsi_priv_session_rw_attr(recovery_tmo, "%d");
|
|
|
|
|
|
static struct attribute *iscsi_session_attrs[] = {
|
|
static struct attribute *iscsi_session_attrs[] = {
|