Re: Hundreds of bugs in 2.3.99-pre3

From: Manfred Spraul (manfreds@colorfullife.com)
Date: Sat Apr 01 2000 - 07:03:51 EST


From: "Mitchell Blank Jr" <mitch@sfgoth.com>
>

> > Yes, but what if module_exit() sleeps _before_ it unlinks itself from
these
> > lists?
>
> I guess that's true.. I doubt its very common, though.
>

most functions are ok, but check scsi_unregister_host():

/*
 * Similarly, this entry point should be called by a loadable module if it
 * is trying to remove a low level scsi driver from the system.
 *
 * Note - there is a fatal flaw in the deregister module function.
 * There is no way to return a code that says 'I cannot be unloaded now'.
 * The system relies entirely upon usage counts that are maintained,
 * and the assumption is that if the usage count is 0, then the module
 * can be unloaded.
 */

If we check all module load functions, then we should try to fix the unload
races as well.

Perhaps we should split the unregister_xy() function that sleep into 2
parts:
the first part removes the entry from the linked lists, and this part never
sleeps.
The second part performs the final cleanup, that part can sleep.

unregister_binfmt()
unregister_blkdev()
unregister_chrdev()
unregister_filesystem(): OK, never sleep.

devfs_xy(): ??
scsi_unregister(): seems bad.
unregister_netdevice(): ?? a notifier chain is called, I don't know if these
functions can sleep.

-
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 : Fri Apr 07 2000 - 21:00:07 EST