[SCSI] libfc: Always reset remote port roles when receiving PRLI
authorRobert Love <robert.w.love@intel.com>
Tue, 25 Aug 2009 21:03:04 +0000 (14:03 -0700)
committerJames Bottomley <James.Bottomley@suse.de>
Thu, 10 Sep 2009 17:07:58 +0000 (12:07 -0500)
Don't trust previous roles, reset them when we receive a PRLI.

Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/libfc/fc_rport.c

index c667be879be6bfcca3fd48a2d0abcc51f0b5e54e..cb54115c26cb3bf7033e1e32dbdf0f41a0a1e5f6 100644 (file)
@@ -666,6 +666,9 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp,
                goto err;
        }
 
+       /* reinitialize remote port roles */
+       rdata->ids.roles = FC_RPORT_ROLE_UNKNOWN;
+
        op = fc_frame_payload_op(fp);
        if (op == ELS_LS_ACC) {
                pp = fc_frame_payload_get(fp, sizeof(*pp));
@@ -1173,6 +1176,9 @@ static void fc_rport_recv_prli_req(struct fc_rport_priv *rdata,
                pp->prli.prli_len = htons(len);
                len -= sizeof(struct fc_els_prli);
 
+               /* reinitialize remote port roles */
+               rdata->ids.roles = FC_RPORT_ROLE_UNKNOWN;
+
                /*
                 * Go through all the service parameter pages and build
                 * response.  If plen indicates longer SPP than standard,