Re: owner field in `struct fs'

From: Alexander Viro (viro@math.psu.edu)
Date: Sun Jun 25 2000 - 06:05:07 EST


On Sun, 25 Jun 2000, Andrew Morton wrote:

> Al, the problem we've hit with the netdevice drivers is that they are
> registered and appear in the namespace _when their refcount is zero_.
> That is, register_netdevice() is called from within the context of the
> module constructor. (Well, that's just one of the problems..)
>
> So netdevice methods such as open(), do_ioctl(), set_multicast_list(),
> etc can be and are called when the module refcount is zero.
>
> The act of inserting the module and the act of making the module's
> facilities available to the kernel shouldn't be coupled in this way
> because it _forces_ us to have an "open" driver whose module refcount is
> zero. I don't see a fix for this without a change to the way we handle
> netdevices. 'ifconfig tulip register' and 'ifconfig tulip unregister'.
> Fun.

No, that's obviously unacceptable. But I think that we can work around
that. What about placing try_inc_mod_count() in __get_dev_by_name()? (and
compensating for that afterwards, indeed).

I'm less than happy about ->do_ioctl(), though - are you sure that it can
happen with refcount==0? AFAICS it does not touch the reference counter
and it means that we need to be extra cautious inside...

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



This archive was generated by hypermail 2b29 : Mon Jun 26 2000 - 21:00:06 EST