[lkml]   [2018]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/2] drivers: core: Remove glue dirs from sysfs earlier
On Sat, Jun 30, 2018 at 8:42 PM Benjamin Herrenschmidt
<> wrote:
> But what if something *else* still holds a reference to the kobject ?
> It could be anything really... t

But that's fine. Then the object will continue to exist, and the sysfs
file will continue to exist, and you won't get a new glue directory.

In fact, what you describe is a problem with *your* patch, exactly
because you introduce another counter that is *not* the reference
count, and now you have the problem with "old directory kobject is
still live, but I removed the sysfs part, and now I'm creating a new
object with the same name".


> It is and there's a WARN_ON about it inside kobject_get(). I don't
> think anybody argues against that, you are absolutely right.

No. That the zero kobject_get() will not result in a warning. It just
does a kref_get(), no warnings anywhere.

Yes, there is a kobject_get() warning, but that's about an
_uninitialized_ kobject, not a already released one! You will get no
warning that I can see from the "oh, you just got a stale one".


 \ /
  Last update: 2018-07-01 05:58    [W:0.075 / U:2.972 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site