Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213380
b: refs/heads/master
c: 56dd2c0
h: refs/heads/master
v: v3
  • Loading branch information
Darrick J. Wong authored and James Bottomley committed Oct 8, 2010
1 parent b8fa345 commit 76081b1
Show file tree
Hide file tree
Showing 5 changed files with 16 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: 39a985547cbfcbb0b23667b69b8ae82a6cf312ac
refs/heads/master: 56dd2c0691a5a387b7b05835fe547dc6fade9407
4 changes: 4 additions & 0 deletions trunk/drivers/scsi/libsas/sas_ata.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc)
unsigned int xfer = 0;
unsigned int si;

/* If the device fell off, no sense in issuing commands */
if (dev->gone)
return AC_ERR_SYSTEM;

task = sas_alloc_task(GFP_ATOMIC);
if (!task)
return AC_ERR_SYSTEM;
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/scsi/libsas/sas_expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -1724,6 +1724,7 @@ static void sas_unregister_ex_tree(struct domain_device *dev)
struct domain_device *child, *n;

list_for_each_entry_safe(child, n, &ex->children, siblings) {
child->gone = 1;
if (child->dev_type == EDGE_DEV ||
child->dev_type == FANOUT_DEV)
sas_unregister_ex_tree(child);
Expand All @@ -1744,6 +1745,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
&ex_dev->children, siblings) {
if (SAS_ADDR(child->sas_addr) ==
SAS_ADDR(phy->attached_sas_addr)) {
child->gone = 1;
if (child->dev_type == EDGE_DEV ||
child->dev_type == FANOUT_DEV)
sas_unregister_ex_tree(child);
Expand All @@ -1752,6 +1754,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
break;
}
}
parent->gone = 1;
sas_disable_routing(parent, phy->attached_sas_addr);
}
memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/scsi/libsas/sas_scsi_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ int sas_queuecommand(struct scsi_cmnd *cmd,
goto out;
}

/* If the device fell off, no sense in issuing commands */
if (dev->gone) {
cmd->result = DID_BAD_TARGET << 16;
scsi_done(cmd);
goto out;
}

res = -ENOMEM;
task = sas_create_task(cmd, dev, GFP_ATOMIC);
if (!task)
Expand Down
1 change: 1 addition & 0 deletions trunk/include/scsi/libsas.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ struct domain_device {
};

void *lldd_dev;
int gone;
};

struct sas_discovery_event {
Expand Down

0 comments on commit 76081b1

Please sign in to comment.