>               case NVME_NS_DPS_PI_TYPE2:
>                       control |= NVME_RW_PRINFO_PRCHK_GUARD |
>                                       NVME_RW_PRINFO_PRCHK_REF;
> -                     cmnd->rw.reftag = cpu_to_le32(
> -                                     nvme_block_nr(ns, blk_rq_pos(req)));
> +                     cmnd->rw.reftag = cpu_to_le32(t10_pi_ref_tag(req));

Note that this changes behavior for non-512 byte block sizes.  But
I think these changes do the right thing..

Reply via email to