Seeing different FsContexts for the same file

OK guys, I’m stumped. My filter is seeing a second
unique FsContext for a second create of already open
file on a local NTFS volume (Windows XP), and I’m
asserting. (I know it’s for the same file because the
pathname is identical. In my tracking routines I first
attempt to lookup by FsContext, and if that fails, I
lookup by pathname and assert that I don’t find
anything that represents another open file).

The only situation that I’m aware this can happen is
if the previously open FileObject was marked for
deletion and has been cleaned-up, but not yet closed.
In that case the FileObject will still exist, but with
a stale FsContext. But my filter specificaly looks for
this case by checking for FileObject->DeletePending at
cleanup time. (Is it guaranteed that NTFS will always
set this field appropriately?)

Also, I do update my tracking data structures if a
file is renamed.

Is this my bug or is there a corner case I’m missing?

(BTW OSR is still down so I wasn’t able to peruse the
archives before posting this.)

=====

  • Nicholas Ryan

Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

I would never design a filter that relies on the assumption that there is only ever ONE FsContext for a given file. There are too many unusual scenarios where this assumption breaks. A robust filter does not make this assumption.

-----Original Message-----
From: Nicholas Ryan [mailto:xxxxx@nryan.com]
Sent: Wednesday, June 12, 2002 9:27 PM
To: File Systems Developers
Subject: [ntfsd] Seeing different FsContexts for the same file

OK guys, I’m stumped. My filter is seeing a second
unique FsContext for a second create of already open
file on a local NTFS volume (Windows XP), and I’m
asserting. (I know it’s for the same file because the
pathname is identical. In my tracking routines I first
attempt to lookup by FsContext, and if that fails, I
lookup by pathname and assert that I don’t find
anything that represents another open file).

The only situation that I’m aware this can happen is
if the previously open FileObject was marked for
deletion and has been cleaned-up, but not yet closed.
In that case the FileObject will still exist, but with
a stale FsContext. But my filter specificaly looks for
this case by checking for FileObject->DeletePending at
cleanup time. (Is it guaranteed that NTFS will always
set this field appropriately?)

Also, I do update my tracking data structures if a
file is renamed.

Is this my bug or is there a corner case I’m missing?

(BTW OSR is still down so I wasn’t able to peruse the
archives before posting this.)

=====

  • Nicholas Ryan

Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


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

Yup, it was my bug. I wasn’t correctly decrementing my internal
reference count for the unique open pathname in a particular corner case
where I had to cancel the file open.

  • Nicholas Ryan

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:bounce-ntfsd-
xxxxx@lists.osr.com] On Behalf Of Nicholas Ryan
Sent: Wednesday, June 12, 2002 7:27 PM
To: File Systems Developers
Subject: [ntfsd] Seeing different FsContexts for the same file

OK guys, I’m stumped. My filter is seeing a second
unique FsContext for a second create of already open
file on a local NTFS volume (Windows XP), and I’m
asserting. (I know it’s for the same file because the
pathname is identical. In my tracking routines I first
attempt to lookup by FsContext, and if that fails, I
lookup by pathname and assert that I don’t find
anything that represents another open file).

The only situation that I’m aware this can happen is
if the previously open FileObject was marked for
deletion and has been cleaned-up, but not yet closed.
In that case the FileObject will still exist, but with
a stale FsContext. But my filter specificaly looks for
this case by checking for FileObject->DeletePending at
cleanup time. (Is it guaranteed that NTFS will always
set this field appropriately?)

Also, I do update my tracking data structures if a
file is renamed.

Is this my bug or is there a corner case I’m missing?

(BTW OSR is still down so I wasn’t able to peruse the
archives before posting this.)

=====

  • Nicholas Ryan

Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com


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