"True Lies" on file size

Hi,
In my HSM FS filter driver I need to “lie” about offline
file(FILE_ATTRIBUTE_OFFLINE) size, so that I patch EndOfFile and
AllocationSize members from the list of _FILE_INFORMATION_CLASS structures.
I don’t use sparse files (Yes I know, but some of our Users just don’t want
to switch from NT40).

The question that I have is:
Can I return the “true” size for AllocationSize member, which is (really) 0
bytes for offline file and patch only EndOfFile member for an offline file?
Will I face any problems doing so?

Thanks in advance for any information.
WBR Primoz

The memory manager uses “AllocationSize” when establishing the size of a
section object backed by this file. If the AllocationSize of the file is
always correct by the time it is being mapped (either by the cache or by an
application) then it really shouldn’t matter. However, if the
AllocationSize of the file is not correct by that point, you need to return
some value >= EndOfFile so that the section created isn’t too small (that’s
when you get problems - when the section object size is smaller than the
file itself.)

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Wednesday, June 05, 2002 5:05 AM
To: File Systems Developers
Subject: [ntfsd] “True Lies” on file size

Hi,
In my HSM FS filter driver I need to “lie” about offline
file(FILE_ATTRIBUTE_OFFLINE) size, so that I patch EndOfFile and
AllocationSize members from the list of _FILE_INFORMATION_CLASS structures.
I don’t use sparse files (Yes I know, but some of our Users just don’t want
to switch from NT40).

The question that I have is:
Can I return the “true” size for AllocationSize member, which is (really) 0
bytes for offline file and patch only EndOfFile member for an offline file?
Will I face any problems doing so?

Thanks in advance for any information.
WBR Primoz


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

Thanks for reply Tony. The unclear thing from your description below is how
MM&Co is handling compressed (or sparse) files. I can see that NTFS is
returnig *real* AllocationSize for compressed files (I didn’t test sparse
files, yet).
Does MM has a “special” knowladge built-in regarding NTFS compressed or
sparse files? Does MM make additional queries to get un-compressed (or
un-sparsed) file AllocationSize before creating section object?
WBR Primoz

-----Original Message-----
From: Tony Mason [mailto:xxxxx@osr.com]
Sent: Wednesday, June 05, 2002 11:40 AM
To: File Systems Developers
Subject: [ntfsd] RE: “True Lies” on file size

The memory manager uses “AllocationSize” when establishing the size of a
section object backed by this file. If the AllocationSize of the file is
always correct by the time it is being mapped (either by the cache or by an
application) then it really shouldn’t matter. However, if the
AllocationSize of the file is not correct by that point, you need to return
some value >= EndOfFile so that the section created isn’t too small (that’s
when you get problems - when the section object size is smaller than the
file itself.)

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Wednesday, June 05, 2002 5:05 AM
To: File Systems Developers
Subject: [ntfsd] “True Lies” on file size

Hi,
In my HSM FS filter driver I need to “lie” about offline
file(FILE_ATTRIBUTE_OFFLINE) size, so that I patch EndOfFile and
AllocationSize members from the list of _FILE_INFORMATION_CLASS structures.
I don’t use sparse files (Yes I know, but some of our Users just don’t want
to switch from NT40).

The question that I have is:
Can I return the “true” size for AllocationSize member, which is (really) 0
bytes for offline file and patch only EndOfFile member for an offline file?
Will I face any problems doing so?

Thanks in advance for any information.
WBR Primoz


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


You are currently subscribed to ntfsd as: xxxxx@hermes.si To
unsubscribe send a blank email to %%email.unsub%%

Primoz,

I think your experience and mine differ in this regard because I have always
found that if I return AllocationSize < EOF the VM system crashes. I’ll go
off and re-confirm the behavior I’ve observed.

Regards,

Tony

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

Hope to see you at the next OSR file systems class in San Jose, CA September
16, 2002!

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Wednesday, June 05, 2002 6:10 AM
To: File Systems Developers
Subject: [ntfsd] RE: “True Lies” on file size

Thanks for reply Tony. The unclear thing from your description below is how
MM&Co is handling compressed (or sparse) files. I can see that NTFS is
returnig *real* AllocationSize for compressed files (I didn’t test sparse
files, yet).
Does MM has a “special” knowladge built-in regarding NTFS compressed or
sparse files? Does MM make additional queries to get un-compressed (or
un-sparsed) file AllocationSize before creating section object?
WBR Primoz

-----Original Message-----
From: Tony Mason [mailto:xxxxx@osr.com]
Sent: Wednesday, June 05, 2002 11:40 AM
To: File Systems Developers
Subject: [ntfsd] RE: “True Lies” on file size

The memory manager uses “AllocationSize” when establishing the size of a
section object backed by this file. If the AllocationSize of the file is
always correct by the time it is being mapped (either by the cache or by an
application) then it really shouldn’t matter. However, if the
AllocationSize of the file is not correct by that point, you need to return
some value >= EndOfFile so that the section created isn’t too small (that’s
when you get problems - when the section object size is smaller than the
file itself.)

Regards,

Tony

Tony Mason

Consulting Partner

OSR Open Systems Resources, Inc.

http://www.osr.com

-----Original Message-----
From: Primoz Beltram [mailto:xxxxx@hermes.si]
Sent: Wednesday, June 05, 2002 5:05 AM
To: File Systems Developers
Subject: [ntfsd] “True Lies” on file size

Hi,
In my HSM FS filter driver I need to “lie” about offline
file(FILE_ATTRIBUTE_OFFLINE) size, so that I patch EndOfFile and
AllocationSize members from the list of _FILE_INFORMATION_CLASS structures.
I don’t use sparse files (Yes I know, but some of our Users just don’t want
to switch from NT40).

The question that I have is:
Can I return the “true” size for AllocationSize member, which is (really) 0
bytes for offline file and patch only EndOfFile member for an offline file?
Will I face any problems doing so?

Thanks in advance for any information.
WBR Primoz


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


You are currently subscribed to ntfsd as: xxxxx@hermes.si To
unsubscribe send a blank email to %%email.unsub%%


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