[PATCH v3] nvme: fix nvme_ns_has_pi() to check PI size if metadata size or below
Tokunori Ikegami
ikegami.t at gmail.com
Wed Oct 23 03:10:24 PDT 2024
Just fixed the function name as mentioned by the v4 patch. Thank you.
On 2024/10/23 4:20, Keith Busch wrote:
> 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