aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/fcoe/libfcoe.c
diff options
context:
space:
mode:
authorJoe Eykholt <jeykholt@cisco.com>2010-11-30 19:19:51 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-12-21 13:24:32 -0500
commitb69ae0ae3f322d9a6bc4e209049b5b6e193ad652 (patch)
tree87e5dc0b75fafdddeaaa6181469fcda53ea239a3 /drivers/scsi/fcoe/libfcoe.c
parentc47036a7cd378533495d8cc06a7cf8a881072a9d (diff)
[SCSI] libfcoe: fix checking of conflicting fabrics in fcoe_ctlr_select()
The check for conflicting fabrics in fcoe_ctlr_select() ignores any FCFs that aren't usable. This is a minor problem now but becomes more pronounced after later patches. Signed-off-by: Joe Eykholt <jeykholt@cisco.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/fcoe/libfcoe.c')
-rw-r--r--drivers/scsi/fcoe/libfcoe.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c
index 4d0be20cb73d..826c260f7951 100644
--- a/drivers/scsi/fcoe/libfcoe.c
+++ b/drivers/scsi/fcoe/libfcoe.c
@@ -1361,12 +1361,22 @@ static void fcoe_ctlr_select(struct fcoe_ctlr *fip)
1361{ 1361{
1362 struct fcoe_fcf *fcf; 1362 struct fcoe_fcf *fcf;
1363 struct fcoe_fcf *best = NULL; 1363 struct fcoe_fcf *best = NULL;
1364 struct fcoe_fcf *first;
1365
1366 first = list_first_entry(&fip->fcfs, struct fcoe_fcf, list);
1364 1367
1365 list_for_each_entry(fcf, &fip->fcfs, list) { 1368 list_for_each_entry(fcf, &fip->fcfs, list) {
1366 LIBFCOE_FIP_DBG(fip, "consider FCF for fab %16.16llx " 1369 LIBFCOE_FIP_DBG(fip, "consider FCF for fab %16.16llx "
1367 "VFID %d map %x val %d\n", 1370 "VFID %d map %x val %d\n",
1368 fcf->fabric_name, fcf->vfid, 1371 fcf->fabric_name, fcf->vfid,
1369 fcf->fc_map, fcoe_ctlr_mtu_valid(fcf)); 1372 fcf->fc_map, fcoe_ctlr_mtu_valid(fcf));
1373 if (fcf->fabric_name != first->fabric_name ||
1374 fcf->vfid != first->vfid ||
1375 fcf->fc_map != first->fc_map) {
1376 LIBFCOE_FIP_DBG(fip, "Conflicting fabric, VFID, "
1377 "or FC-MAP\n");
1378 return NULL;
1379 }
1370 if (!fcoe_ctlr_fcf_usable(fcf)) { 1380 if (!fcoe_ctlr_fcf_usable(fcf)) {
1371 LIBFCOE_FIP_DBG(fip, "FCF for fab %16.16llx " 1381 LIBFCOE_FIP_DBG(fip, "FCF for fab %16.16llx "
1372 "map %x %svalid %savailable\n", 1382 "map %x %svalid %savailable\n",
@@ -1380,13 +1390,6 @@ static void fcoe_ctlr_select(struct fcoe_ctlr *fip)
1380 best = fcf; 1390 best = fcf;
1381 continue; 1391 continue;
1382 } 1392 }
1383 if (fcf->fabric_name != best->fabric_name ||
1384 fcf->vfid != best->vfid ||
1385 fcf->fc_map != best->fc_map) {
1386 LIBFCOE_FIP_DBG(fip, "Conflicting fabric, VFID, "
1387 "or FC-MAP\n");
1388 return;
1389 }
1390 if (fcf->pri < best->pri) 1393 if (fcf->pri < best->pri)
1391 best = fcf; 1394 best = fcf;
1392 } 1395 }