Data coherency between Iosolation Filter and System Memory Map

Dear all, I’m developing an Isolation Filter Driver, I try to solve the data cohenrency problem by calling Cc* funtion towards file object owned by system intead of my Isolation Filter.
As you have mentioned(http://www.osronline.com/showthread.cfm?link=251088), it needs lots of different locks and after testing for thounds of times I found that it is not a stable way, the system always encounter dead locks because of my Isolation Filter.
Now I delete the codes about calling Cc* funtion towards file object owned by system, but I have the data cohenrency problem again…
Here is the detailed information about my data cohenrency probloem:
I created a text named 1.txt, then I opened 1.txt by notepad.exe and wrote [123321] into 1.txt, finally I closed 1.txt and make a copy named 1-copy.txt
Then I opened 1-copy.txt with notepad.exe, the content in 1-copy.txt was (six zero in hexadecimal).
I think my Isolation Filter has written the correct content into the text(1.txt) in PagingIoWrite, but the memory map or cache of the system didn’t get updated, so it remains zero. When I make a copy of 1.txt, explorer.exe get the content from the memory map or cache of the system, so it writes zero into the 1-copy.txt
I called CcPurgeCacheSection towards file object owned by system in PagingIo(Write) previously, so I have no data cohenrency problem; Now I have deleted the codes(CcPurgeCacheSection ), so the problems come back again, how can I let the system know that it should update its Memory Map or Cache? Does call FltFlushBuffers make any sense?
Thanks for your help ^.^

> it needs lots of different locks
Yup

I found that it is not a stable way, the system always encounter dead
locks because of my Isolation Filter.

Yes it is. You can make this work and be stable. It can just get very
convoluted.

If you want coherency between sections and the cache then you need to
integrate properly. This particularly involves understanding the locking
which is Byzantine. Make no mistake this is very painful. Allow 2-3
experienced man years (minimum) to get it right.

If you don’t care about data use the SOP from below.

Rod

Thanks, rod.
But I still not very clear, I don’t think my Isolation Filter should touch the locks owned by file system( such as NTFS), should I ?

> I don’t think my Isolation Filter should touch the locks owned by file

system( such as NTFS), should I ?

Up to a point. You cannot manipulate them directly, but you do sometime
need to let the FSD know that an paging write is coming. For a cache flush
or an MPW write that is done for you, but lazy writer flushes can be
problematic.

I’d be interested if there is anyone from MS listening what their approach
is to this.