[PATCH 1/4] nvmet: change sn size and check validity

Chaitanya Kulkarni Chaitanya.Kulkarni at wdc.com
Thu Apr 22 20:11:56 BST 2021


On 4/22/21 01:50, Max Gurtovoy wrote:
>>> -/* See Section 1.5 of NVMe 1.4 */
>>> -static bool nvmet_is_ascii(const char c)
>>> -{
>>> -	return c >= 0x20 && c <= 0x7e;
>>> -}
>>> -
>>>   static ssize_t nvmet_subsys_attr_model_store_locked(struct nvmet_subsys *subsys,
>>>   		const char *page, size_t count)
>>>   {
>>> diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
>>> index adbede9ab7f3..3efd48b0a34e 100644
>>> --- a/drivers/nvme/target/core.c
>>> +++ b/drivers/nvme/target/core.c
>>> @@ -1482,6 +1482,7 @@ struct nvmet_subsys *nvmet_subsys_alloc(const char *subsysnqn,
>>>   		enum nvme_subsys_type type)
>>>   {
>>>   	struct nvmet_subsys *subsys;
>>> +	char serial[NVMET_SN_MAX_SIZE / 2];
>> This needs a comment why NVMET_SN_MAX_SIZE / 2.
> explain bin2hex ?
>
>

I'm not sure, I'll leave it to Christoph and Sagi.





More information about the Linux-nvme mailing list