On 8/23/23 19:46, Shinichiro Kawasaki wrote:
On Aug 23, 2023 / 13:57, Bart Van Assche wrote:
After scmd_eh_abort_handler() has called the SCSI LLD eh_abort_handler
callback, it performs one of the following actions:
* Call scsi_queue_insert().
* Call scsi_finish_command().
* Call scsi_eh_scmd_add().
Hence, SCSI abort handlers must not call scsi_done(). Otherwise all
the above actions would trigger a use-after-free. Hence remove the
scsi_done() call from srp_abort(). Keep the srp_free_req() call
before returning SUCCESS because we may not see the command again if
SUCCESS is returned.
Cc: Bob Pearson <rpearsonhpe@xxxxxxxxx>
Cc: Shinichiro Kawasaki <shinichiro.kawasaki@xxxxxxx>
Fixes: d8536670916a ("IB/srp: Avoid having aborted requests hang")
Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>
Thanks Bart. Do you think this patch fixes the hangs at blktests srp/002 and
srp/011? I tried this patch and still see the hang at srp/002, but the hang at
srp/011 looks disappearing.
I have not yet tried to verify whether the above patch affects any blktests.
The above patch is a patch that I developed a few weeks ago but that had not
yet been published on the linux-rdma mailing list.
Thanks,
Bart.