Cached/non-cached io for shadow copy and encryption filter

Hello !
I am reading https://community.osr.com/discussion/280359/minifilter-not-intercepting-irp-mj-write-when-a-file-is-copied

Slava Imameev says that it is totally ok for FS to convert cached io to non-cached. In this case filter won’t see this data written to disk with paging io.

It raises some concerns.

  1. for shadow copy filter. If I am not writing an isolation filter, what is my best course of action to be as correct as possible ? Copy all writes (including cached ones) to my shadow copy ?

  2. for encrypting filter. Let’s say io manager calls fast io write routine for highest filter. My encrypting filter skips this write since data in cache should be plaintext. But fs decides to write this data directly to volume. Non-encrypted data stored on volume. Without writing isolation filter, can this problem be solved correctly ?

It’s common to see this behavior on the client side of the network though I’ve never seen a local FSD do it*. So, if you care about doing your shadow copy work for network shares on the client side you need to account for this somehow. Same with encryption: if you do the enc/dec on the client you have to worry about not ever seeing a paging I/O. The only real answers are to either do the work on the server side or Isolate on the client.

*Persistent Memory/DAX is an exception here. In that case your cached I/Os go directly to the device and you will not ever see a paging I/O. That’s a very specific technology though and always requires special consideration.

Thank you Scott !

Now I also need to read about intel Optane.
Nothing is ever easy in windows fs world :slight_smile:

The PMEM stuff is very cool but still niche. It’s also quite pricey…512GB module is available for around $18,000USD (hint, hint to anyone looking for gift ideas :))

Note that these devices can and do run in “compatibility mode” where they behave like a normal storage device in Windows (paging I/Os and all). Kind of a waste though in terms of achieving the maximum perf benefit of the technology.