Re: [PATCH] scsi_host sysfs updates scsi-misc-2.5 [0/2]

James Bottomley
2003-05-12T17:46:51Z

On Mon, 2003-05-12 at 12:50, James Bottomley wrote:
> Surprisingly, it still fails. I've debugged the refcounting and I see
> it fall to zero in scsi_host_put but the dev release method doesn't
> trigger for no reason I can see.
>
> It's probably a kobject initialisation problem somewhere.

OK, found it. the ->release is triggered by the kobj_kset, which isn't
set until device_add time, not device init time.

Therefore, we shouldn't really put and get objects until they've been
added (or the kobj_set_kset_s needs to be moved to device_initialize()).

The more I think about it, the more it does look like we need to
separate the partially initialized case from the fully initialized one,
so perhaps the initial patch I made and thought was awful may actually
turn out to be the more correct one.

James