Paging Write byte-range assumptions

Hi All,

So, can there be a paging-write call to a FSD with a byte-range which is NOT
page-aligned? Or, NOT even sector-aligned? The case we are running into is
a memory-mapped write followed by FlushViewOfFile, which results in a
paging-write with a arbitrary byte-range (which is not sector aligned). If
this is true, then is it safe to simply round-up the range-end to the
nearest sector, (and assume that the incoming buffer/MDL is large enough)?

Also, what about paging-read? Or does that always happen for full-pages
only.

thanks,
Vipul.

For writes, the byte count can be non-aligned as long as the request
extends above valid data length. The offset must be aligned, however.

Vipul wrote:

Hi All,

So, can there be a paging-write call to a FSD with a byte-range which is NOT
page-aligned? Or, NOT even sector-aligned? The case we are running into is
a memory-mapped write followed by FlushViewOfFile, which results in a
paging-write with a arbitrary byte-range (which is not sector aligned). If
this is true, then is it safe to simply round-up the range-end to the
nearest sector, (and assume that the incoming buffer/MDL is large enough)?

Also, what about paging-read? Or does that always happen for full-pages
only.

thanks,
Vipul.


Nick Ryan (MVP for DDK)

Hi Nick,

So, is it then safe to simply round-up the byte-count to next sector
boundary (and assume that the MDL is large enough), and proceed with
low-level write? Or should the FSD do the left-over sector zero-fill etc…

Thanks,

“Nick Ryan” wrote in message news:xxxxx@ntfsd…
>
> For writes, the byte count can be non-aligned as long as the request
> extends above valid data length. The offset must be aligned, however.
>
> Vipul wrote:
>
> > Hi All,
> >
> > So, can there be a paging-write call to a FSD with a byte-range which is
NOT
> > page-aligned? Or, NOT even sector-aligned? The case we are running
into is
> > a memory-mapped write followed by FlushViewOfFile, which results in a
> > paging-write with a arbitrary byte-range (which is not sector aligned).
If
> > this is true, then is it safe to simply round-up the range-end to the
> > nearest sector, (and assume that the incoming buffer/MDL is large
enough)?
> >
> > Also, what about paging-read? Or does that always happen for full-pages
> > only.
> >
> > thanks,
> > Vipul.
> >
> >
> >
> >
>
> –
> Nick Ryan (MVP for DDK)
>
>
>

Yes, you can assume the MDL is large enough… I know FastFat does.

Vipul wrote:

Hi Nick,

So, is it then safe to simply round-up the byte-count to next sector
boundary (and assume that the MDL is large enough), and proceed with
low-level write? Or should the FSD do the left-over sector zero-fill etc…

Thanks,

“Nick Ryan” wrote in message news:xxxxx@ntfsd…
>
>>For writes, the byte count can be non-aligned as long as the request
>>extends above valid data length. The offset must be aligned, however.
>>
>>Vipul wrote:
>>
>>
>>>Hi All,
>>>
>>>So, can there be a paging-write call to a FSD with a byte-range which is
>
> NOT
>
>>>page-aligned? Or, NOT even sector-aligned? The case we are running
>
> into is
>
>>>a memory-mapped write followed by FlushViewOfFile, which results in a
>>>paging-write with a arbitrary byte-range (which is not sector aligned).
>
> If
>
>>>this is true, then is it safe to simply round-up the range-end to the
>>>nearest sector, (and assume that the incoming buffer/MDL is large
>
> enough)?
>
>>>Also, what about paging-read? Or does that always happen for full-pages
>>>only.
>>>
>>>thanks,
>>>Vipul.
>>>
>>>
>>>
>>>
>>
>>–
>>Nick Ryan (MVP for DDK)
>>
>>
>>
>
>
>
>
>


Nick Ryan (MVP for DDK)