public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Keith Busch <kbusch@kernel.org>,
	linux-nvme@lists.infradead.org, Sagi Grimberg <sagi@grimberg.me>,
	Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>,
	Hannes Reinecke <hare@suse.de>
Subject: Re: [PATCH v2] nvme: avoid "(efault)" from nvme_sysfs_show_subsysnqn()
Date: Wed, 03 Feb 2021 13:31:13 +0100	[thread overview]
Message-ID: <a7f3114e22a07e60abfd98155df91dea3a83b386.camel@suse.com> (raw)
In-Reply-To: <20210202075828.GA12160@lst.de>

On Tue, 2021-02-02 at 08:58 +0100, Christoph Hellwig wrote:
> On Tue, Feb 02, 2021 at 01:59:51AM +0100, mwilck@suse.com wrote:
> > From: Martin Wilck <mwilck@suse.com>
> > 
> > While a controller is still connecting, ctrl->subsys is NULL and
> > thus reading the controller's "subsysnqn" sysfs attribute returns
> > "(efault)". This happens all the time when user space processes
> > "add" events for NVMe controller devices.
> > 
> > Fix it by returning the nvmf_ctrl_options' subsysnqn attribute
> > if ctrl->subsys isn't initialized yet.
> 
> This is just papering over symptoms.  We should not be sending
> events or display sysfs files until the controlle is live.

I don't follow. What's wrong with a "connecting" controller device in
sysfs? 

Controllers can loose connectivity any time. What's the difference
between a controller that is reconnecting after a connection loss and a
freshly created controller that's just not live yet? You wouldn't
delete the former from sysfs, I suppose.

From the user space point of view, it's the same, a controller device
that is not in usable state. I don't see a general problem with that.
Seeing a controller appear in connecting state might actually be useful
for user space.

The subsysnqn attribute is correct for controllers that were once
connected and lost connectivity. My patch was only intended to fix the
"just created and never connected" case, where it is not, nothing more.

Regards
Martin

> 
> In other wwords - I think we should remove the cdev_device_add
> from nvme_init_ctrl to nvme_start_ctrl (+ any error handling changes
> resulting from that).
> 



_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2021-02-03 12:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-02  0:59 [PATCH v2] nvme: avoid "(efault)" from nvme_sysfs_show_subsysnqn() mwilck
2021-02-02  1:34 ` Chaitanya Kulkarni
2021-02-02  7:58 ` Christoph Hellwig
2021-02-03 10:01   ` Sagi Grimberg
2021-02-03 12:31   ` Martin Wilck [this message]
2021-02-03 16:51     ` Christoph Hellwig
2021-02-03 16:52     ` Keith Busch
2021-02-03 22:19       ` Sagi Grimberg
2021-02-04  2:42         ` Keith Busch
2021-02-04  7:44           ` Sagi Grimberg

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=a7f3114e22a07e60abfd98155df91dea3a83b386.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=Chaitanya.Kulkarni@wdc.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox