Browse Source

[SCSI] libsas: check for 'gone' expanders in smp_execute_task()

No sense in issuing or retrying commands to an expander that has been
removed.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Dan Williams 13 years ago
parent
commit
3a9c5560f6
1 changed files with 5 additions and 0 deletions
  1. 5 0
      drivers/scsi/libsas/sas_expander.c

+ 5 - 0
drivers/scsi/libsas/sas_expander.c

@@ -74,6 +74,11 @@ static int smp_execute_task(struct domain_device *dev, void *req, int req_size,
 
 
 	mutex_lock(&dev->ex_dev.cmd_mutex);
 	mutex_lock(&dev->ex_dev.cmd_mutex);
 	for (retry = 0; retry < 3; retry++) {
 	for (retry = 0; retry < 3; retry++) {
+		if (test_bit(SAS_DEV_GONE, &dev->state)) {
+			res = -ECOMM;
+			break;
+		}
+
 		task = sas_alloc_task(GFP_KERNEL);
 		task = sas_alloc_task(GFP_KERNEL);
 		if (!task) {
 		if (!task) {
 			res = -ENOMEM;
 			res = -ENOMEM;