[PATCH] nvme-core: update NS Attr Changed AEN handling for ANA group

Hannes Reinecke hare at suse.de
Fri Dec 4 09:40:49 EST 2020


On 11/26/20 5:16 PM, George, Martin wrote:
> On Mon, 2020-11-23 at 11:43 -0800, Keith Busch wrote:
>> On Mon, Nov 23, 2020 at 07:29:05PM +0000, George, Martin wrote:
>>> On Mon, 2020-11-23 at 11:16 -0800, Sagi Grimberg wrote:
>>>> This looks like a good simple solution to me...
>>>>
>>>>> ---
>>>>> diff --git a/drivers/nvme/host/multipath.c
>>>>> b/drivers/nvme/host/multipath.c
>>>>> index 74896be40c17..300cff8c616d 100644
>>>>> --- a/drivers/nvme/host/multipath.c
>>>>> +++ b/drivers/nvme/host/multipath.c
>>>>> @@ -667,6 +667,8 @@ void nvme_mpath_add_disk(struct nvme_ns
>>>>> *ns,
>>>>> struct nvme_id_ns *id)
>>>>>                if (desc.state) {
>>>>>                        /* found the group desc: update */
>>>>>                        nvme_update_ns_ana_state(&desc, ns);
>>>>> +             } else {
>>>>> +                     nvme_read_ana_log(ctrl);
>>>
>>> Shouldn't this be nvme_read_ana_log(ns->ctrl)?
>>
>> Oops, I just did a quick copy-paste. You are correct.
> 
> If there is no further feedback, could we move ahead with this fix? Or
> does it need to be sent as a separate patch first?
> 
I'm not _that_ happy with this approach, as we're doing I/O in the 
middle of an unrecoverable section; if reading the ANA log fails we have 
no way to recover, and end up with a namspace in an undefined state; 
actually it looks as if the namespace will then be presented to the OS
with no ANA information whatsoever, and we can just hope that it's not 
part of a multipathed namespace, otherwise we're screwed.

I'd rather hook in the ana log parsing into the AEN handling code, such 
that we're re-reading the ANA log for every NS CHANGED AEN before 
calling nvme_queue_scan(). That way we have a clear recovery path and 
won't need to worry about duplicate namespaces.

Patch to follow.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare at suse.de                              +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer



More information about the Linux-nvme mailing list