aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorJoseph Gruher <joseph.r.gruher@intel.com>2011-01-05 16:00:22 -0500
committerJames Bottomley <James.Bottomley@suse.de>2011-01-24 12:13:25 -0500
commit9349923d3f83bea1ba287a851c3f6737c6513039 (patch)
tree50dac8d5fc4834a80da488e52c3e8fb6c702df15 /drivers/scsi/device_handler
parented0f36bc5719b25659b637f80ceea85494b84502 (diff)
[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>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index ba3c6491929f..9bd2c8a69a41 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -253,13 +253,15 @@ static void stpg_endio(struct request *req, int error)
253{ 253{
254 struct alua_dh_data *h = req->end_io_data; 254 struct alua_dh_data *h = req->end_io_data;
255 struct scsi_sense_hdr sense_hdr; 255 struct scsi_sense_hdr sense_hdr;
256 unsigned err = SCSI_DH_IO; 256 unsigned err = SCSI_DH_OK;
257 257
258 if (error || host_byte(req->errors) != DID_OK || 258 if (error || host_byte(req->errors) != DID_OK ||
259 msg_byte(req->errors) != COMMAND_COMPLETE) 259 msg_byte(req->errors) != COMMAND_COMPLETE) {
260 err = SCSI_DH_IO;
260 goto done; 261 goto done;
262 }
261 263
262 if (err == SCSI_DH_IO && h->senselen > 0) { 264 if (h->senselen > 0) {
263 err = scsi_normalize_sense(h->sense, SCSI_SENSE_BUFFERSIZE, 265 err = scsi_normalize_sense(h->sense, SCSI_SENSE_BUFFERSIZE,
264 &sense_hdr); 266 &sense_hdr);
265 if (!err) { 267 if (!err) {