Deadlock when DELETE offline file via net share by using command line

Hi
I’m developing a hierarchical storage management (HSM) using a mini filter on NTFS.
WDK/DDK is 6001.18002 version and VS2005 is used.

I have expirience of dead-lock when run delete command in console from remote client or locally via net share. Ordinary file access works well. File is recalled and shows up.
Remote client is W7 x64 and server is W 2003 enterprise X64 R2 SP2
Also other combination of platforms fails at delete.

command example: > del \mysharenet\file1.txt

Deadlock scenario:

  1. User on client issue a DELETE operation.
  2. minifilter catch delete operation in FLT_POST_OPERATION_CALLBACK
    In minifilter are folloving file options set
    createShareAccess:
  • FILE_SHARE_READ
  • FILE_SHARE_WRITE
  • FILE_SHARE_DELETE
    createOptions: 0x1000140
  • FILE_NON_DIRECTORY_FILE
  • FILE_COMPLETE_IF_OPLOCKED
  • 0x1000000 not sure if this bit is FILE_OPEN_REQUIRING_OPLOCK
    uiDesiredAccess: 0x10080
  • DELETE
  • FILE_READ_ATTRIBUTES
  1. File is OFFLINE, so minifilter send message to service in user space to recall a file content back to FS and waits for reply or timeouts.
  2. Servise try to open a file to recall but hang.
    hFile = CreateFileW(
    filePath,
    GENERIC_WRITE,
    0,
    NULL,
    TRUNCATE_EXISTING,
    FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_OPEN_NO_RECALL ,
    NULL);
  3. the minifilter that waits for reply timeouts and send a fail message to user.
  4. Service hanged function CreateFileW() is released and successfuly recall a file, but it is too late.

File is successfully deleted when using windows Explorer on remote client.
Minifilter file options are equal as for failed DELETE via command line.

The same failure happened if a delete command is issued on local machine but via network share path. In this case also a delete by using windows Explorer hangs and after a timeouts a message “Cannot delete : The remote storage service was not able to recall the file.” appear.

Do you experience of similar problem?
Is there a problem with opportunistic lock?
How to handle such a problem?

Thanks
Dejan