diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2008-08-21 07:43:33 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-08-29 10:03:56 -0400 |
commit | 47f7bba52b01dd881fbd17b4b50c89ecf186eee2 (patch) | |
tree | 9587e2d4d69c54861659bfd2132ccecf81aadc52 /drivers/s390/scsi | |
parent | d4538817287e56abc938900886301a5bdfafbfcd (diff) |
[SCSI] zfcp: Correctly query end flag in gpn_ft response
When the last port entry in the gpn_ft response is already a known
port, the eval function would skip the end flag and try to attach
ports with wwpn 0. Fix this by checking the flag first.
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Martin Petermann <martin@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/s390/scsi')
-rw-r--r-- | drivers/s390/scsi/zfcp_fc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c index e984469bb98b..27edabe5b20a 100644 --- a/drivers/s390/scsi/zfcp_fc.c +++ b/drivers/s390/scsi/zfcp_fc.c | |||
@@ -475,7 +475,7 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) | |||
475 | struct zfcp_adapter *adapter = ct->port->adapter; | 475 | struct zfcp_adapter *adapter = ct->port->adapter; |
476 | struct zfcp_port *port, *tmp; | 476 | struct zfcp_port *port, *tmp; |
477 | u32 d_id; | 477 | u32 d_id; |
478 | int ret = 0, x; | 478 | int ret = 0, x, last = 0; |
479 | 479 | ||
480 | if (ct->status) | 480 | if (ct->status) |
481 | return -EIO; | 481 | return -EIO; |
@@ -492,12 +492,13 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) | |||
492 | down(&zfcp_data.config_sema); | 492 | down(&zfcp_data.config_sema); |
493 | 493 | ||
494 | /* first entry is the header */ | 494 | /* first entry is the header */ |
495 | for (x = 1; x < ZFCP_GPN_FT_MAX_ENTRIES; x++) { | 495 | for (x = 1; x < ZFCP_GPN_FT_MAX_ENTRIES && !last; x++) { |
496 | if (x % (ZFCP_GPN_FT_ENTRIES + 1)) | 496 | if (x % (ZFCP_GPN_FT_ENTRIES + 1)) |
497 | acc++; | 497 | acc++; |
498 | else | 498 | else |
499 | acc = sg_virt(++sg); | 499 | acc = sg_virt(++sg); |
500 | 500 | ||
501 | last = acc->control & 0x80; | ||
501 | d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 | | 502 | d_id = acc->port_id[0] << 16 | acc->port_id[1] << 8 | |
502 | acc->port_id[2]; | 503 | acc->port_id[2]; |
503 | 504 | ||
@@ -513,8 +514,6 @@ static int zfcp_scan_eval_gpn_ft(struct zfcp_gpn_ft *gpn_ft) | |||
513 | ret = PTR_ERR(port); | 514 | ret = PTR_ERR(port); |
514 | else | 515 | else |
515 | zfcp_erp_port_reopen(port, 0, 149, NULL); | 516 | zfcp_erp_port_reopen(port, 0, 149, NULL); |
516 | if (acc->control & 0x80) /* last entry */ | ||
517 | break; | ||
518 | } | 517 | } |
519 | 518 | ||
520 | zfcp_erp_wait(adapter); | 519 | zfcp_erp_wait(adapter); |