Skip to content

Commit

Permalink
[SCSI] make error handling more robust in the face of reservations
Browse files Browse the repository at this point in the history
commit 5f91bb0
Author: Michael Reed <mdr@sgi.com>
Date:   Mon Aug 10 11:59:28 2009 -0500

    [SCSI] reservation conflict after timeout causes device to be taken offline

Flipped us from always returning failed to always returning success in
the name of fixing the problem where reservation conflict returns from
test unit ready cause the device always to be taken offline.
Unfortuantely, it also introduced a problem whereby for commands other
than test unit ready, the eh dispatcher thinks they succeeded when
reservation conflict is returned, whereas in reality they failed.  Fix
this by only returning success for the test unit ready case.

Signed-off-by: James Bottomley <James.Bottomley@suse.de>
  • Loading branch information
James Bottomley authored and James Bottomley committed Aug 11, 2010
1 parent 3deee42 commit 67110df
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/scsi/scsi_error.c
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,12 @@ static int scsi_eh_completed_normally(struct scsi_cmnd *scmd)
*/
return SUCCESS;
case RESERVATION_CONFLICT:
/*
* let issuer deal with this, it could be just fine
*/
return SUCCESS;
if (scmd->cmnd[0] == TEST_UNIT_READY)
/* it is a success, we probed the device and
* found it */
return SUCCESS;
/* otherwise, we failed to send the command */
return FAILED;
case QUEUE_FULL:
scsi_handle_queue_full(scmd->device);
/* fall through */
Expand Down

0 comments on commit 67110df

Please sign in to comment.