mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 18:51:27 +00:00
qla2xxx: Set the SCSI command result before calling the command done
This patch tries to address race condition between abort handler and completion handler. When scsi command result is set by both abort and completion handler, scsi_done() is only called after refcount on SRB structure goes to zero. The abort handler sets this result prematurely even when the refcount is non-zero value. Fix this by setting SCSI cmd->result before scsi_done() is called. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8214 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -805,8 +805,6 @@ qla2x00_sp_compl(void *ptr, int res)
|
||||
srb_t *sp = ptr;
|
||||
struct scsi_cmnd *cmd = GET_CMD_SP(sp);
|
||||
|
||||
cmd->result = res;
|
||||
|
||||
if (WARN_ON(atomic_read(&sp->ref_count) == 0))
|
||||
return;
|
||||
|
||||
@@ -814,6 +812,7 @@ qla2x00_sp_compl(void *ptr, int res)
|
||||
return;
|
||||
|
||||
sp->free(sp);
|
||||
cmd->result = res;
|
||||
cmd->scsi_done(cmd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user