On Tue, Jan 25, 2022 at 05:09:42PM +0800, Ming Lei wrote: > Follows another simple way by accounting all request with bio attached, > except for requests with kernel buffer. > - else if (rq->q->disk) > + else if (rq->q->disk && rq->bio) > rq->part = rq->q->disk->part0; Most passthrough requests will have a bio, so you'll still use e.g. the sd gendisk for sg request here. I think the right way would be to just remove this branch entirely. This means we only account bios with a block_device, which implies they have a gendisk.