From: Jens Axboe <axboe@fb.com>
To: Ming Lei <tom.leiming@gmail.com>, <linux-kernel@vger.kernel.org>,
<linux-block@vger.kernel.org>,
Christoph Hellwig <hch@infradead.org>
Cc: Yi Zhang <yizhan@redhat.com>,
Bart Van Assche <bart.vanassche@sandisk.com>,
Hannes Reinecke <hare@suse.de>,
Keith Busch <keith.busch@intel.com>
Subject: Re: [PATCH] blk-mq: don't complete un-started request in timeout handler
Date: Tue, 21 Mar 2017 23:03:59 -0400 [thread overview]
Message-ID: <2bc8118b-4a11-f28e-50eb-22019184756b@fb.com> (raw)
In-Reply-To: <20170322021443.26397-1-tom.leiming@gmail.com>
On 03/21/2017 10:14 PM, Ming Lei wrote:
> When iterating busy requests in timeout handler,
> if the STARTED flag of one request isn't set, that means
> the request is being processed in block layer or driver, and
> isn't submitted to hardware yet.
>
> In current implementation of blk_mq_check_expired(),
> if the request queue becomes dying, un-started requests are
> handled as being completed/freed immediately. This way is
> wrong, and can cause rq corruption or double allocation[1][2],
> when doing I/O and removing&resetting NVMe device at the sametime.
I agree, completing it looks bogus. If the request is in a scheduler or
on a software queue, this won't end well at all. Looks like it was
introduced by this patch:
commit eb130dbfc40eabcd4e10797310bda6b9f6dd7e76
Author: Keith Busch <keith.busch@intel.com>
Date: Thu Jan 8 08:59:53 2015 -0700
blk-mq: End unstarted requests on a dying queue
Before that, we just ignored it. Keith?
--
Jens Axboe
next prev parent reply other threads:[~2017-03-22 3:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 2:14 Ming Lei
2017-03-22 3:03 ` Jens Axboe [this message]
2017-03-22 15:58 ` Keith Busch
2017-03-22 16:35 ` Jens Axboe
2017-03-23 12:14 ` Ming Lei
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=2bc8118b-4a11-f28e-50eb-22019184756b@fb.com \
--to=axboe@fb.com \
--cc=bart.vanassche@sandisk.com \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=keith.busch@intel.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tom.leiming@gmail.com \
--cc=yizhan@redhat.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
all inboxes | Powered by JetHome®