[PATCH 5/5] nvme-fabrics: set ret to -ENODEV for error case

Sagi Grimberg sagi at grimberg.me
Wed Jan 19 03:24:22 PST 2022


>>>> I missed the discussion on this. Doesn't the __nvmf_concat_opt_tokens()
>>>> already return parameters that indicate to the caller that no controller
>>>> was found?
>>>>
>>>
>>> The function I found in the repo returns nothing, is that the one you
>>> are referring to ?
>>>
>>> static void __nvmf_concat_opt_tokens(struct seq_file *seq_file)
>>
>> This is the path that Hannes added for userspace to detect kernel
>> capabilities. So probably its not appropriate to return an error
>> here, but rather take care of the original warning instead.
> 
> When I look at the code it looks unconventional to not return
> error when controller not found case, why is it not appropriate
> to return error can you please explain ?
> 
> Can we add a meaningful comment to avoid future such patches.

That is how Hannes proposed to read capabilities from the kernel
in terms of valid connection string arguments. Read /dev/nvme-fabrics
without a controller.



More information about the Linux-nvme mailing list