[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c21c7b3d-81b8-d2ce-b5d0-42028984b93a@deltatee.com>
Date: Sat, 11 Feb 2017 10:59:04 -0700
From: Logan Gunthorpe <logang@...tatee.com>
To: Dan Williams <dan.j.williams@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Johannes Thumshirn <jthumshirn@...e.de>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>,
Sajjan Vikas C <vikas.cha.sajjan@....com>,
Arnd Bergmann <arnd@...db.de>, Jan Kara <jack@...e.cz>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>
Subject: Re: [PATCH] device-dax: don't set kobj parent during cdev init
On 11/02/17 01:56 AM, Dan Williams wrote:
> When the device is unregistered it invalidates all existing mappings,
> but the driver may continue to service vm fault requests until the
> final put of the cdev. Until that time the fault handler needs to be
> able to check dax_dev->alive. Since the final cdev put is handled by
> the vfs I use the cdev's kobject to keep the struct dax_dev instance
> alive.
I'm just taking a wild stab at this, but would it not make sense to just
take a reference to the dax_dev device in dax_open and put it back it in
dax_release? (Or perhaps, in the open/close of the vm_ops.) That way the
structure won't be free'd until there are no users and alive will always
be accessible.
It would also be a bit more clear as to what's going on because you are
actually making a reference in filp->private_data.
Logan
Powered by blists - more mailing lists