Re: [PATCH] blk-mq-sched: add might_sleep() check for flush/fua insert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2017-04-20 at 17:09 -0600, Jens Axboe wrote:
> From: Jens Axboe <axboe@xxxxxx>
> Subject: [PATCH] blk-mq: add might_sleep check to blk_mq_get_driver_tag()
> 
> If the caller passes in wait=true, 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.
> 
> Signed-off-by: Jens Axboe <axboe@xxxxxx>
> 
> 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 = wait ? 0 : BLK_MQ_REQ_NOWAIT,
>  	};
>  
> +	might_sleep_if(wait);
> +
>  	if (rq->tag != -1)
>  		goto done;
>  
> 

Thanks!

Reviewed-by: Bart Van Assche <Bart.VanAssche@xxxxxxxxxxx>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux