question about cache and filter manager

I have a minifilter driver that swaps the buffer read for any cached IO with a different buffer. What I observe debugging a cached read operation is multiple read callbacks and BSOD at last.
My analysis about it is:
When I swap the data read from cache, the cache manager feels the difference and invalidates the file cache, then a non-cached read is performed and the new data is cached. Again a cached IO request is sent and I swap the buffer again and this causes a deadlock. So It is concluded that it is always wrong to swap a cached read buffer.

Is this conclusion correct or there lays a bug elsewhere?

This sounds like a bug in your code. There is no inherent reason you can’t swap a cached read buffer otherwise.


thanks tony