[PATCH] nvme: honour O_NONBLOCK during resetting
Hannes Reinecke
hare at suse.de
Mon Nov 15 22:54:51 PST 2021
On 11/16/21 3:18 AM, Keith Busch wrote:
> On Tue, Nov 16, 2021 at 01:40:04AM +0000, Chaitanya Kulkarni wrote:
>> On 11/11/2021 2:59 AM, Hannes Reinecke wrote:
>>> When opening a controller device node we should honour the O_NONBLOCK
>>> flag to allow the device to be openend even if it's in state 'resetting'
>>> or 'connecting'. This allows user-space applications to use a call to 'open'
>>> to figure out if the controller is present, even if it's currently
>>> undergoing a reset.
>>>
>>> Signed-off-by: Hannes Reinecke <hare at suse.de>
>>
>> Will resetting and connecting ever result is deleting the controller due
>> to error cases present in that path ?
>>
>> If yes then application will have handle for something that might
>> go away in the future, should allow such a semantic ?
>
> Resets can happen at any time, so they already have to handle it even if the
> controller was live when they opened it. Perhaps the open should succeed for
> any non-terminal state.
>
Indeed. And we should add a state check for the ioctl itself, returning
an error when the device is not running.
I'll be sending an updated patchset.
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