[SCSI] scsi_dh_alua: fix stpg_endio group state reporting
Initialize stpg_endio() 'err' to SCSI_DH_OK and only change it to SCSI_DH_IO accordingly. This allows the switching of target group state to be properly reported when no error has occurred. Signed-off-by: Joseph Gruher <joseph.r.gruher@intel.com> Signed-off-by: Ilgu Hong <ilgu.hong@promise.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
parent
ed0f36bc57
commit
9349923d3f
1 changed files with 5 additions and 3 deletions
|
@ -253,13 +253,15 @@ static void stpg_endio(struct request *req, int error)
|
||||||
{
|
{
|
||||||
struct alua_dh_data *h = req->end_io_data;
|
struct alua_dh_data *h = req->end_io_data;
|
||||||
struct scsi_sense_hdr sense_hdr;
|
struct scsi_sense_hdr sense_hdr;
|
||||||
unsigned err = SCSI_DH_IO;
|
unsigned err = SCSI_DH_OK;
|
||||||
|
|
||||||
if (error || host_byte(req->errors) != DID_OK ||
|
if (error || host_byte(req->errors) != DID_OK ||
|
||||||
msg_byte(req->errors) != COMMAND_COMPLETE)
|
msg_byte(req->errors) != COMMAND_COMPLETE) {
|
||||||
|
err = SCSI_DH_IO;
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
if (err == SCSI_DH_IO && h->senselen > 0) {
|
if (h->senselen > 0) {
|
||||||
err = scsi_normalize_sense(h->sense, SCSI_SENSE_BUFFERSIZE,
|
err = scsi_normalize_sense(h->sense, SCSI_SENSE_BUFFERSIZE,
|
||||||
&sense_hdr);
|
&sense_hdr);
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
|
Loading…
Reference in a new issue