Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198987
b: refs/heads/master
c: f9e8894
h: refs/heads/master
i:
  198985: 55b7ff6
  198983: 47adc36
v: v3
  • Loading branch information
Alan Stern authored and James Bottomley committed May 25, 2010
1 parent 336bd4b commit 8be475b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a52da632ceb9d8b776494563df579e87b7b586b
refs/heads/master: f9e8894ae5157796dd69249c56062042d02a431d
9 changes: 5 additions & 4 deletions trunk/drivers/scsi/scsi_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,19 +492,20 @@ void scsi_target_reap(struct scsi_target *starget)
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
unsigned long flags;
enum scsi_target_state state;
int empty;
int empty = 0;

spin_lock_irqsave(shost->host_lock, flags);
state = starget->state;
empty = --starget->reap_ref == 0 &&
list_empty(&starget->devices) ? 1 : 0;
if (--starget->reap_ref == 0 && list_empty(&starget->devices)) {
empty = 1;
starget->state = STARGET_DEL;
}
spin_unlock_irqrestore(shost->host_lock, flags);

if (!empty)
return;

BUG_ON(state == STARGET_DEL);
starget->state = STARGET_DEL;
if (state == STARGET_CREATED)
scsi_target_destroy(starget);
else
Expand Down

0 comments on commit 8be475b

Please sign in to comment.