Commit:     0d2fcd9f9858a34f7056b3b1cb60ce0f883d06b6
Parent:     1c13899154f6f93e8c9ff3e981a90d5f21df2d6b
Author:     Hannes Reinecke <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 14 15:16:45 2007 +0200
Committer:  James Bottomley <[EMAIL PROTECTED]>
CommitDate: Sun Jun 17 16:03:11 2007 -0500

    [SCSI] fc_transport: Check portstates before invoking target scan
    When a target scan is initiated from sysfs, we should check the
    portstate prior to invoke scsi_scan_target().
    Otherwise scsi_scan_target() might oops as the rport might already
    been removed from the scsi host and the traversal from the rport to
    the scsi_host in scsi_scan_target() will fail.
    Also the portstate already told us that communication with the target
    has failed, so it's quite pointless to try.
    Signed-off-by: Hannes Reinecke <[EMAIL PROTECTED]>
    Cc: James Smart <[EMAIL PROTECTED]>
    Signed-off-by: James Bottomley <[EMAIL PROTECTED]>
 drivers/scsi/scsi_transport_fc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 4953f0d..e882570 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -1943,6 +1943,9 @@ static int fc_user_scan(struct Scsi_Host *shost, uint 
                if (rport->scsi_target_id == -1)
+               if (rport->port_state != FC_PORTSTATE_ONLINE)
+                       continue;
                if ((channel == SCAN_WILD_CARD || channel == rport->channel) &&
                    (id == SCAN_WILD_CARD || id == rport->scsi_target_id)) {
                        scsi_scan_target(&rport->dev, rport->channel,
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to