[PATCH 3/3] nvme-core: fix crash when nvme_enable_aen timeout

Sagi Grimberg sagi at grimberg.me
Fri Aug 21 16:17:27 EDT 2020


>>>> -static void nvme_enable_aen(struct nvme_ctrl *ctrl)
>>>> +static int nvme_enable_aen(struct nvme_ctrl *ctrl)
>>>>    {
>>>>        u32 result, supported_aens = ctrl->oaes & NVME_AEN_SUPPORTED;
>>>>        int status;
>>>>        if (!supported_aens)
>>>> -        return;
>>>> +        return 0;
>>>>        status = nvme_set_features(ctrl, NVME_FEAT_ASYNC_EVENT, supported_aens,
>>>>                NULL, 0, &result);
>>>> -    if (status)
>>>> +    if (status) {
>>>>            dev_warn(ctrl->device, "Failed to configure AEN (cfg %x)\n",
>>>>                 supported_aens);
>>>> +        if (status < 0)
>>>> +            return status;
>>>
>>> Why do you need to check status < 0, you need to fail it regardless.
>>
>> agree.
>> Just want to keep the old logic. I guess the old logic: if supported_aens
>> is true, the result of set features can ignore.
>>
>> If there is no objection to doing so, I will resend the patch later.
> 
> In the past we've dedice to ignore real NVMe errors in various
> spots as the functionality wasn't deemed critical.  I think that is
> pretty sloppy and we should only do that where we really have to.

Agreed.



More information about the Linux-nvme mailing list