SCSI host numbers?

From: Itai Nahshon (
Date: Tue Jan 01 2002 - 20:19:45 EST


Under some scenarios Linux assigns the same
host_no to more than one scsi device.

Can someone tell me what is the intended behavior?

The problem is that a newly registered device gets
its host_no from max_scsi_host. max_scsi_host is
decremented when a device driver is unregistered
(see drivers/scsi/host.c) allowing a second new
host to reuse the same host_no.
A device that was already in use (but the module
was unloaded and reloaded gets its old host_no that
was kept in scsi_host_no_list. host_id's in scsi_host_no_list
can also be reserved at boot time (though I never tried that).

This rarely happens except when there are two or more
dynamic scsi hosts (I had i with ide-scsi and usb-storage).

I could mount devices even when they were on conflicting
host numbers (/dev/sda on usb-storage and /dev/scd0
on ide-scsi). I could access only one of the devices
via the generic-scsi interface (/dev/sgX). I do not know
what other things can get broken if scsi host get conflicting
host id.

This was tried on linux-2.4.9 (RedHat). I looked at newer
kernels but did not see an obvious fix.

Similar bug reported also to redhat. See:

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

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:16 EST