irp_mj_cleanup and writebehind

Here’s a few for the gurus that I think a lot of us would like to know the
answer to.

  1. If a process opens a file specifying no_intermediate_file_buffering, does
    this mean that all writes for the file initiated by the process have been
    completed by the time the IRP_MJ_CLEANUP has been issued by the process?

  2. If the answer is “yes”, what about the situation where a process opens a
    file with NIFB, issues an overlapped write, then closes the file before the
    write completes: will the io manager wait until the write completes before
    issuing is the IRP_MJ_CLEANUP?

  3. What if one process opens a file without NIFB but the next process opens it
    with NIFB, is the file cached or not?

Thanks for the help.

Neil

Neil,

There is no relationship between WRITING and CLEANUP. One has to do with
I/O and the other has to do with handle reference count management. Thus,
the scenario you suggested would indeed allow I/O to proceed after the
IRP_MJ_CLEANUP. Of course, the FILE SYSTEM could block the cleanup
(deliberately, or even as a natural byproduct of the serialization within
the file system) until all oustanding write I/O was done, but I can’t see
any reason why the I/O Manager would do it (nor care.) Reference counting
will “take care of” the details for file handles versus file objects (object
has to remain valid until all of the outstanding IRPs referencing it are
completed, for instance.)

Further, I would note that an FSD need not honor a request for no
intermediate buffering. NTFS does not honor this request in all
circumstances, for example.

I hope this addresses your question.

Regards,

Tony

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

-----Original Message-----
From: Neil Weicher [mailto:xxxxx@netlib.com]
Sent: Tuesday, May 30, 2000 10:16 PM
To: File Systems Developers
Subject: [ntfsd] irp_mj_cleanup and writebehind

Here’s a few for the gurus that I think a lot of us would like to know the
answer to.

  1. If a process opens a file specifying no_intermediate_file_buffering, does
    this mean that all writes for the file initiated by the process have been
    completed by the time the IRP_MJ_CLEANUP has been issued by the process?

  2. If the answer is “yes”, what about the situation where a process opens a
    file with NIFB, issues an overlapped write, then closes the file before the
    write completes: will the io manager wait until the write completes before
    issuing is the IRP_MJ_CLEANUP?

  3. What if one process opens a file without NIFB but the next process opens
    it
    with NIFB, is the file cached or not?

Thanks for the help.

Neil


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

> 2) If the answer is “yes”, what about the situation where a process opens
a

file with NIFB, issues an overlapped write, then closes the file before
the
write completes: will the io manager wait until the write completes before
issuing is the IRP_MJ_CLEANUP?

No. IRP_MJ_CLEANUP is issued from the IopCloseFile routine.
If the handle count reached zero - than IopCloseFile sends
IRP_MJ_CLEANUP.
IopCloseFile is registered by the IO subsystem in the Object Manager as a
Close method for File object type. It is automatically called by the OM each
time the handle for the file is closed.

  1. What if one process opens a file without NIFB but the next process
    opens it
    with NIFB, is the file cached or not?

Any accesses from the noncached file object will bypass the cache and use
low-level reads/writes. FSD’s job is to maintain the coherency between the
cached file image and on-disk file image altered by low-level writes.
This is described by Rajeev Nagar.

Max