File Length was modified in WRITE irp?

Does the MJ_IRP_WRITE (Paging IO or Cached)change the file length?
In my IFS filter driver, I bypassed(without calling down) all the
non-cached WRITE IRP and all the
SET_INFORMATION IRPs for the target file I’m monitoring,
after added several bytes in the target file by notepad.exe,
the file content was kept old but the length of the target file was still
changed
So who changed the file length? the cached or paging
WRITE irp will do that internally?

What I want to do is only allow the file cache be modified but the physical
file
won’t be changed, but looks like the file cache is not updated even I allow
the cached WRITE IRPs. From the filter driver’s point of the view, how does
the cache manager work with READ/WRITE IRPs? I was a little bit confused
here.

Could anybody shed some lights on it?
thanks in advance,

AFei

Paging IO never changes file size.
Cached write will extend file if it is necessary to accomodate data.

Alexei.

-----Original Message-----
From: AFei [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 29, 2004 5:59 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] File Length was modified in WRITE irp?

Does the MJ_IRP_WRITE (Paging IO or Cached)change the file length?
In my IFS filter driver, I bypassed(without calling down) all the
non-cached WRITE IRP and all the
SET_INFORMATION IRPs for the target file I’m monitoring,
after added several bytes in the target file by notepad.exe,
the file content was kept old but the length of the target file was still
changed
So who changed the file length? the cached or paging
WRITE irp will do that internally?

What I want to do is only allow the file cache be modified but the physical
file
won’t be changed, but looks like the file cache is not updated even I allow
the cached WRITE IRPs. From the filter driver’s point of the view, how does
the cache manager work with READ/WRITE IRPs? I was a little bit confused
here.

Could anybody shed some lights on it?
thanks in advance,

AFei


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

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

Better to say “user write” will extend file if it is necessary to
accommodate data. A user write may be cached (normal case) or
non-cached.

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alexei Jelvis
Sent: Thursday, July 29, 2004 9:05 PM
To: ntfsd redirect
Subject: RE: [ntfsd] File Length was modified in WRITE irp?

Paging IO never changes file size.
Cached write will extend file if it is necessary to accomodate data.

Alexei.

-----Original Message-----
From: AFei [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 29, 2004 5:59 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] File Length was modified in WRITE irp?

Does the MJ_IRP_WRITE (Paging IO or Cached)change the file length?
In my IFS filter driver, I bypassed(without calling down) all the
non-cached WRITE IRP and all the
SET_INFORMATION IRPs for the target file I’m monitoring,
after added several bytes in the target file by notepad.exe,
the file content was kept old but the length of the target file was
still
changed
So who changed the file length? the cached or paging
WRITE irp will do that internally?

What I want to do is only allow the file cache be modified but the
physical
file
won’t be changed, but looks like the file cache is not updated even I
allow
the cached WRITE IRPs. From the filter driver’s point of the view, how
does
the cache manager work with READ/WRITE IRPs? I was a little bit confused
here.

Could anybody shed some lights on it?
thanks in advance,

AFei


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

You are currently subscribed to ntfsd as: xxxxx@vmware.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

Hi Alexei & Tony,

Thanks for your reply. It helps me a lot!
I walked around this problem in another way by
dealing with the SetFile.AdvanceOnly flag.

So another problem is, how to let the file cache
get updated in filter driver? For example: load
file A to file B’s cache. The way I’m thinking is:
(1) CcFlushCache() for file A
(2) When next read/write comes in, redirect it to the file B
Should this work or what’s the right way to do this?

Best regards,

AFei

“Tony Mason” wrote in message news:xxxxx@ntfsd…
Better to say “user write” will extend file if it is necessary to
accommodate data. A user write may be cached (normal case) or
non-cached.

Regards,

Tony

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

Looking forward to seeing you at the Next OSR File Systems Class October
18, 2004 in Silicon Valley!

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Alexei Jelvis
Sent: Thursday, July 29, 2004 9:05 PM
To: ntfsd redirect
Subject: RE: [ntfsd] File Length was modified in WRITE irp?

Paging IO never changes file size.
Cached write will extend file if it is necessary to accomodate data.

Alexei.

-----Original Message-----
From: AFei [mailto:xxxxx@hotmail.com]
Sent: Thursday, July 29, 2004 5:59 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] File Length was modified in WRITE irp?

Does the MJ_IRP_WRITE (Paging IO or Cached)change the file length?
In my IFS filter driver, I bypassed(without calling down) all the
non-cached WRITE IRP and all the
SET_INFORMATION IRPs for the target file I’m monitoring,
after added several bytes in the target file by notepad.exe,
the file content was kept old but the length of the target file was
still
changed
So who changed the file length? the cached or paging
WRITE irp will do that internally?

What I want to do is only allow the file cache be modified but the
physical
file
won’t be changed, but looks like the file cache is not updated even I
allow
the cached WRITE IRPs. From the filter driver’s point of the view, how
does
the cache manager work with READ/WRITE IRPs? I was a little bit confused
here.

Could anybody shed some lights on it?
thanks in advance,

AFei


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

You are currently subscribed to ntfsd as: xxxxx@vmware.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