Re: [linux-usb-devel] [PATCH] back out sysfs reference count change

From: Andrew Morton
Date: Tue Mar 30 2004 - 21:21:54 EST


Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> I think that the bug in the first place is to have an existing
> kobject that didn't bump the module ref count.
>
> If a kobject exists that have a pointer to the module code (the
> release function), it _MUST_ have bumped the module ref count,
> that's the whole point of the module reference count.
>
> If rmmod blocks forever because that kobject has a stale reference,
> that's a different problem, but khubd should not be involved in
> that process and should definitely not be blocked and not wait for
> the kobject to go away.

Amen, Brother Ben. I think the hangup here is that lsmod would show module
refcounts of 2,417. So for cosmetic reasons, the kobject should take a ref
against an intermediate kref, which has a single ref on the module.

But it looks like that's all in a faraway perfect world, and Greg is going
to fix stuff up somehow ;)

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/