QueryFileFilter driver

Is is necessary to do sector alignment on all the writes in case of noncached io in file filter driver.i have seen some issue in past with non cached read???

> Is is necessary to do sector alignment on all the writes in case of

noncached io in file filter driver.i have seen some issue in past with non
cached read???

Well filter manager will whine massively if you don’t.

NTFS used to be able to handle nonaligned IO, dunno if it still does, but
I’d avoid it.

In general, the rule is:

  1. The offset should be sector aligned
  2. The length should be sector aligned *OR* to the end of file.

Unfortunately filter manager gets the second test wrong and throws an assert
if you do a “write to end of file”. I usually end up frustrated and
FltPerform[A]SyncrhonousIO at that stage.

Yes, for noncached IO sector alignment of offset/length is a must.

Alignment of data pointer (i.e. Mdl->ByteOffset) is also actually a must, and is documented so, but on some (not all) disk controllers unaligned pointers will also work.

You should not rely on the latter fact unless you want to have an issue on some computers and not all of them.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntfsd…
> Is is necessary to do sector alignment on all the writes in case of noncached io in file filter driver.i have seen some issue in past with non cached read???
>

> NTFS used to be able to handle nonaligned IO, dunno if it still does, but

I’d avoid it.

Oh yes, having sudden mysterious performance implications is a bad idea.


Maxim S. Shatskih
Microsoft MVP on File System And Storage
xxxxx@storagecraft.com
http://www.storagecraft.com