Re: [PATCH] null_blk: execute complete callback for fake timeout request

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

 



On Mon, Mar 13, 2023 at 10:00:30AM +0900, Damien Le Moal wrote:
> On 3/12/23 21:35, Akinobu Mita wrote:
> 
> diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c
> index 4c601ca9552a..52d689aa3171 100644
> --- a/drivers/block/null_blk/main.c
> +++ b/drivers/block/null_blk/main.c
> @@ -1413,7 +1413,7 @@ static inline void nullb_complete_cmd(struct nullb_cmd *cmd)
>         case NULL_IRQ_SOFTIRQ:
>                 switch (cmd->nq->dev->queue_mode) {
>                 case NULL_Q_MQ:
> -                       if (likely(!blk_should_fake_timeout(cmd->rq->q)))
> +                       if (!cmd->fake_timeout)
>                                 blk_mq_complete_request(cmd->rq);

I think you can remove the fake_timeout check from here now since this function
is never called when it's true.

>                         break;
>                 case NULL_Q_BIO:
> @@ -1675,7 +1675,8 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx,
>         cmd->rq = bd->rq;
>         cmd->error = BLK_STS_OK;
>         cmd->nq = nq;
> -       cmd->fake_timeout = should_timeout_request(bd->rq);
> +       cmd->fake_timeout = should_timeout_request(bd->rq) ||
> +               blk_should_fake_timeout(bd->rq->q);
> 
>         blk_mq_start_request(bd->rq);



[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