Messages in this thread | | | Date | Thu, 11 Apr 2013 17:39:16 +0200 | From | Veaceslav Falico <> | Subject | Re: [PATCH] module: add kset_obj_exists() and use it |
| |
On Thu, Apr 11, 2013 at 08:20:03AM -0700, Greg KH wrote: >On Thu, Apr 11, 2013 at 03:53:40PM +0200, Veaceslav Falico wrote: >> On Thu, Apr 11, 2013 at 06:28:31AM -0700, Greg KH wrote: >> >On Thu, Apr 11, 2013 at 11:55:37AM +0200, Veaceslav Falico wrote: ... >> >> In both examples we don't look at that kobject, and only uselessly >> _get()/_put() it. And it looks a bit ugly. After the patch, in both cases, >> it takes only one call to kset_obj_exists() to find out if the object >> exists at that time. > >But as your function does the same thing, logically it's the same code >path :) > >Anyway, yes, I understand your point here, and in some new code I'm >writing right now, we had to do much the same check as well. But as >there are only 2 in-kernel users of this "pattern", I don't think it's >justified to add a new api call for it, especially if it were to be >misused as you were attempting to use it, which would only mask the real >problem you were trying to solve.
Good point, it really might mask the real problem, as it would actually do for the initial race.
> >So, thanks for the idea, but for now, I'll pass.
Fair enough. Thank you for explaining :)
> >thanks, > >greg k-h
| |