Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

QueryFileFilter driver

NtDev_GeekNtDev_Geek Member - All Emails Posts: 97
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???

Comments

  • rod_widdowsonrod_widdowson Member - All Emails Posts: 1,017
    > 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.
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    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

    <xxxxx@gmail.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???
    >
  • OSR_Community_UserOSR_Community_User Member Posts: 110,217
    > 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
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Writing WDF Drivers 25 Feb 2019 OSR Seminar Space
Developing Minifilters 8 April 2019 OSR Seminar Space