Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127905
b: refs/heads/master
c: 4be98c0
h: refs/heads/master
i:
  127903: 7358ed3
v: v3
  • Loading branch information
James Smart authored and James Bottomley committed Jan 6, 2009
1 parent 983948a commit c3c1d7c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 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: 58607b30fc0f2230a189500112c7a7cca02804cf
refs/heads/master: 4be98c0ca304c8a47998b29a7993664f71791250
21 changes: 19 additions & 2 deletions trunk/drivers/scsi/scsi_transport_fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2407,8 +2407,12 @@ fc_rport_final_delete(struct work_struct *work)
/*
* Notify the driver that the rport is now dead. The LLDD will
* also guarantee that any communication to the rport is terminated
*
* Avoid this call if we already called it when we preserved the
* rport for the binding.
*/
if (i->f->dev_loss_tmo_callbk)
if (!(rport->flags & FC_RPORT_DEVLOSS_CALLBK_DONE) &&
(i->f->dev_loss_tmo_callbk))
i->f->dev_loss_tmo_callbk(rport);

transport_remove_device(dev);
Expand Down Expand Up @@ -2647,7 +2651,8 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel,
spin_lock_irqsave(shost->host_lock, flags);

rport->flags &= ~(FC_RPORT_FAST_FAIL_TIMEDOUT |
FC_RPORT_DEVLOSS_PENDING);
FC_RPORT_DEVLOSS_PENDING |
FC_RPORT_DEVLOSS_CALLBK_DONE);

/* if target, initiate a scan */
if (rport->scsi_target_id != -1) {
Expand Down Expand Up @@ -2944,6 +2949,7 @@ fc_timeout_deleted_rport(struct work_struct *work)
struct fc_rport *rport =
container_of(work, struct fc_rport, dev_loss_work.work);
struct Scsi_Host *shost = rport_to_shost(rport);
struct fc_internal *i = to_fc_internal(shost->transportt);
struct fc_host_attrs *fc_host = shost_to_fc_host(shost);
unsigned long flags;

Expand Down Expand Up @@ -3011,6 +3017,7 @@ fc_timeout_deleted_rport(struct work_struct *work)
rport->roles = FC_PORT_ROLE_UNKNOWN;
rport->port_state = FC_PORTSTATE_NOTPRESENT;
rport->flags &= ~FC_RPORT_FAST_FAIL_TIMEDOUT;
rport->flags |= FC_RPORT_DEVLOSS_CALLBK_DONE;

/*
* Pre-emptively kill I/O rather than waiting for the work queue
Expand Down Expand Up @@ -3046,8 +3053,18 @@ fc_timeout_deleted_rport(struct work_struct *work)
* all attached scsi devices.
*/
fc_queue_work(shost, &rport->stgt_delete_work);

/*
* Notify the driver that the rport is now dead. The LLDD will
* also guarantee that any communication to the rport is terminated
*
* Note: we set the CALLBK_DONE flag above to correspond
*/
if (i->f->dev_loss_tmo_callbk)
i->f->dev_loss_tmo_callbk(rport);
}


/**
* fc_timeout_fail_rport_io - Timeout handler for a fast io failing on a disconnected SCSI target.
* @work: rport to terminate io on.
Expand Down
1 change: 1 addition & 0 deletions trunk/include/scsi/scsi_transport_fc.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,7 @@ struct fc_rport { /* aka fc_starget_attrs */
#define FC_RPORT_DEVLOSS_PENDING 0x01
#define FC_RPORT_SCAN_PENDING 0x02
#define FC_RPORT_FAST_FAIL_TIMEDOUT 0x04
#define FC_RPORT_DEVLOSS_CALLBK_DONE 0x08

#define dev_to_rport(d) \
container_of(d, struct fc_rport, dev)
Expand Down

0 comments on commit c3c1d7c

Please sign in to comment.