sd_mod bug

From: Yann DRONEAUD (
Date: Thu May 25 2000 - 04:07:27 EST


Try to unloading sd_mod lock up my computer

Arch: Pentium
SCSI card: aha1522
All SCSI drivers compiled as modules

There is no attached device to the aha1520 card.

I load module scsi_mod, aha152x, sd_mod:
  the card is found (1 host, no device)
Then if I try to unload sd_mod, it lock up my computer

I look at the sd_mod source drivers/scsi/sd.c

In function cleanup_module
  for (i = 0; i <= (sd_template.dev_max - 1) / SCSI_DISKS_PER_MAJOR; i++)
    devfs_unregister_blkdev(SD_MAJOR(i), "sd");
I put some printk() to check the value of sd_template.dev_max and sd_registered
when entering in the function sd_template.dev_max = 0, sd_registered = 0
The for loop is made (it's take some time, ALT-SYSREQ work (but can't

for (i = 0; i <= (sd_template.dev_max - 1) / SCSI_DISKS_PER_MAJOR; i++) {
                blk_size[SD_MAJOR(i)] = NULL;
                hardsect_size[SD_MAJOR(i)] = NULL;
                read_ahead[SD_MAJOR(i)] = 0;
printk again: sd_template.dev_max = 0, sd_registered = -1;
After that computer is locked (ALT-SYSRQ did not respond)
Some times computer reboots...

I think it left some
if (sd_template.dev_max)
But i think this is not simple...

Yann Droneaud <>

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to Please read the FAQ at

This archive was generated by hypermail 2b29 : Wed May 31 2000 - 21:00:13 EST