[PATCH v3] nvme: fix nvme_ns_has_pi() to check PI size if metadata size or below
Keith Busch
kbusch at kernel.org
Tue Oct 22 12:20:44 PDT 2024
On Wed, Oct 23, 2024 at 03:10:54AM +0900, Tokunori Ikegami wrote:
> The PI is the first bytes or last bytes of the metadata.
> So its size is not equal to the metadata size only but below also.
This is still wrong because the only users of this function are with
respect to PRACT. If anything, you could change the name from "has_pi"
to "supports_pract", or something like that.
> static inline bool nvme_ns_has_pi(struct nvme_ns_head *head)
> {
> - return head->pi_type && head->ms == head->pi_size;
> + return head->pi_type && head->ms >= head->pi_size;
> }
More information about the Linux-nvme
mailing list