Skip to content

Commit d539a87

Browse files
bmarzinsmartinkpetersen
authored andcommitted
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: Benjamin Marzinski <bmarzins@redhat.com> Link: https://lore.kernel.org/r/20240917230643.966768-1-bmarzins@redhat.com Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 9023ed8 commit d539a87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/scsi/scsi_transport_fc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,7 +1250,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,
12501250
*/
12511251
if (rport->port_state == FC_PORTSTATE_ONLINE)
12521252
rport->port_state = port_state;
1253-
else
1253+
else if (port_state != rport->port_state)
12541254
return -EINVAL;
12551255
} else if (port_state == FC_PORTSTATE_ONLINE) {
12561256
/*
@@ -1260,7 +1260,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,
12601260
*/
12611261
if (rport->port_state == FC_PORTSTATE_MARGINAL)
12621262
rport->port_state = port_state;
1263-
else
1263+
else if (port_state != rport->port_state)
12641264
return -EINVAL;
12651265
} else
12661266
return -EINVAL;

0 commit comments

Comments
 (0)