On Tue, Jan 25, 2022 at 07:09:09AM +0800, Ming Lei wrote: > > Please explain why you want to change this. > > Please see the following code: This needs to go into the commit log. > > /* passthrough requests can hold bios that do not have ->bi_bdev set */ > if (rq->bio && rq->bio->bi_bdev) > rq->part = rq->bio->bi_bdev; > else if (rq->q->disk) > rq->part = rq->q->disk->part0; > > q->disk can be cleared by disk_release() just when referring the above line, then > NULL ptr reference is caused, and similar issue with any reference to rq->part for > passthrough request sent not from userspace. So why not key off accouning off "rq->bio && rq->bio->bi_bdev" and remove the need for the flag and the second half of the assignment above? That is much less error probe and removes code size.