Eh... You are trying to chase infinity with 'rmmod --wait'.
> diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5-bk/drivers/block/loop.c working-2.5-bk-loop/drivers/block/loop.c
> --- linux-2.5-bk/drivers/block/loop.c 2003-01-02 12:45:18.000000000 +1100
> +++ working-2.5-bk-loop/drivers/block/loop.c 2003-01-13 11:49:21.000000000 +1100
> @@ -642,7 +642,9 @@ static int loop_set_fd(struct loop_devic
> int lo_flags = 0;
> int error;
> - MOD_INC_USE_COUNT;
> + if (!try_module_get(THIS_MODULE))
> + /* I'm going away: pretend I'm not here. */
> + return -EBUSY;
> error = -EBUSY;
> if (lo->lo_state != Lo_unbound)
1) we do not prevent root from shooting themselves in the foot,
2) moreover we do not prevent them from doing something that may be
3) and this kind of code just adds error handling for no reason, when
_not_ handling the error keeps the code more clean.
In general this is just caring way too much about an obscure corner
case. Is the increased complexity of error handling when we _know_ the
refcnt is locked for worth it?
Note that Linus turned off the 'deprecated' warning because MOD.*COUNT
users are just too frequent, still.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to firstname.lastname@example.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/