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

Chaitanya Kulkarni chaitanyak at nvidia.com
Mon Jan 17 00:50:29 PST 2022


Keith,

On 1/13/22 08:28, Keith Busch wrote:
> External email: Use caution opening links or attachments
> 
> 
> On Tue, Jan 11, 2022 at 10:21:01PM -0800, Chaitanya Kulkarni wrote:
>> From: Chaitanya Kulkarni <kch at nvidia.com>
>>
>> In function nvmf_dev_show() if we don't find the controller set the
>> ret variable to -ENODEV.
>>
>> Signed-off-by: Chaitanya Kulkarni <kch at nvidia.com>
>> Suggested-by: Sagi Grimberg <sagi at grimberg.me>
>> ---
>>   drivers/nvme/host/fabrics.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c
>> index df0326db306f..ca23ac926710 100644
>> --- a/drivers/nvme/host/fabrics.c
>> +++ b/drivers/nvme/host/fabrics.c
>> @@ -1097,6 +1097,7 @@ static int nvmf_dev_show(struct seq_file *seq_file, void *private)
>>        ctrl = seq_file->private;
>>        if (!ctrl) {
>>                __nvmf_concat_opt_tokens(seq_file);
>> +             ret = -ENODEV;
>>                goto out_unlock;
>>        }
> 
> 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)

-ck




More information about the Linux-nvme mailing list