[PATCH 2/8] nvme: use the block layer for userspace passthrough metadata
Christoph Hellwig
hch at lst.de
Wed Oct 14 22:27:32 PDT 2015
On Wed, Oct 14, 2015 at 09:19:23PM +0000, Keith Busch wrote:
> We need to set REQ_INTEGRITY in req->cmd_flags here since requests
> submitted through blk_execute_rq don't copy the bio flags.
>
>> }
>>
>> blk_execute_rq(req->q, NULL, req, 0);
>
> And need to provide the gendisk instead of NULL so the nvme_map_data()
> -> nvme_dif_remap() doesn't dereference NULL to get the namespace's PI
> type; there are other ways to get to this, but setting the disk here
> looks the simplist from: ((struct nvme_ns *)q->queuedata)->disk;
>
> Similarly, we need to set bio->bi_bdev to 'bdev_get(ns->disk, 0)' to
> fix a NULL pointer in bio_integrity_advance in the completion path.
Do you have a patch that implements all your suggestions? I probably could
recreated it, but folding in a tested patch is way easier.
More information about the Linux-nvme
mailing list