Dejan,
Let me see if I get this correctly:
In the completion routine of your IRP_MJ_CREATE handler, you see a
FileObject->FsContext value that matches something in your tracking
structure, but it has a different value for
FileObject->SectionObjectPointers?
If this is the case, perhaps you can give us some more details: the
version of Windows, the file system involved and confirmation that you
do not have any other filters on the stack (or if you do, which
filters.)
I suppose this is possible (I’ve previously suggested using
SectionObjectPointers as the lookup key, but never pushed the issue on
the presumption that the FsContext and SectionObjectPointer values
should change together.) In the FAT sample of the IFS Kit, it allocates
the FCB separately from the SOP structure
(FCB->NonPagedFcb.SectionObjectPointers is what is used for the SOP
address.) Thus, I suppose it might be tolerable for the FsContext to be
recycled when the SOP is not, although I don’t see any code paths in FAT
that would do that.
So, my question would be: if MM still held a reference on a file object
(SOP was non-NULL) then how did it get rid of it without decrementing
the reference count on the file? The ONLY way I could see this happen
is if someone bumped the ref count on the file object outside MM and
then MM decremented the ref count on the section - but then the ref
count on the file object would still be elevated and the FSD wouldn’t
recycle it yet. And even if we hypothesize some odd case (like around
some internal controlled file for the FSD that it decremented the ref
count on) it doesn’t fit with notepad opening a file like boot.ini…
More details please!
Regards,
Tony
Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Dejan Maksimovic
Sent: Saturday, April 03, 2004 5:22 AM
To: ntfsd redirect
Subject: [ntfsd] Reference counting, yet again
In the NT Insider article on reference counting, it is said to
discard the hash entry when Data and Image section objects are both
non-NULL, which was false.
But, I am having trouble with the opposite as well…
A very simple case: notepad opening editing and saving boot.ini
Section object pointer is non NULL, the image is NULL and Data is
non-null. Obviously I don’t free the hash entry.
Problem? I see an open later with the FsContext that corresponds to
the FsContext in this hash entry.
Ideas?
–
Kind regards, Dejan M. MVP for DDK
http://www.alfasp.com E-mail: xxxxx@alfasp.com Alfa Transparent File
Encryptor - Transparent file encryption services.
Alfa File Protector - File protection and hiding library for Win32
developers.
Alfa File Monitor - File monitoring library for Win32 developers.
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