Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360270
b: refs/heads/master
c: 6781209
h: refs/heads/master
v: v3
  • Loading branch information
K. Y. Srinivasan authored and James Bottomley committed Feb 24, 2013
1 parent 3829de7 commit 3948f55
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c50bd4481707cef2a81c648f6e28e7a0a5f21129
refs/heads/master: 6781209e7621a900fe83b3c09b1a02ec1a947c75
31 changes: 31 additions & 0 deletions trunk/drivers/scsi/storvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ enum storvsc_request_type {
#define SRB_STATUS_AUTOSENSE_VALID 0x80
#define SRB_STATUS_INVALID_LUN 0x20
#define SRB_STATUS_SUCCESS 0x01
#define SRB_STATUS_ABORTED 0x02
#define SRB_STATUS_ERROR 0x04

/*
Expand Down Expand Up @@ -295,6 +296,25 @@ struct storvsc_scan_work {
uint lun;
};

static void storvsc_device_scan(struct work_struct *work)
{
struct storvsc_scan_work *wrk;
uint lun;
struct scsi_device *sdev;

wrk = container_of(work, struct storvsc_scan_work, work);
lun = wrk->lun;

sdev = scsi_device_lookup(wrk->host, 0, 0, lun);
if (!sdev)
goto done;
scsi_rescan_device(&sdev->sdev_gendev);
scsi_device_put(sdev);

done:
kfree(wrk);
}

static void storvsc_bus_scan(struct work_struct *work)
{
struct storvsc_scan_work *wrk;
Expand Down Expand Up @@ -791,7 +811,18 @@ static void storvsc_handle_error(struct vmscsi_request *vm_srb,
do_work = true;
process_err_fn = storvsc_remove_lun;
break;
case (SRB_STATUS_ABORTED | SRB_STATUS_AUTOSENSE_VALID):
if ((asc == 0x2a) && (ascq == 0x9)) {
do_work = true;
process_err_fn = storvsc_device_scan;
/*
* Retry the I/O that trigerred this.
*/
set_host_byte(scmnd, DID_REQUEUE);
}
break;
}

if (!do_work)
return;

Expand Down

0 comments on commit 3948f55

Please sign in to comment.