NTFS has a BUG in NtfsCommonSetInformation

Hi everyone (mostly at Microsoft) !

When I was testing my FS filter driver on W2K I have found very hard BUG in
NTFS.
Not correct handling appears only if NtfsSetRenameInfo chooses to process
the
request asynchronously. The problem is the NtfsCommonSetInformation has
a variable VcbAcquired (which is initialized to FALSE and set to TRUE when
the Vcb is acquired either shared or exclusively), but in the finally
statement
there is invalid part of code like this:

if (Status != STATUS_PENDING)
{
if (VcbAcquired)
{
ExReleaseResource(Vcb->Resource);
}

//Completing the request if not AbnormalTermination
}

I think there is no reason to place the code “if(VcbAcquired) {}” into the
above
“if (Status != STATUS_PENDING) {}” except creation non correct code.
If there is an author of these lines at Microsoft, please tell me how many
alcohol you had in your blood when you typed the code.

This mail contains attachement NTFSBUG.C. I have tried to descript main
ideas in the three routines NtfsCommonSetInformation, NtfsSetRenameInfo
and NtfsSetLinkInfo. Only the conditions which tells the request to be done
asynchronously are not clear to me. I think the IrpContext->Flags must
contain IRP_CONTEXT_FLAG_WAIT to disable this option.

NT 4 NTFS chooses very rarely to post the request (almost on directory
renaming) but W2K NTFS always does this.

Is some of you already familiar with this BUG ?

Paul

<<ntfsbug.c>></ntfsbug.c>