[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200703091745.00169.oneukum@suse.de>
Date: Fri, 9 Mar 2007 17:44:59 +0100
From: Oliver Neukum <oneukum@...e.de>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Maneesh Soni <maneesh@...ibm.com>, gregkh@...e.de,
linux-kernel@...r.kernel.org
Subject: Re: refcounting drivers' data structures used in sysfs buffers
Am Freitag, 9. März 2007 17:32 schrieb Alan Stern:
> On Fri, 9 Mar 2007, Oliver Neukum wrote:
>
> > Am Donnerstag, 8. März 2007 17:02 schrieb Alan Stern:
> > > On Thu, 8 Mar 2007, Oliver Neukum wrote:
> > >
> > > > Hi,
> > > >
> > > > after a lightning bolt from high above I've been looking into refcounting
> > > > the data structures drivers use to provide the data used to refill sysfs
> > > > buffers. I've come to the following conclusion.
> > > >
> > > > 1. struct sysfs_buffer must have a struct kref * and probably a destructor
> > > > pointer
> > > > 2. drivers must be able to pass these pointers through an extended
> > > > device_create_file()
> > > > 3. Drivers must use refcounting if they want to use attributes
> > > > 4. read/write/poll must do refcounting
> > > >
> > > > I am not sure where to store the pointers. struct sysfs_dirent() looks
> > > > like the obvious choice. Comments?
> > >
> > > Can you explain the reasoning that led to these conclusions? And what
> > > exactly was your lightning bolt?
> >
> > The old race between disconnect and IO to attribute via sysfs again.
> > If I cannot disassociate the drivers from the buffers in the buffers, drivers
> > must not deallocate the data necessary to answer sysfs callbacks while
> > a buffer exists.
>
> Why wouldn't you be able to dissociate a driver from a buffer? That was
> the whole point of adding .orphan to sysfs_buffer and creating
> sysfs_buffer_collection -- it was supposed to solve exactly this race.
It did solve the race but deadlocked when unbinding devices through sysfs.
Linux therefore asked for the patch to be reverted and wants the isue solved
with refcounting.
Regards
Oliver
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists