[PATCH v4] nvme: change nvme_ns_has_pi() to nvme_ns_supports_pract()
Tokunori Ikegami
ikegami.t at gmail.com
Wed Oct 23 09:33:40 PDT 2024
On 2024/10/24 0:11, Keith Busch wrote:
> The important point for those MS>8 formats is the host *must* provide a
> buffer for the transfer, otherwise you'll get corruption. This means
> those formats are not usable if your kernel didn't set
> CONFIG_BLK_DEV_INTEGRTY, or you have a fabrics transport that doesn't
> support these.
>
> The format where MS == PI size can still work without
> CONFIG_BLK_DEV_INTEGRTY or fabrics support because the the pr-action
> disables the host<->device transfers.
Okay I will do study more later about the block device integrity feature.
> The function, nvme_ns_has_pi(), is specifically looking for the formats
> that don't require the host to provide a metadata buffer. The comment
> above the function says exactly this:
>
> "NVMe ns supports metadata actions by the controller (generate/strip)"
>
> The only time that happens with PRACT is if metadata size equals the PI
> size. Section 2.1.5, Figure 9 says this more succiently.
Now I could understand fully with your advice including the driver
implementation and the section 5.3.2 also checked again.
> It should work fine with any MS>PI size as long as the disk can
> successfully register with blk_integrity, which again, depends on your
> kernel config and transport type. That block layer can handle protection
> information with extra metadata in the same buffer.
Noted this also. Thank you so much for your explanation.
More information about the Linux-nvme
mailing list