RE: Debugging scsi abort handling ?

Elliott, Robert (Server Storage)
2014-08-29T04:54:42Z

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org [mailto:linux-scsi-
> owner@vger.kernel.org] On Behalf Of Finn Thain
> Sent: Thursday, August 28, 2014 11:37 PM
> To: James Bottomley
> Cc: Hans de Goede; Hannes Reinecke; Paolo Bonzini; Bart Van Assche; SCSI
> development list
> Subject: Re: Debugging scsi abort handling ?
>
>
> On Thu, 28 Aug 2014, James Bottomley wrote:
...
> Another subtlety is that the abort handler is apparently expected to
> perform autosense for an aborted command (or wait for that to happen
> normally) and only return after this has taken place (rather than
> immediately killing the command).

Sending a REQUEST SENSE and expecting to get sense data for another
command only works in protocols like parallel SCSI that supported
contingent allegiance - a feature that is obsolete in the
SCSI architecture model. In modern SCSI protocols, that command
just returns "polled sense data" like the status of background tasks,
not sense data related to any particular command.

James posted a patch a while back that bypasses sending that
command and misinterpreting the result.

> > You can get the situation where we try to abort (or do other EH) on a
> > command you think you've already completed, but you just return
> > success for that.
>
> In general, the LLD cannot distinguish between a command previously
> completed and a command it has never encountered. But it seems that
> eh_abort_handler() should return SUCCESS either way.
>
> That seems like an unintuitive interpretation of "successfully aborted"
> so it perhaps this needs to be documented too. The drivers I've looked at
> (esp_scsi and ncr5380) don't do this. If asked to abort some command
> which they completed in the past, they would return failure.

That is how the SCSI architecture model defines ABORT TASK,
so shouldn't be too surprising here.

I wouldn't focus too much on those old parallel SCSI drivers; SAS, Fibre
Channel, iSCSI, and SRP drivers are better examples now.

---
Rob Elliott HP Server Storage