From: Robert Jennings <rcj@linux.vnet.ibm.com>
To: Brian King <brking@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org, James.Bottomley@HansenPartnership.com
Subject: Re: [PATCH 3/5] ibmvfc: Send cancel when link is down
Date: Tue, 16 Apr 2013 15:25:05 -0500 [thread overview]
Message-ID: <20130416202505.GA17614@linux.vnet.ibm.com> (raw)
In-Reply-To: <201304121325.r3CDPHwa025040@d01av05.pok.ibm.com>
* Brian King (brking@linux.vnet.ibm.com) wrote:
>
> If attempting to abort requests due to a fail fail timeout
> or error handling while the link is down, we cannot send
> an abort out on the fabric. We can, however, send a cancel
> to the VIOS. This fixes ibmvfc to send a cancel in this
> case to prevent error handling from failing and/or
> escalating.
>
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Acked-by: Robert Jennings <rcj@linux.vnet.ibm.com>
> ---
>
> drivers/scsi/ibmvscsi/ibmvfc.c | 13 ++++++++-----
> 1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff -puN drivers/scsi/ibmvscsi/ibmvfc.c~ibmvfc_cancel_when_link_down drivers/scsi/ibmvscsi/ibmvfc.c
> --- linux-2.6/drivers/scsi/ibmvscsi/ibmvfc.c~ibmvfc_cancel_when_link_down 2013-01-23 08:12:09.000000000 -0600
> +++ linux-2.6-bjking1/drivers/scsi/ibmvscsi/ibmvfc.c 2013-01-23 09:18:46.000000000 -0600
> @@ -2179,7 +2179,7 @@ static int ibmvfc_cancel_all(struct scsi
> return 0;
> }
>
> - if (vhost->state == IBMVFC_ACTIVE) {
> + if (vhost->logged_in) {
> evt = ibmvfc_get_event(vhost);
> ibmvfc_init_event(evt, ibmvfc_sync_completion, IBMVFC_MAD_FORMAT);
>
> @@ -2190,7 +2190,10 @@ static int ibmvfc_cancel_all(struct scsi
> tmf->common.length = sizeof(*tmf);
> tmf->scsi_id = rport->port_id;
> int_to_scsilun(sdev->lun, &tmf->lun);
> - tmf->flags = (type | IBMVFC_TMF_LUA_VALID);
> + if (vhost->state == IBMVFC_ACTIVE)
> + tmf->flags = (type | IBMVFC_TMF_LUA_VALID);
> + else
> + tmf->flags = IBMVFC_TMF_LUA_VALID;
> tmf->cancel_key = (unsigned long)sdev->hostdata;
> tmf->my_cancel_key = (unsigned long)starget->hostdata;
>
> @@ -2389,7 +2392,7 @@ static int ibmvfc_eh_abort_handler(struc
> {
> struct scsi_device *sdev = cmd->device;
> struct ibmvfc_host *vhost = shost_priv(sdev->host);
> - int cancel_rc, block_rc, abort_rc = 0;
> + int cancel_rc, block_rc;
> int rc = FAILED;
>
> ENTER;
> @@ -2397,11 +2400,11 @@ static int ibmvfc_eh_abort_handler(struc
> ibmvfc_wait_while_resetting(vhost);
> if (block_rc != FAST_IO_FAIL) {
> cancel_rc = ibmvfc_cancel_all(sdev, IBMVFC_TMF_ABORT_TASK_SET);
> - abort_rc = ibmvfc_abort_task_set(sdev);
> + ibmvfc_abort_task_set(sdev);
> } else
> cancel_rc = ibmvfc_cancel_all(sdev, 0);
>
> - if (!cancel_rc && !abort_rc)
> + if (!cancel_rc)
> rc = ibmvfc_wait_for_ops(vhost, sdev, ibmvfc_match_lun);
>
> if (block_rc == FAST_IO_FAIL && rc != FAILED)
> _
prev parent reply other threads:[~2013-04-16 20:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-12 13:25 [PATCH 3/5] ibmvfc: Send cancel when link is down Brian King
2013-04-16 20:25 ` Robert Jennings [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130416202505.GA17614@linux.vnet.ibm.com \
--to=rcj@linux.vnet.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=brking@linux.vnet.ibm.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.