[PATCH 4.14-rc] nvme-rdma: Fix error status return in tagset allocation failure

Sagi Grimberg sagi at grimberg.me
Thu Oct 19 02:41:21 PDT 2017


>>   	if (new) {
>>   		ctrl->ctrl.admin_tagset = nvme_rdma_alloc_tagset(&ctrl->ctrl, true);
>> -		if (IS_ERR(ctrl->ctrl.admin_tagset))
>> +		if (IS_ERR(ctrl->ctrl.admin_tagset)) {
>> +			error = PTR_ERR(ctrl->ctrl.admin_tagset);
>>   			goto out_free_queue;
>> +		}
> 
> Can we return an error code instead and just pass in the tag set
> to be allocated instead of the admin flag?A  E.g.:
> 
> 	error = nvme_rdma_alloc_tagset(&ctrl->ctrl, &ctrl->ctrl.admin_tagset);
> 	if (error)
> 		goto out_free_queue;

We could, but that would mean that the nvme_ctrl tagset pointer will
need to be updated later (or from the routine itself).

I'm intending this code for nvme-core (and this would be ->alloc_tagset
callout) so ultimately I'd like to move the tagset embedding in struct
nvme_ctrl but given that its a hot-path reference, I suggest we hold it
back until we make struct nvme_ctrl arranged better for the hot path
dereferencing.



More information about the Linux-nvme mailing list