[ofw] Opensm & WinMad: a race, cauing BSOD722

Hefty, Sean sean.hefty at intel.com
Thu Jan 26 09:04:08 PST 2012


> There are two ways to solve the problem:
> 
> 1) Don't use IRP_MJ_READ and  IRP_MJ_WRITE. In other words, replace them with
> device io control which as far as I understand will not be called after the
> call to IRP_MJ_CLEANUP.

I used read/write because that's what was used by umad, and I was trying to match those semantics.  I'd prefer to keep this usage model.

Hopefully the device IO control does not have this issue, or there would likely be a problem in this same area with winverbs.
 
> 2) Do your cleanup at the IRP_MJ_CLOSE request:
> 
> (http://msdn.microsoft.com/en-
> us/library/windows/hardware/ff550720(v=vs.85).aspx)
> "When Sent
> 
> Receipt of this request indicates that the last handle of the file object that
> is associated with the target device object has been closed and released. All
> outstanding I/O requests have been completed or canceled."

Yes - it looks like cleanup needs to be split between the cleanup and close IRPs, with extra synchronization added to handle things correctly.  The cleanup of the synchronization object must be delayed until close.

- Sean 



More information about the ofw mailing list