Linus Torvalds writes: (Summary) Pick
one of two scenarios:
one of two scenarios:
(a) it's obviously correct.
(a) it's obviously correct.
We obviously can *not* take an object with a zero refcount, because it is already been scheduled for kobject_cleanup(), and incrementing the refcount is simply fundamentally wrong, because incrementing the refcount won't unschedule the deletion of the object. Which means that (a) is the right reaction, and "kobject_get()" on an object with a zero refcount is _always_ wrong.
refcount is _always_ wrong.
But that says that "yes, the patch is obviously correct", but it also says "the patch should be pointless, because kobject_get() should just _always_ have the semantics of "kobject_get_unless_zero()", and the latter shouldn't even exist.
latter shouldn't even exist.
Greg?
one of two scenarios:
(a) it's obviously correct.
(a) it's obviously correct.
We obviously can *not* take an object with a zero refcount, because it is already been scheduled for kobject_cleanup(), and incrementing the refcount is simply fundamentally wrong, because incrementing the refcount won't unschedule the deletion of the object. Which means that (a) is the right reaction, and "kobject_get()" on an object with a zero refcount is _always_ wrong.
refcount is _always_ wrong.
But that says that "yes, the patch is obviously correct", but it also says "the patch should be pointless, because kobject_get() should just _always_ have the semantics of "kobject_get_unless_zero()", and the latter shouldn't even exist.
latter shouldn't even exist.
Greg?