Can non-cached io have IRP_NOCACHE == 0 ?

In a mini-filter pre-write callback, if FlagOn( Data->Iopb->Parameters,
IRP_NOCACHE ) == 0, then is the callback guaranteed to be for a cached i/o
operation? The documentation makes it clear that when IRP_NOCACHE is set
then it will not be a cached operation, but it doesn’t really say if the
converse is true.

Another way of asking this question is: Are all i/o operations cached except
for ones with IRP_NOCACHE set?

If that condition isn’t sufficient, then how do I determine for sure whether
an i/o operation is cached or not? I want to catch the non-cached
operations to make sure I see all the data that goes to the actual disk and
that I don’t want to see it multiple times.

No. If the file system chooses (for its own internal policy) to treat
an I/O as non-cached it can choose to do so. I can give two concrete
examples of this: RAW treats all I/O as non-cached. MRXSMB (LanManager)
switches to non-cached I/O based upon internal policy between it and the
server (e.g., it must write all modifications back to the server because
the file is now shared between two applications). An example “the other
way” is NTFS, where compressed files are cached even if the IRP_NOCACHE
bit is set.

This will vary on a per file-system basis. The OS policy (IRP_NOCACHE)
is clear to determine the behavior. For the FSD policy you will need to
consult with the OS developer for each individual file system to
determine how this is handled.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
Sent: Saturday, April 09, 2005 6:53 PM
To: ntfsd redirect
Subject: [ntfsd] Can non-cached io have IRP_NOCACHE == 0 ?

In a mini-filter pre-write callback, if FlagOn( Data->Iopb->Parameters,
IRP_NOCACHE ) == 0, then is the callback guaranteed to be for a cached
i/o
operation? The documentation makes it clear that when IRP_NOCACHE is
set
then it will not be a cached operation, but it doesn’t really say if the

converse is true.

Another way of asking this question is: Are all i/o operations cached
except
for ones with IRP_NOCACHE set?

If that condition isn’t sufficient, then how do I determine for sure
whether
an i/o operation is cached or not? I want to catch the non-cached
operations to make sure I see all the data that goes to the actual disk
and
that I don’t want to see it multiple times.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

So what you are saying is that there is no real way to determine whether a
write is cached or not?

How do encryption filters make sure they encrypt the data only once if they
don’t know whether each i/o is going into the cache or onto the disk?

“Tony Mason” wrote in message news:xxxxx@ntfsd…
No. If the file system chooses (for its own internal policy) to treat
an I/O as non-cached it can choose to do so. I can give two concrete
examples of this: RAW treats all I/O as non-cached. MRXSMB (LanManager)
switches to non-cached I/O based upon internal policy between it and the
server (e.g., it must write all modifications back to the server because
the file is now shared between two applications). An example “the other
way” is NTFS, where compressed files are cached even if the IRP_NOCACHE
bit is set.

This will vary on a per file-system basis. The OS policy (IRP_NOCACHE)
is clear to determine the behavior. For the FSD policy you will need to
consult with the OS developer for each individual file system to
determine how this is handled.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
Sent: Saturday, April 09, 2005 6:53 PM
To: ntfsd redirect
Subject: [ntfsd] Can non-cached io have IRP_NOCACHE == 0 ?

In a mini-filter pre-write callback, if FlagOn( Data->Iopb->Parameters,
IRP_NOCACHE ) == 0, then is the callback guaranteed to be for a cached
i/o
operation? The documentation makes it clear that when IRP_NOCACHE is
set
then it will not be a cached operation, but it doesn’t really say if the

converse is true.

Another way of asking this question is: Are all i/o operations cached
except
for ones with IRP_NOCACHE set?

If that condition isn’t sufficient, then how do I determine for sure
whether
an i/o operation is cached or not? I want to catch the non-cached
operations to make sure I see all the data that goes to the actual disk
and
that I don’t want to see it multiple times.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Mark,

Actually, this very point has been discussed at length on NTFSD, with
the emphasis being on specific file systems (there was in fact a
discussion about how to determine if mini-redirectors have disabled
caching). Encryption filters must be constructed to work with each file
system. For example, I’ve never heard of anyone building an encryption
filter over exifs or WinFS, so I couldn’t comment on what it would take
to do so.

So choose those you care about and figure out the answer for those.
There is no “one size fits all” solution here.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
Sent: Saturday, April 09, 2005 11:50 PM
To: ntfsd redirect
Subject: Re:[ntfsd] Can non-cached io have IRP_NOCACHE == 0 ?

So what you are saying is that there is no real way to determine whether
a
write is cached or not?

How do encryption filters make sure they encrypt the data only once if
they
don’t know whether each i/o is going into the cache or onto the disk?

“Tony Mason” wrote in message news:xxxxx@ntfsd…
No. If the file system chooses (for its own internal policy) to treat
an I/O as non-cached it can choose to do so. I can give two concrete
examples of this: RAW treats all I/O as non-cached. MRXSMB (LanManager)
switches to non-cached I/O based upon internal policy between it and the
server (e.g., it must write all modifications back to the server because
the file is now shared between two applications). An example “the other
way” is NTFS, where compressed files are cached even if the IRP_NOCACHE
bit is set.

This will vary on a per file-system basis. The OS policy (IRP_NOCACHE)
is clear to determine the behavior. For the FSD policy you will need to
consult with the OS developer for each individual file system to
determine how this is handled.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Mark Hahn
Sent: Saturday, April 09, 2005 6:53 PM
To: ntfsd redirect
Subject: [ntfsd] Can non-cached io have IRP_NOCACHE == 0 ?

In a mini-filter pre-write callback, if FlagOn( Data->Iopb->Parameters,
IRP_NOCACHE ) == 0, then is the callback guaranteed to be for a cached
i/o
operation? The documentation makes it clear that when IRP_NOCACHE is
set
then it will not be a cached operation, but it doesn’t really say if the

converse is true.

Another way of asking this question is: Are all i/o operations cached
except
for ones with IRP_NOCACHE set?

If that condition isn’t sufficient, then how do I determine for sure
whether
an i/o operation is cached or not? I want to catch the non-cached
operations to make sure I see all the data that goes to the actual disk
and
that I don’t want to see it multiple times.


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com