diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-05 12:57:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-05 12:57:13 -0500 |
commit | aac9e28d2f3d3c1eacc4114d685864a2a6423b80 (patch) | |
tree | 3075a2d4c70840c3b2f7173f95c0f278072db8b7 /drivers/scsi/ibmvscsi/ibmvscsi.c | |
parent | 9f259cc59ba45b8db401d60be9700e275676fb15 (diff) | |
parent | 3c887e8a1a4553ae6263fc9490e33de213e3746f (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
[SCSI] ibmvscsi: Prevent IO during partner login
[SCSI] lpfc : Correct queue tag handling
[SCSI] Update MAINTAINER email address and trees
[SCSI] osst: fix if (...) \n #if... cases missing semicolons when false
Diffstat (limited to 'drivers/scsi/ibmvscsi/ibmvscsi.c')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 22d91ee173c5..5f2396c03958 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -556,7 +556,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, | |||
556 | unsigned long timeout) | 556 | unsigned long timeout) |
557 | { | 557 | { |
558 | u64 *crq_as_u64 = (u64 *) &evt_struct->crq; | 558 | u64 *crq_as_u64 = (u64 *) &evt_struct->crq; |
559 | int request_status; | 559 | int request_status = 0; |
560 | int rc; | 560 | int rc; |
561 | 561 | ||
562 | /* If we have exhausted our request limit, just fail this request, | 562 | /* If we have exhausted our request limit, just fail this request, |
@@ -574,6 +574,13 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, | |||
574 | if (request_status < -1) | 574 | if (request_status < -1) |
575 | goto send_error; | 575 | goto send_error; |
576 | /* Otherwise, we may have run out of requests. */ | 576 | /* Otherwise, we may have run out of requests. */ |
577 | /* If request limit was 0 when we started the adapter is in the | ||
578 | * process of performing a login with the server adapter, or | ||
579 | * we may have run out of requests. | ||
580 | */ | ||
581 | else if (request_status == -1 && | ||
582 | evt_struct->iu.srp.login_req.opcode != SRP_LOGIN_REQ) | ||
583 | goto send_busy; | ||
577 | /* Abort and reset calls should make it through. | 584 | /* Abort and reset calls should make it through. |
578 | * Nothing except abort and reset should use the last two | 585 | * Nothing except abort and reset should use the last two |
579 | * slots unless we had two or less to begin with. | 586 | * slots unless we had two or less to begin with. |
@@ -633,7 +640,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct *evt_struct, | |||
633 | unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); | 640 | unmap_cmd_data(&evt_struct->iu.srp.cmd, evt_struct, hostdata->dev); |
634 | 641 | ||
635 | free_event_struct(&hostdata->pool, evt_struct); | 642 | free_event_struct(&hostdata->pool, evt_struct); |
636 | atomic_inc(&hostdata->request_limit); | 643 | if (request_status != -1) |
644 | atomic_inc(&hostdata->request_limit); | ||
637 | return SCSI_MLQUEUE_HOST_BUSY; | 645 | return SCSI_MLQUEUE_HOST_BUSY; |
638 | 646 | ||
639 | send_error: | 647 | send_error: |
@@ -927,10 +935,11 @@ static int send_srp_login(struct ibmvscsi_host_data *hostdata) | |||
927 | login->req_buf_fmt = SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT; | 935 | login->req_buf_fmt = SRP_BUF_FORMAT_DIRECT | SRP_BUF_FORMAT_INDIRECT; |
928 | 936 | ||
929 | spin_lock_irqsave(hostdata->host->host_lock, flags); | 937 | spin_lock_irqsave(hostdata->host->host_lock, flags); |
930 | /* Start out with a request limit of 1, since this is negotiated in | 938 | /* Start out with a request limit of 0, since this is negotiated in |
931 | * the login request we are just sending | 939 | * the login request we are just sending and login requests always |
940 | * get sent by the driver regardless of request_limit. | ||
932 | */ | 941 | */ |
933 | atomic_set(&hostdata->request_limit, 1); | 942 | atomic_set(&hostdata->request_limit, 0); |
934 | 943 | ||
935 | rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2); | 944 | rc = ibmvscsi_send_srp_event(evt_struct, hostdata, init_timeout * 2); |
936 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); | 945 | spin_unlock_irqrestore(hostdata->host->host_lock, flags); |