> The question then becomes one of how do I distinguish a race condition from
> a legitimate load/unload cycle?
> Isn't the problem here just the misuse of rmmod -a? Perhaps we should
> attach a warning to the documentation to indicate the possible badness that
> can happen.
Not really. _Any_ use of rmmod -a (i.e. unload stuff not in use) can
trigger that.
As for legitimate load/unload cycle... in this situation thing should be
considered busy. It's that simple - what happens here is that we are asking
for module because we want to make it busy as soon as we get it. Race
window is between the sys_create_module() from modprobe and try_inc_use_count()
in whatever wants it in the kernel or sys_init_module() for module depending
on it.
IOW, unload is _not_ legitimate here.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/