public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@linux.vnet.ibm.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Cc: Hannes Reinecke <hare@suse.de>, lnx1138@linux.vnet.ibm.com
Subject: blk_requeue_request BUG_ON
Date: Wed, 13 May 2015 17:54:18 -0500	[thread overview]
Message-ID: <5553D61A.9080502@linux.vnet.ibm.com> (raw)

I've been chasing a BUG_ON in blk_requeue_request which seems to occur
in scenarios where we are seeing lots of SCSI aborts. As I've been digging
through the completion paths and abort paths, I've noticed if the following
sequence occurs, we are likely to hit this issue:

1. scsi_cmd times out, async abort issued
2. LLDD aborts command, LLDD calls scsi_done for the aborted command from interrupt handler
   when aborted command comes back
3. If result of the aborted command is something like DID_ERROR and we allow retries,
   then in scsi_done processing, we'll call scsi_queue_insert which then calls blk_requeue_request
4. Returning from the LLDD's eh_abort handler, scsi_error sees the abort was successful,
   and then calls scsi_queue_insert for the aborted command, which also calls blk_requeue_request
   where we hit the BUG_ON because the command has been queued again.

This is occurring for the non blk_rq_tagged case, for reference, so blk_requeue_request
doesn't call blk_queue_end_tag which might cause this to not be hit...

Should a LLDD NOT call scsi_done for commands it aborts? We've seen the issue above on
both ibmvfc and mpt2sas, but I know there are other LLDDs that call scsi_done in this case,
but just do it before eh_abort returns. Or is it expected the LLDD will only ever return DID_ABORT
on the aborted command, which looks like it might prevent this issue as well, however, that seems
racy and then we'd also need to add some memory barriers around the checking / setting of scmd->eh_eflags
I would think.

Or am I missing something and headed down the wrong path?

Thanks,

Brian

-- 
Brian King
Power Linux I/O
IBM Linux Technology Center



             reply	other threads:[~2015-05-13 22:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13 22:54 Brian King [this message]
2015-05-14  0:07 ` blk_requeue_request BUG_ON Rajat Jain
2015-05-14  0:34 ` James Bottomley

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=5553D61A.9080502@linux.vnet.ibm.com \
    --to=brking@linux.vnet.ibm.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lnx1138@linux.vnet.ibm.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox