diff options
-rw-r--r-- | drivers/scsi/libfc/fc_lport.c | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/drivers/scsi/libfc/fc_lport.c b/drivers/scsi/libfc/fc_lport.c index 016f771ebe69..22c0f7bc004f 100644 --- a/drivers/scsi/libfc/fc_lport.c +++ b/drivers/scsi/libfc/fc_lport.c | |||
@@ -146,44 +146,31 @@ static void fc_lport_rport_callback(struct fc_lport *lport, | |||
146 | FC_LPORT_DBG(lport, "Received a %d event for port (%6x)\n", event, | 146 | FC_LPORT_DBG(lport, "Received a %d event for port (%6x)\n", event, |
147 | rdata->ids.port_id); | 147 | rdata->ids.port_id); |
148 | 148 | ||
149 | mutex_lock(&lport->lp_mutex); | ||
149 | switch (event) { | 150 | switch (event) { |
150 | case RPORT_EV_READY: | 151 | case RPORT_EV_READY: |
151 | if (rdata->ids.port_id == FC_FID_DIR_SERV) { | 152 | if (lport->state == LPORT_ST_DNS) { |
152 | mutex_lock(&lport->lp_mutex); | 153 | lport->dns_rp = rdata; |
153 | if (lport->state == LPORT_ST_DNS) { | 154 | fc_lport_enter_rpn_id(lport); |
154 | lport->dns_rp = rdata; | 155 | } else { |
155 | fc_lport_enter_rpn_id(lport); | 156 | FC_LPORT_DBG(lport, "Received an READY event " |
156 | } else { | 157 | "on port (%6x) for the directory " |
157 | FC_LPORT_DBG(lport, "Received an READY event " | 158 | "server, but the lport is not " |
158 | "on port (%6x) for the directory " | 159 | "in the DNS state, it's in the " |
159 | "server, but the lport is not " | 160 | "%d state", rdata->ids.port_id, |
160 | "in the DNS state, it's in the " | 161 | lport->state); |
161 | "%d state", rdata->ids.port_id, | 162 | lport->tt.rport_logoff(rdata); |
162 | lport->state); | 163 | } |
163 | lport->tt.rport_logoff(rdata); | ||
164 | } | ||
165 | mutex_unlock(&lport->lp_mutex); | ||
166 | } else | ||
167 | FC_LPORT_DBG(lport, "Received an event for port (%6x) " | ||
168 | "which is not the directory server\n", | ||
169 | rdata->ids.port_id); | ||
170 | break; | 164 | break; |
171 | case RPORT_EV_LOGO: | 165 | case RPORT_EV_LOGO: |
172 | case RPORT_EV_FAILED: | 166 | case RPORT_EV_FAILED: |
173 | case RPORT_EV_STOP: | 167 | case RPORT_EV_STOP: |
174 | if (rdata->ids.port_id == FC_FID_DIR_SERV) { | 168 | lport->dns_rp = NULL; |
175 | mutex_lock(&lport->lp_mutex); | ||
176 | lport->dns_rp = NULL; | ||
177 | mutex_unlock(&lport->lp_mutex); | ||
178 | |||
179 | } else | ||
180 | FC_LPORT_DBG(lport, "Received an event for port (%6x) " | ||
181 | "which is not the directory server\n", | ||
182 | rdata->ids.port_id); | ||
183 | break; | 169 | break; |
184 | case RPORT_EV_NONE: | 170 | case RPORT_EV_NONE: |
185 | break; | 171 | break; |
186 | } | 172 | } |
173 | mutex_unlock(&lport->lp_mutex); | ||
187 | } | 174 | } |
188 | 175 | ||
189 | /** | 176 | /** |