LKML Archive on
help / color / mirror / Atom feed
From: "" <>
	"" <>,
	"" <>,
	"Martin K. Petersen" <>,
	Junxiao Bi <>
Subject: BUG: scsi/qla2xxx: BUG_ON(blk_queued_rq(req) is triggered in blk_finish_request
Date: Wed, 23 May 2018 11:55:29 +0800	[thread overview]
Message-ID: <> (raw)

Hi all

Our customer met a panic triggered by BUG_ON in blk_finish_request.
>From the dmesg log, the BUG_ON was triggered after command abort occurred many times.
There is a race condition in the following scenario.

cpu A                                   cpu B
kworker                                 interrupt
  -> scsi_try_to_abort_cmd()
    -> qla2xxx_eh_abort()                        
      -> qla2x00_eh_wait_on_command()   qla2x00_status_entry()   
                                          -> qla2x00_sp_compl()
                                            -> qla2x00_sp_free_dma()
  -> scsi_queue_insert()                          
    -> __scsi_queue_insert()                         
      -> blk_requeue_request()
        -> blk_clear_rq_complete()
                                            -> scsi_done
                                              -> blk_complete_request
                                                -> blk_mark_rq_complete       
          -> elv_requeue_request()              -> __blk_complete_request()
            -> __elv_add_request()
            // req will be queued here                                                         
                                                      -> scsi_finish_command()
                                                        -> scsi_io_completion()
                                                          -> scsi_end_request()
                                                            -> blk_finish_request()  // BUG_ON(blk_queued_rq(req)) !!!

The issue will not be triggered most of time, because the request is marked as complete by timeout path.
So the scsi_done from qla2x00_sp_compl does nothing.
But as the scenario above, if the complete state has been cleaned by blk_requeue_request, we will get
the request both requeued and completed, and then BUG_ON(blk_queued_rq(req)) in blk_finish_request comes up.

Is there any solution for this in qla2xxx driver side ?


             reply	other threads:[~2018-05-23  3:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23  3:55 [this message]
2018-05-24  1:50 `
     [not found]   ` <>
2018-05-24  9:09     `

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: BUG: scsi/qla2xxx: BUG_ON(blk_queued_rq(req) is triggered in blk_finish_request' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).