Messages in this thread | | | Subject | Re: [PATCH v2 2/2] drivers: core: Remove glue dirs from sysfs earlier | From | Benjamin Herrenschmidt <> | Date | Wed, 11 Jul 2018 09:31:05 +1000 |
| |
On Tue, 2018-07-10 at 16:55 +0200, Greg Kroah-Hartman wrote: > > > +/** > > + * kobject_has_children - Returns whether a kobject has children. > > + * @kobj: the object to test > > + * > > + * This will return whether a kobject has other kobjects as children. > > + * > > + * It does NOT account for the presence of attribute files, only sub > > + * directories. It also assumes there is no concurrent addition or > > + * removal of such children, and thus relies on external locking. > > + */ > > +static inline bool kobject_has_children(struct kobject *kobj) > > +{ > > + WARN_ON_ONCE(kref_read(&kobj->kref) == 0); > > Why warn on? Who is going to hit this and how are you going to fix up > the syzbot reports? :)
Well, that's it, the hope is nobody ever hits it ... but if one does it would be useful to get a backtrace to figure it out. You can shoot the reports my way I suppose :-)
> Anyway, this looks good, I can just take this and not the 1/2 patch now, > right? I really didn't like that patch.
Yes, it will fix the practical problem. As for patch 1, it's rather funny, you and Linus seem to have a completely opposite idea of how this stuff should work :-)
Cheers, Ben.
> thanks, > > greg k-h
| |