Commit d539a871 authored by Benjamin Marzinski's avatar Benjamin Marzinski Committed by Martin K. Petersen

scsi: scsi_transport_fc: Allow setting rport state to current state

The only input fc_rport_set_marginal_state() currently accepts is
"Marginal" when port_state is "Online", and "Online" when the port_state
is "Marginal". It should also allow setting port_state to its current
state, either "Marginal or "Online".
Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
Link: https://lore.kernel.org/r/20240917230643.966768-1-bmarzins@redhat.comReviewed-by: default avatarEwan D. Milne <emilne@redhat.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 9023ed8d
...@@ -1250,7 +1250,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev, ...@@ -1250,7 +1250,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,
*/ */
if (rport->port_state == FC_PORTSTATE_ONLINE) if (rport->port_state == FC_PORTSTATE_ONLINE)
rport->port_state = port_state; rport->port_state = port_state;
else else if (port_state != rport->port_state)
return -EINVAL; return -EINVAL;
} else if (port_state == FC_PORTSTATE_ONLINE) { } else if (port_state == FC_PORTSTATE_ONLINE) {
/* /*
...@@ -1260,7 +1260,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev, ...@@ -1260,7 +1260,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,
*/ */
if (rport->port_state == FC_PORTSTATE_MARGINAL) if (rport->port_state == FC_PORTSTATE_MARGINAL)
rport->port_state = port_state; rport->port_state = port_state;
else else if (port_state != rport->port_state)
return -EINVAL; return -EINVAL;
} else } else
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment