From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Bart Van Assche To: "linux-block@vger.kernel.org" , "axboe@kernel.dk" Subject: Re: [PATCH] blk-mq-sched: add might_sleep() check for flush/fua insert Date: Thu, 20 Apr 2017 23:20:53 +0000 Message-ID: <1492730452.2642.17.camel@sandisk.com> References: <1492729028.2642.16.camel@sandisk.com> In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" MIME-Version: 1.0 List-ID: On Thu, 2017-04-20 at 17:09 -0600, Jens Axboe wrote: > From: Jens Axboe > Subject: [PATCH] blk-mq: add might_sleep check to blk_mq_get_driver_tag() >=20 > If the caller passes in wait=3Dtrue, it has to be able to block > for a driver tag. We just had a bug where flush insertion > would block on tag allocation, while we had preempt disabled. > Ensure that we catch cases like that earlier next time. >=20 > Signed-off-by: Jens Axboe >=20 > diff --git a/block/blk-mq.c b/block/blk-mq.c > index 992f09772f8a..dd6e5dd62804 100644 > --- a/block/blk-mq.c > +++ b/block/blk-mq.c > @@ -866,6 +866,8 @@ bool blk_mq_get_driver_tag(struct request *rq, struct= blk_mq_hw_ctx **hctx, > .flags =3D wait ? 0 : BLK_MQ_REQ_NOWAIT, > }; > =20 > + might_sleep_if(wait); > + > if (rq->tag !=3D -1) > goto done; > =20 >=20 Thanks! Reviewed-by: Bart Van Assche =