I have a mini filter driver which does some form of meta-data and data separation.
Basically, a single visible file for the end user is backed up by 2 files on disk.
All operations are forwarded to the 1st file except PAGING writes and NonCached writes.
Only PAGING writes and NonCached writes are forwarded to the 2nd file.
Other modifying operations except write (SetInfo, SetEa, SetSecurity) are also replicated to the second file.
I ensure, no one in the system can open the 2nd file except me.
I am seeing the following behavior.
-
An Application like notepad sends a write to the file. (This being cached write is sent to the 1st file). This write also happened to be beyond the EOF.
-
This is followed by a SetEof and SetAllocationInfo. (These are sent to both the files).
-
Application closes the file.
All is well till this point.
Now, the Cache Manager flushes out the page.
- A paging write of size 4096 is sent. - This is forwarded to the 2nd file only.
- Followed by a setEof of 4096 - This is MY PROBLEM.
If I forward the paging write to both the files, then I see a proper set EOF (less than 4096).
Any idea what is going on?
Further, I would like to also understand what special handling needs to done for NonCached Writes (if any).