Rename & QueryInfoFile/FileNameInformation

Hi everyone!

I need some clarification on how rename and
QueryInfoFile/FileNameInformation behave together. In my test I have two
threads: one in the loop renames files in a folder another opens/closes
files in the same folder. What I see sometimes in the create dispatch in
the context of the 2-nd thread is that a file is opened, its name in
FileObject shows “name-30” but at the same time when I call
QueryInfoFile/FileNameInformation on that FileObject it returns
“name-29” that used to be a name of this file just before rename
occurred (i.e I renamed it from name-29 to name-30). So, it looks to me
like there is some “window” in which file has actually a new name but
QueryInfo/FileName still returns an old one. I just want to verify that
what I’m observing is what I supposed to observe and not an evidence
that I make the system “misbehave” or something…

TIA,

Vladimir

Vladimir,

What you are seeing is perfectly normal and expected.

What probably happened is that your query information goes down and
retrieves the name but before it returns to you a context switch
occurred, the file is renamed, the rename returns, and then the original
query returns with the old name.

Neal Christiansen

Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Vladimir
Chtchetkine
Sent: Wednesday, March 03, 2004 3:52 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Rename & QueryInfoFile/FileNameInformation

Hi everyone!

I need some clarification on how rename and
QueryInfoFile/FileNameInformation behave together. In my test I have two
threads: one in the loop renames files in a folder another opens/closes
files in the same folder. What I see sometimes in the create dispatch in
the context of the 2-nd thread is that a file is opened, its name in
FileObject shows “name-30” but at the same time when I call
QueryInfoFile/FileNameInformation on that FileObject it returns
“name-29” that used to be a name of this file just before rename
occurred (i.e I renamed it from name-29 to name-30). So, it looks to me
like there is some “window” in which file has actually a new name but
QueryInfo/FileName still returns an old one. I just want to verify that
what I’m observing is what I supposed to observe and not an evidence
that I make the system “misbehave” or something…

TIA,

Vladimir


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

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

Thanks, Neal.

No, picture is a little bit different! Rename has occurred (at least
partially) BEFORE my queryinfo reaches FSD and even before FSD handles
create. Here is the sequence of events in the create dispatch:

  1. Create name-30 comes to my filter (I can see this name in FO)
  2. I pass it down to FSD below
  3. With opened FO I call queryinfo to retrieve pathname and it returns
    name-29

The renaming thread increments numeric part of the name so name-30 is
“newer” than name-29. So, my conclusion was that [part of] rename has
occurred before name-30 was opened because a) otherwise create would
fail and b) the second thread (that opens files) wouldn’t be aware of
name-30 (it enums files in folder first and only then opens each file as
it is found). But still, queryinfo returns “old” name…

Regards,

Vladimir

-----Original Message-----
From: Neal Christiansen [mailto:xxxxx@windows.microsoft.com]
Sent: Tuesday, March 09, 2004 10:45 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Rename & QueryInfoFile/FileNameInformation

Vladimir,

What you are seeing is perfectly normal and expected.

What probably happened is that your query information goes down and
retrieves the name but before it returns to you a context switch
occurred, the file is renamed, the rename returns, and then the original
query returns with the old name.

Neal Christiansen

Microsoft File System Filter Group Lead
This posting is provided “AS IS” with no warranties, and confers no
rights.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Vladimir
Chtchetkine
Sent: Wednesday, March 03, 2004 3:52 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Rename & QueryInfoFile/FileNameInformation

Hi everyone!

I need some clarification on how rename and
QueryInfoFile/FileNameInformation behave together. In my test I have two
threads: one in the loop renames files in a folder another opens/closes
files in the same folder. What I see sometimes in the create dispatch in
the context of the 2-nd thread is that a file is opened, its name in
FileObject shows “name-30” but at the same time when I call
QueryInfoFile/FileNameInformation on that FileObject it returns
“name-29” that used to be a name of this file just before rename
occurred (i.e I renamed it from name-29 to name-30). So, it looks to me
like there is some “window” in which file has actually a new name but
QueryInfo/FileName still returns an old one. I just want to verify that
what I’m observing is what I supposed to observe and not an evidence
that I make the system “misbehave” or something…

TIA,

Vladimir


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

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.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@borland.com
To unsubscribe send a blank email to xxxxx@lists.osr.com