Oh, duh! Now I remember why it is broken. I ran across it when I
redid the queueing code, and it struck me that not many people could be
using the existing code, because there was no way that it could have
worked. I *think* I fixed the problem in the new queueing code, but we
will find out for sure once it hits the street.
The single lun code basically needs to figure out if any of the
other luns for the physical device are active or not. It does this by
walking the command blocks for the device and seeing whether any of them
are active.
In the old days, the command blocks were all pre-allocated for all
devices, and attached in a huge linked list. On systems with many
devices, there were obvious performance problems searching a really long
list, and thus the list was split. I recall that first it was split by
host, and then later by device.
In the context of the SCSI mid-layer, each LUN is treated as a
separate physical device. The old single-lun code was basically getting
the list (containing command blocks for all devices attached to the host)
and walking it to see if any other command blocks for the same channel and
target id were busy. As things currently stand, each Scsi_Device
structure (corresponding to a single LUN) contains only the command blocks
for that same LUN. Searching that list will always yield the result that
none of the other LUNs for the device are busy.
I don't have the code in front of me, but the "quick" fix for the
problem is that in the single-lun case we need to add an outer loop which
iterates over all of the devices attached to the host, and then for each
device that has the same target ID and channel number, then search the
command blocks for anyone that is busy.
I should add, however, that in the long run this isn't the right
fix. There is a known problem where we over-allocate the command blocks
with the current pre-allocation scheme, and someday someone needs to go in
and fix it. The memory consumption can get to be quite considerable in
some cases. I suppose that at the same time the over-allocation bug is
fixed that we also fix the single-lun code to be a lot more bulletproof.
-Eric
"The world was a library, and its books were the stones, leaves,
brooks, grass, and the birds of the earth. We learned to do what only
a student of nature ever learns, and that was to feel beauty."
Chief Luther Standing Bear - Teton Sioux
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]