All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: kbusch@kernel.org, sagi@grimberg.me,
	linux-nvme@lists.infradead.org,
	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>,
	hch@lst.de
Subject: Re: [PATCH 1/3] nvme: decouple nvme_ctrl_get_by_path()
Date: Sat, 5 Sep 2020 09:20:18 +0200	[thread overview]
Message-ID: <20200905072018.GA13403@lst.de> (raw)
In-Reply-To: <16dc2193-9830-6184-e7f6-ceaca5f0aaf0@deltatee.com>

On Fri, Sep 04, 2020 at 09:54:48AM -0600, Logan Gunthorpe wrote:
> 
> 
> On 2020-09-03 8:39 p.m., Chaitanya Kulkarni wrote:
> > Right now nvme_ctrl_get_by_path() accepts ctrl path, based on that it
> > opens a file and calls nvme_get_ctrl(). In order to take module
> > refcount it is important to distinguish the error between file_open()
> > and module file ops check so that we can unwind the code in the caller
> > nvmet_passthru_ctrl_enable() in the error path.
> > 
> > Rename nvme_ctrl_get_by_path() -> nvme_ctrl_get_by_file() and lift
> > the file opening and error handling in the caller so that we can unwind
> > appropriately in the error path.
> 
> I still don't really like this idea. No need to keep a reference to a
> whole other file.

We could still lift the filp_open into the caller, but drop the file
reference right after we got the controller reference.

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

  reply	other threads:[~2020-09-05  7:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  2:39 [PATCH 0/3] nvme: fix module ref count Oops Chaitanya Kulkarni
2020-09-04  2:39 ` [PATCH 1/3] nvme: decouple nvme_ctrl_get_by_path() Chaitanya Kulkarni
2020-09-04 15:54   ` Logan Gunthorpe
2020-09-05  7:20     ` Christoph Hellwig [this message]
2020-09-05 22:57       ` Chaitanya Kulkarni
2020-09-08  8:49         ` Christoph Hellwig
2020-09-08 15:36         ` Logan Gunthorpe
2020-09-04  2:39 ` [PATCH 2/3] nvme: move get/put ctrl into dev open/release Chaitanya Kulkarni
2020-09-04 15:55   ` Logan Gunthorpe
2020-09-08  8:52   ` Christoph Hellwig
2020-09-04  2:39 ` [PATCH 3/3] nvme-core: fix nvme module ref count Oops Chaitanya Kulkarni
2020-09-04 15:57   ` Logan Gunthorpe
2020-09-05 22:03     ` Chaitanya Kulkarni
2020-09-08 15:33       ` Logan Gunthorpe
2020-09-08  8:54     ` Christoph Hellwig
2020-09-08  8:54   ` Christoph Hellwig

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=20200905072018.GA13403@lst.de \
    --to=hch@lst.de \
    --cc=chaitanya.kulkarni@wdc.com \
    --cc=kbusch@kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=logang@deltatee.com \
    --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.