[PATCH V11 2/4] nvmet: add ZBD over ZNS backend support

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Thu Mar 11 05:41:38 GMT 2021


On 3/10/21 21:39, Damien Le Moal wrote:
>>>> +	nr_zones = (bufsize - sizeof(struct nvme_zone_report)) /
>>>> +			sizeof(struct nvme_zone_descriptor);
>>> What if nr_zones is 0 ? This should be failed.
>> blkdev_report_zones() already handles that check. I thinkthe error condition
>> below blkdev_report_zones() should include<= 0 case instead of just <.
> Reporting 0 zones with a valid buffer size (nr_zones > 0) is a valid reply, not
> an error. This can happen depending on reporting options. Even though
> blkdev_report_zones() does not allow reporting options, it would be strange to
> fail empty reports.
>

I see, will add the check before calling the blkdev_report_zones() for
nr_zones == 0.

Thanks for the clarification.






More information about the Linux-nvme mailing list