public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jia-Ju Bai <baijiaju1990@gmail.com>
To: James Bottomley <jejb@linux.vnet.ibm.com>,
	qla2xxx-upstream@qlogic.com, martin.petersen@oracle.com
Cc: linux-scsi@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag
Date: Wed, 13 Dec 2017 15:38:20 +0800	[thread overview]
Message-ID: <e6dc47be-50ef-a0dd-a07b-95e60a3103a1@gmail.com> (raw)
In-Reply-To: <1513140121.3110.78.camel@linux.vnet.ibm.com>


On 2017/12/13 12:42, James Bottomley wrote:
> On Wed, 2017-12-13 at 11:18 +0800, Jia-Ju Bai wrote:
>> The driver may sleep under a spinlock.
>> The function call paths are:
>> qlt_handle_abts_recv_work (acquire the spinlock)
>>     qlt_response_pkt_all_vps
>>       qlt_response_pkt
>>         qlt_handle_cmd_for_atio
>>           qlt_get_tag
>>             percpu_ida_alloc --> may sleep
>>
>> qla82xx_msix_rsp_q (acquire the spinlock)
>>     qla24xx_process_response_queue
>>       qlt_handle_abts_recv
>>         qlt_response_pkt_all_vps
>>           qlt_response_pkt
>>             qlt_handle_cmd_for_atio
>>               qlt_get_tag
>>                 percpu_ida_alloc --> may sleep-in-atomic
>>
>> qla24xx_intr_handler (acquire the spinlock)
>>     qla24xx_process_response_queue
>>       qlt_handle_abts_recv
>>         qlt_response_pkt
>>           qlt_handle_cmd_for_atio
>>             qlt_get_tag
>>               percpu_ida_alloc --> may sleep
>>
>> I do not find a good way to fix it, so I only report.
>> This possible bug is found by my static analysis tool (DSAC) and
>> checked by my code review.
> The report is incorrect: percpu_ida_alloc with state==TASK_RUNNING is
> atomic (and interrupt) safe which appears to be the case here.
>
> James
>

Thanks for your reply :)
I have checked the definition of percpu_ida_alloc, and I think you are 
right.
Sorry for my incorrect bug report.


Thanks,
Jia-Ju Bai

      reply	other threads:[~2017-12-13  7:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-13  3:18 [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag Jia-Ju Bai
2017-12-13  4:42 ` James Bottomley
2017-12-13  7:38   ` Jia-Ju Bai [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=e6dc47be-50ef-a0dd-a07b-95e60a3103a1@gmail.com \
    --to=baijiaju1990@gmail.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=qla2xxx-upstream@qlogic.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