[PATCH V2 6/6] nvme-pci: remove .init_request callback

Sagi Grimberg sagi at grimberg.me
Sun Dec 24 00:50:24 PST 2017


> Please prepare a formal one(at least tested in normal case), either I
> or Zhang Yi may test/verify it.

OK.

>> @@ -1387,10 +1385,7 @@ static int nvme_alloc_sq_cmds(struct nvme_dev *dev,
>> struct nvme_queue *nvmeq,
>>   static struct nvme_queue *nvme_alloc_queue(struct nvme_dev *dev, int qid,
>>                                                          int depth, int node)
>>   {
>> -       struct nvme_queue *nvmeq = kzalloc_node(sizeof(*nvmeq), GFP_KERNEL,
>> -                                                       node);
>> -       if (!nvmeq)
>> -               return NULL;
>> +       struct nvme_queue *nvmeq = &dev->queues[qid];
> 
> Maybe you need to zero *nvmeq again since it is done in current code.

Relying on this is not a good idea, so I think we better off without
it because I want to know about it and fix it.

>> @@ -2470,8 +2465,9 @@ static int nvme_probe(struct pci_dev *pdev, const
>> struct pci_device_id *id)
>>          dev = kzalloc_node(sizeof(*dev), GFP_KERNEL, node);
>>          if (!dev)
>>                  return -ENOMEM;
>> -       dev->queues = kzalloc_node((num_possible_cpus() + 1) * sizeof(void
>> *),
>> -                                                       GFP_KERNEL, node);
>> +
>> +       alloc_size = (num_possible_cpus() + 1) * sizeof(struct nvme_queue
>> *);
> 
> The element size should be 'sizeof(struct nvme_queue)'.

Right.



More information about the Linux-nvme mailing list