Solved, I think. Observe ide-tape's module_exit() procedure idetape_exit():
>static void __exit idetape_exit (void)
>{
> ide_drive_t *drive;
> int minor;
>
> for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) {
> drive = idetape_chrdevs[minor].drive;
> if (drive != NULL && idetape_cleanup(drive))
> printk(KERN_ERR "ide-tape: %s: cleanup_module() "
> "called while still busy\n", drive->name);
> }
>#ifdef CONFIG_PROC_FS
> if (drive->proc)
> ide_remove_proc_entries(drive->proc, idetape_proc);
>#endif
>
> ide_unregister_module(&idetape_module);
>}
In the "if (drive->proc)" line, drive==NULL when I rmmod ide-tape,
causing the oops.
I'm not sure if ide_remove_proc_entries() is needed or not,
but the current code is obviously broken.
- ide_unregister_module() removes ide-tape's proc entry
(/proc/ide/ideX/hdY/name) for us, at least that's what happens
on my box after I commented out the entire "if (drive->proc) ..."
statement to prevent the oops. So possibly the call should be deleted.
- ide-disk/ide-floppy do the test&call inside the loop rather than after,
so possibly the call should be moved into the loop, and augmented
to be "if (drive && drive->proc) ide_remove_proc_entries(...)".
/Mikael
-
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/