CREATE without CLOSE

Hi All,

In my filter driver I notice an issue I don’t understand. Can anyone tell
me what I am missing?

When I am creating a file from the command line using COPY CON “filename”.
I receive the CREATE, the writes etc. But in the end I do receive a
CLEANUP but I am missing the CLOSE.

Since I maintain a per FCB database on the files being filtered and am
reference counting using the OPEN’s and CLOSES this is a problem for me.
Can someone shed some light in this matter?

Best regards,

Wim Vervoorn

xxxxx@eltan.com

Hello there!

This reminds me of a strange thing hat I have observed while trying to
create my “hello world file system driver” (no, it is still not finished,
too much more pressing work):

With certain not-quite-valid responses from my driver I got CREATE-requests
for a file that I have tried to view with “type”, but the cleanup/close
requests came only when I exited the command window. (After desperately
trying to type that file for 50 times I gave up and exited the command line
window. The next couple of minutes the debug window scrolled with
cleanup/close requests…).

(Don’t know if this helps you, though)

Cheers,
Michael

|---------±------------------------------>
| | “Wim Vervoorn” |
| | | | > |
| | Sent by: |
| | bounce-ntfsd-5035@li|
| | sts.osr.com |
| | |
| | |
| | 12.09.02 17:59 |
| | Please respond to |
| | “File Systems |
| | Developers” |
| | |
|---------±------------------------------>
>--------------------------------------------------------------------------------------------------------------|
| |
| To: “File Systems Developers” |
| cc: |
| Subject: [ntfsd] CREATE without CLOSE |
>--------------------------------------------------------------------------------------------------------------|

Hi All,

In my filter driver I notice an issue I don’t understand. Can anyone tell
me what I am missing?

When I am creating a file from the command line using COPY CON “filename”.
I receive the CREATE, the writes etc. But in the end I do receive a
CLEANUP but I am missing the CLOSE.

Since I maintain a per FCB database on the files being filtered and am
reference counting using the OPEN’s and CLOSES this is a problem for me.
Can someone shed some light in this matter?

Best regards,

Wim Vervoorn

xxxxx@eltan.com


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

Many file systems employee a so called “delayed close” strategy. Indeed in
some cases it is
more efficient to delay close operations, and perform them , batched, at a
later time.

Also, sometimes Cc manager employee a quasy-similar strategy (closely linked
to lazy
write acitivity), which results in IRP_MJ_CLOSE for certain file objects
beeing delayed
for some time.

This behaviour is really not a problem for the purpose of reference
counting. You must ensure that when you free your per context tracking
structures, not only user references are gone, but also , all Cc and Mm
references to the on disk file stream are also gone. This is
problematic , because the so called stram file objects. You can have a
reference hold
through a stream file object for which you never seen any IRP_MJ_CREATE
operation.

For NT and 2k , check NT insider they have a nice article on reference
counting. For XP+,
and file systems which supports it , there is a nice built-in reference
counting mechanism.

Ciao, Dan

“Wim Vervoorn” wrote in message news:xxxxx@ntfsd…
>
> Hi All,
>
> In my filter driver I notice an issue I don’t understand. Can anyone tell
> me what I am missing?
>
> When I am creating a file from the command line using COPY CON “filename”.
> I receive the CREATE, the writes etc. But in the end I do receive a
> CLEANUP but I am missing the CLOSE.
>
> Since I maintain a per FCB database on the files being filtered and am
> reference counting using the OPEN’s and CLOSES this is a problem for me.
> Can someone shed some light in this matter?
>
> Best regards,
>
> Wim Vervoorn
>
> xxxxx@eltan.com
>
>