All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Chaitanya Kulkarni <chaitanyak@nvidia.com>
Cc: Sagi Grimberg <sagi@grimberg.me>,
	Keith Busch <keith.busch@wdc.com>, Christoph Hellwig <hch@lst.de>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH] nvme: honour O_NONBLOCK during resetting
Date: Tue, 16 Nov 2021 07:52:29 +0100	[thread overview]
Message-ID: <b1c012d9-475a-8c71-cb00-4b5dfedd0a33@suse.de> (raw)
In-Reply-To: <9c8da771-c5f9-923c-4c03-5d5ac8392ef8@nvidia.com>

On 11/16/21 2:40 AM, 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@suse.de>
> 
> Will resetting and connecting ever result is deleting the controller due
> to error cases present in that path ?
> 
Yes, of course this might happen.

> If yes then application will have handle for something that might
> go away in the future, should allow such a semantic ?
> I am not sure I follow.
Even today an application can open the device, and even now error 
recovery can result in the device now going away.
And even today it'll be possible that error recovery sets the device
to 'RESETTING' after the open call.

So I don't think that we need to treat things special because of this patch.

Whether or not the call to nvme_dev_ioctl() should be protected by an 
explicit state check is a different point, though; that does have some 
benefits seeing that the timing between open() and ioctl() is pretty 
much up to the application, and hence we shouldn't assume that the state 
doesn't change in between.
But really it should be done in a different patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                Kernel Storage Architect
hare@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


      parent reply	other threads:[~2021-11-16  6:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 10:59 [PATCH] nvme: honour O_NONBLOCK during resetting Hannes Reinecke
2021-11-16  1:40 ` Chaitanya Kulkarni
2021-11-16  2:18   ` Keith Busch
2021-11-16  6:54     ` Hannes Reinecke
2021-11-16  6:52   ` Hannes Reinecke [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1c012d9-475a-8c71-cb00-4b5dfedd0a33@suse.de \
    --to=hare@suse.de \
    --cc=chaitanyak@nvidia.com \
    --cc=hch@lst.de \
    --cc=keith.busch@wdc.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.