On Fri, Apr 24, 2020 at 06:23:44PM +0800, Ming Lei wrote: > Especially for none elevator, rq->tag is assigned after the request is > allocated, so there isn't any way to figure out if one request is in > being dispatched. Also the code path wrt. driver tag becomes a bit > difference between none and io scheduler. > > When one hctx becomes inactive, we have to prevent any request from > being dispatched to LLD. And get driver tag provides one perfect chance > to do that. Meantime we can drain any such requests by checking if > rq->tag is assigned. > > So only assign rq->tag until blk_mq_get_driver_tag() is called. > > This way also simplifies code of dealing with driver tag a lot. Looks good, Reviewed-by: Christoph Hellwig <hch@xxxxxx>