SUMMARY
In a Storport virtual miniport is it possible to have multiple concurrent SCSI SRB’s for the same LBA, perhaps via overlapping ranges? In particular is it possible to have multiple concurrent SCSI WRITE’s for the same LBA?
DETAILS
I have a Storport virtual miniport and I am trying to fully understand the Storport concurrency model so that I can correctly implement synchronization. My understanding is that in a virtual Storport no locks are taken for StartIo so any required synchronization has to be done in the miniport.
In my miniport I handle synchronization as it relates to my driver’s data structures. However a more subtle question is whether I need to handle synchronization for LBA ranges. Suppose that my miniport can handle 2 or more concurrent SRB’s for unrelated ranges without any synchronization (e.g. an SRB for LBA 42 and an SRB for LBA 1042). Suppose further that my miniport cannot handle 2 or more concurrent SRB’s for overlapping ranges without synchronization (e.g. an SRB for range 0-1 and an SRB for range 1-2).
My questions:
- Does the system provide any guarantee (either explicit or implicit) that the scenario of multiple concurrent SRB’s for overlapping ranges cannot happen?
- If it does not what is the expected behavior? (Whole range in SRB gets written atomically, single blocks in SRB get written atomically, anything goes?)
My expectation is that it would be counter-productive for file systems (or other system components) to issue such requests, but I do not know.