Re: owner field in `struct fs'

From: Alexander Viro (viro@math.psu.edu)
Date: Mon Jun 26 2000 - 12:48:14 EST


On Mon, 26 Jun 2000, David Woodhouse wrote:

>
> viro@math.psu.edu said:
> > Module removal can not start until the counter is zero, what are you
> > talking about?
>
> In any case where code blindly uses MOD_INC_USE_COUNT rather than
> try_inc_mod_count(), the counter can be non-zero by the time
> cleanup_module() is entered.

Erm... There is one case when MOD_INC_USE_COUNT is kosher and even needed,
but it's pretty convoluted. Consider modules A, B and C.
        A provides register_foo() and unregister_foo()
        B provides foo1
        C does register_foo(&foo1) and unregister_foo(&foo1) for ioctls on
some device.

Notice that C depends on A and B, but A and B are independent. However,
once foo1 is registered we want A to be pinned down. MOD_INC_USE_COUNT in
register_foo() is OK here - C depends on A and if we have C around the A
will stay there...

-
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:09 EST