Re: [PATCH 1/2] blk-mq: remove the RQF_ELVPRIV check in blk_mq_free_request

Christoph Hellwig
2021-10-19T13:45:04Z

On Tue, Oct 19, 2021 at 07:43:04AM -0600, Jens Axboe wrote:
> On 10/19/21 7:39 AM, Christoph Hellwig wrote:
> > If RQF_ELVPRIV is set RQF_ELV is by definition set as well.
> >
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
> > ---
> > block/blk-mq.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/block/blk-mq.c b/block/blk-mq.c
> > index 428e0e0fd5504..34392c439d2a8 100644
> > --- a/block/blk-mq.c
> > +++ b/block/blk-mq.c
> > @@ -580,7 +580,7 @@ void blk_mq_free_request(struct request *rq)
> > struct request_queue *q = rq->q;
> > struct blk_mq_hw_ctx *hctx = rq->mq_hctx;
> >
> > - if (rq->rq_flags & (RQF_ELVPRIV | RQF_ELV)) {
> > + if (rq->rq_flags & RQF_ELV) {
>
> Actually just fixed a bug there. RQF_ELV means "we have an IO
> scheduler", and RQF_ELVPRIV means that plus "we have rq private data".
> The above shouldn't check RQF_ELV at all, just PRIV.

Well, in that case RQF_ELVPRIV can be replaced with
RQF_ELV && !op_is_flush as in the next patch. But I can resend once I
see the fix in a tree somewhere.