scsi: scsi_transport_fc: allow setting rport state to current state
PATCH 1/1 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".
--- drivers/scsi/scsi_transport_fc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/scsi_transport_fc.c +2 -2
@@ -1255,7 +1255,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,*/ if (rport->port_state ==FC_PORTSTATE_ONLINE ) rport->port_state = port_state; -else +else if (port_state != rport->port_state)return -EINVAL ; }else if (port_state ==FC_PORTSTATE_ONLINE ) {/*
@@ -1265,7 +1265,7 @@ static ssize_t fc_rport_set_marginal_state(struct device *dev,*/ if (rport->port_state ==FC_PORTSTATE_MARGINAL ) rport->port_state = port_state; -else +else if (port_state != rport->port_state)return -EINVAL ; }else return -EINVAL ;
Signature · 1 line
2.45.0
Quoted 8 lines · Benjamin Marzinski
The only input
fc_rport_set_marginal_state()currently accepts is "Marginal" whenport_stateis "Online", and "Online" when theport_stateis "Marginal". It should also allow settingport_stateto its current state, either "Marginal or "Online".Signed-off-by Benjamin Marzinski <[email protected]>---
Both scsi_host_set_state() and scsi_device_set_state() work this way, so this seems quite reasonable.
Martin K. Petersen
AppliedQuoted 6 lines · Benjamin Marzinski
The only input
fc_rport_set_marginal_state()currently accepts is "Marginal" whenport_stateis "Online", and "Online" when theport_stateis "Marginal". It should also allow settingport_stateto its current state, either "Marginal or "Online".
Applied to 6.12/scsi-fixes, thanks!
[1/1] scsi: scsi_transport_fc: allow setting rport state to current state
https://git.kernel.org/mkp/scsi/c/d539a871ae47
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering