mbox series

[0/3] libfc: fixup command abort handling

Message ID 20231129165832.224100-1-hare@kernel.org
Headers show
Series libfc: fixup command abort handling | expand

Message

Hannes Reinecke Nov. 29, 2023, 4:58 p.m. UTC
From: Hannes Reinecke <hare@suse.de>

Hi all,

when testing command timeout with the help of XDP I found
that scsi_try_to_abort_cmd() would always return 'SUCCESS'
for FCoE, even if no commands could be sent over the wire.
Which is not only surprising, but also can lead to data
corruption as commands were never aborted.
Root cause was that aborts had been sent twice, once
from FC error recovery and once from SCSI EH, with the
former inducing the latter to assume that the command
was already aborted.

As usual, comments and reviews are welcome.

Hannes Reinecke (3):
  libfc: don't schedule abort twice
  libfc: Fixup timeout error in fc_fcp_rec_error()
  libfc: map FC_TIMED_OUT to DID_TIME_OUT

 drivers/scsi/libfc/fc_fcp.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)

Comments

Martin K. Petersen Dec. 14, 2023, 4:29 a.m. UTC | #1
On Wed, 29 Nov 2023 17:58:29 +0100, hare@kernel.org wrote:

> when testing command timeout with the help of XDP I found
> that scsi_try_to_abort_cmd() would always return 'SUCCESS'
> for FCoE, even if no commands could be sent over the wire.
> Which is not only surprising, but also can lead to data
> corruption as commands were never aborted.
> Root cause was that aborts had been sent twice, once
> from FC error recovery and once from SCSI EH, with the
> former inducing the latter to assume that the command
> was already aborted.
> 
> [...]

Applied to 6.8/scsi-queue, thanks!

[1/3] libfc: don't schedule abort twice
      https://git.kernel.org/mkp/scsi/c/b57c4db5d23b
[2/3] libfc: Fixup timeout error in fc_fcp_rec_error()
      https://git.kernel.org/mkp/scsi/c/53122a49f497
[3/3] libfc: map FC_TIMED_OUT to DID_TIME_OUT
      https://git.kernel.org/mkp/scsi/c/be40572c22cc