public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thibaut Sautereau <thibaut@sautereau.fr>
To: stable@vger.kernel.org
Cc: Jianchao Wang <jianchao.w.wang@oracle.com>,
	m19@florianstecker.de, Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blk-mq: fix a hung issue when fsync
Date: Sun, 17 Feb 2019 16:37:29 +0100	[thread overview]
Message-ID: <20190217153729.GA3835@gandi.net> (raw)
In-Reply-To: <319fffef-2fa8-afff-8f93-1ce8fd721581@kernel.dk>

On Wed, Jan 30, 2019 at 08:54:09AM -0700, Jens Axboe wrote:
> On 1/30/19 2:01 AM, Jianchao Wang wrote:
> > Florian reported a io hung issue when fsync(). It should be
> > triggered by following race condition.
> > 
> > data + post flush         a flush
> > 
> > blk_flush_complete_seq
> >   case REQ_FSEQ_DATA
> >     blk_flush_queue_rq
> >     issued to driver      blk_mq_dispatch_rq_list
> >                             try to issue a flush req
> >                             failed due to NON-NCQ command
> >                             .queue_rq return BLK_STS_DEV_RESOURCE
> > 
> > request completion
> >   req->end_io // doesn't check RESTART
> >   mq_flush_data_end_io
> >     case REQ_FSEQ_POSTFLUSH
> >       blk_kick_flush
> >         do nothing because previous flush
> >         has not been completed
> >      blk_mq_run_hw_queue
> >                               insert rq to hctx->dispatch
> >                               due to RESTART is still set, do nothing
> > 
> > To fix this, replace the blk_mq_run_hw_queue in mq_flush_data_end_io
> > with blk_mq_sched_restart to check and clear the RESTART flag.
> 
> Applied, thanks.
> 
> -- 
> Jens Axboe

Can this be applied to stable kernels please?

It's commit 85bd6e61f34dffa8ec2dc75ff3c02ee7b2f1cbce upstream.

Thanks,

-- 
Thibaut

  reply	other threads:[~2019-02-17 15:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30  9:01 [PATCH] blk-mq: fix a hung issue when fsync Jianchao Wang
2019-01-30 15:54 ` Jens Axboe
2019-02-17 15:37   ` Thibaut Sautereau [this message]
2019-02-17 17:28     ` Sasha Levin

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=20190217153729.GA3835@gandi.net \
    --to=thibaut@sautereau.fr \
    --cc=axboe@kernel.dk \
    --cc=jianchao.w.wang@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m19@florianstecker.de \
    --cc=stable@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox