On Wed, Jan 26, 2022 at 09:49:50AM +0100, Christoph Hellwig wrote: > On Wed, Jan 26, 2022 at 04:33:54PM +0800, Ming Lei wrote: > > > I guess you are worried about the latter conditionin that we stop > > > accounting for no data transfer passthrough commands? > > > > No, I meant that bio->bi_bdev isn't setup yet for passthrough request, > > and not sure that can be done easily. > > Take a look at e.g. nvme_submit_user_cmd and iblock_get_bio. nvme just sets part0 to rq->bio, which is fine since nvme doesn't support partial completion. The simplest way could be to assign bio->bi_bdev with q->disk->part0 in both bio_copy_user_iov() and bio_map_user_iov(), which should cover most of cases. Given user io is always on device instead of partition even though the command is sent via partition bdev. Thanks, Ming