lkml.org 
[lkml]   [2014]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] USB: serial: fix sysfs-attribute removal deadlock
From
Date
On Fri, 2014-04-25 at 09:54 -0400, Alan Stern wrote:
> On Fri, 25 Apr 2014, Li Zhong wrote:
>
> > > I don't get why try_module_get() matters here. We can't call into
> > > ->store if the object at hand is already destroyed and the underlying
> > > module can't go away if the target device is still alive.
> > > try_module_get() doesn't actually protect the object. Why does that
> > > matter? This is self removal, right? Can you please take a look at
> > > kernfs_remove_self()?
> >
> > This is about one process writing something to driver attributes, and
> > one process trying to unload this driver.
> >
> > I think try_module_get() could detect whether the driver is being
> > unloaded, and if not, prevent it from being unloaded, so it could
> > protect the object here by not allow the driver to be unloaded.
>
> That isn't how try_module_get() works. If the module is being
> unloaded, try_module_get() simply fails. It does not prevent the
> module from being unloaded -- that's why its name begins with "try".

Yes, I know that. What I said above is for the case when
try_module_get() detects the driver is NOT being unloaded, and increases
the reference counter.

Thanks, Zhong
>
> Alan Stern
>




\
 
 \ /
  Last update: 2014-04-28 12:21    [W:0.162 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site