Is this a known problem with the SCSI mid layer?
Quoted 17 lines · [email protected] wrote:
Quoted 3 lines · [email protected] wrote:
Quoted 2 lines · Douglas Gilbert
Quoted 1 line · [email protected] wrote:
I'm seeing a problem which I think is a problem in the SCSI mid layer.
[...]
Quoted 1 line
Quoted 1 line
Quoted 1 line
Remove the device while something has it open:
[...]
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[root@slicer ~]# rmmod hpsa
ERROR: Module hpsa is in useThe sg driver's open method takes a reference to the underlying SCSI device representation of the mid layer. Among else, this step increases the module use count of the respective low-level driver (transport layer driver) so that the SCSI mid layer can be sure that function pointers to driver methods stay valid during the lifetime of the SCSI device representation.
Quoted 8 lines
This reference taking is of course being reversed when the sg driver finishes its last uses of the underlying SCSI device. This may be at the respective
close()or even later.In short, it is normal, expected, and necessary what you are seeing.
Signature · 1 line
Stefan Richter
I don't think you are correct. Look more closely at my test cases.
When I attempt the rmmod, *nothing* has the device open. The last close has already occurred -- albeit *after* the device was removed.
In my test, the module *never* becomes rmmod-able. Doesn't matter how long you wait, and nothing will ever decrement the reference count.
Are you saying that this is correct behavior, that once a device is removed while a process has it open that it shoule *never* be rmmod'able?
Because that is the behavior I am seeing.
-- steve
Quoted 17 lines · Stephen Cameron
Quoted 7 lines · [email protected] wrote:
The sg driver's open method takes a reference to the underlying SCSI device representation of the mid layer. Among else, this step increases the module use count of the respective low-level driver (transport layer driver) so that the SCSI mid layer can be sure that function pointers to driver methods stay valid during the lifetime of the SCSI device representation.
Quoted 8 lines
This reference taking is of course being reversed when the sg driver finishes its last uses of the underlying SCSI device. This may be at the respective
close()or even later.In short, it is normal, expected, and necessary what you are seeing.
Signature · 1 line
Stefan Richter
Quoted 5 lines
I don't think you are correct. Look more closely at my test cases.
When I attempt the rmmod, *nothing* has the device open. The last close has already occurred -- albeit *after* the device was removed.
Yep, sorry, I didn't read your report as carefully as necessary.
Quoted 3 lines
In my test, the module *never* becomes rmmod-able. Doesn't matter how long you wait, and nothing will ever decrement the reference count.
Did you check that also after, say, several minutes? I suppose you already looked at the kernel log for possibly related messages and would have reported them as well... Nevertheless, I have seen some cases of device removal or driver removal where the SCSI layer spent many minutes (5? 15? I'm not sure anymore) in error handling although the lower layer had done its best (best but perhaps not well) to report the device as physically gone.
Did you already test really long after device removal and last close, along the lines of this?
# while ((i++ < 20)); do rmmod $driver && break; sleep 60; done
Signature · 3 lines
Stefan Richter -=====-==-=- ---= -==== http://arcgraph.de/sr/
--- On Fri, 1/15/10, Stefan Richter <[email protected]> wrote:
...
Quoted 15 lines
Did you check that also after, say, several minutes? I suppose you
already looked at the kernel log for possibly related messages and would
have reported them as well... Nevertheless, I have seen some cases of
device removal or driver removal where the SCSI layer spent many minutes
(5? 15? I'm not sure anymore) in error handling although the lower layer
had done its best (best but perhaps not well) to report the device as
physically gone.
Quoted 5 lines
Did you already test really long after device removal and last close,
along the lines of this?# while ((i++ < 20)); do rmmod $driver && break; sleep 60; done
I had left it sitting since last night (~6:00pm localtime), and this morning (~8:00am localtime), it still won't rmmod... so ~14 hours.
-- steve
Quoted 5 lines
Signature · 3 lines
Stefan Richter -=====-==-=- ---= -==== http://arcgraph.de/sr/
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Steve,
Could you confirm whether, in your environment, the scsi_debug driver has the same problem.
Doug Gilbert
Quoted 41 lines · Stephen Cameron
--- On Fri, 1/15/10, Stefan Richter <[email protected]> wrote:
...
Quoted 13 lines
Did you check that also after, say, several minutes? I suppose you already looked at the kernel log for possibly related messages and would
have reported them as well... Nevertheless, I have seen some cases of
device removal or driver removal where the SCSI layer spent many minutes
(5? 15? I'm not sure anymore) in error handling although the lower layer
had done its best (best but perhaps not well) to report the device as
physically gone.Quoted 5 lines
Did you already test really long after device removal and last close,
along the lines of this?# while ((i++ < 20)); do rmmod $driver && break; sleep 60; doneI had left it sitting since last night (~6:00pm localtime), and this morning (~8:00am localtime), it still won't rmmod... so ~14 hours.
-- steve
Quoted 5 lines
Signature · 3 lines
Stefan Richter -=====-==-=- ---= -==== http://arcgraph.de/sr/--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html