On Thu, May 06, 2021 at 08:02:53AM -0700, Bart Van Assche wrote: > On 5/5/21 7:58 AM, Ming Lei wrote: > > diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c > > index 4a40d409f5dd..8b239dcce85f 100644 > > --- a/block/blk-mq-tag.c > > +++ b/block/blk-mq-tag.c > > @@ -203,9 +203,14 @@ static struct request *blk_mq_find_and_get_req(struct blk_mq_tags *tags, > > unsigned int bitnr) > > { > > struct request *rq = tags->rqs[bitnr]; > > + unsigned long flags; > > > > - if (!rq || !refcount_inc_not_zero(&rq->ref)) > > + spin_lock_irqsave(&tags->lock, flags); > > + if (!rq || !refcount_inc_not_zero(&rq->ref)) { > > + spin_unlock_irqrestore(&tags->lock, flags); > > return NULL; > > + } > > + spin_unlock_irqrestore(&tags->lock, flags); > > return rq; > > } > Has it been considered to change the body of the if-statement into the > following? > > rq = NULL; > > That change would reduce the number of return statements from two to one. Looks cleaner, will take it in V6. Thanks, Ming