FltSetInformationFile deadlocks

Hi all,
In a preclose callback I attempt to increase the file size in order to write a file footer with a paging FltWriteFile (write needs to be paging in order to be allowed post cleanup but paging writes can’t extend file). However, calling FltSetInformationFile never returns. Anyone know why it is not returning or of a way of writing my footer in a pre close?

Thanks in advance!

Callstack for deadlock:

nt!KiSwapContext
nt!KiSwapThread
nt!KeWaitForSingleObject
nt!FsRtlWaitOnIrp
nt!FsRtlOplockBreakToNone
nt!FsRtlCheckOplock
Ntfs!NtfsCommonSetInformation
Ntfs!NtfsFsdSetInformation
nt!IopfCallDriver
nt!IovCallDriver
fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted
fltmgr!FltPerformSynchronousIo
fltmgr!FltSetInformationFile
TetraShd!ResidentMiniFilterSetFileSize[My MiniFilter]
TetraShd!ResidentMiniFilterPreClose[My MiniFilter]
fltmgr!FltvPreOperation
fltmgr!FltpPerformPreCallbacks
fltmgr!FltpPassThroughInternal
fltmgr!FltpPassThrough

  1. Do you mean preclose or precleanup?
  2. What is on the stack above fltmgr

Also you are (obviously) deadlocking through an oplock. You need to find
out the file object that is holding the oplock and work out what is stopping
that.

Just idle curiosity, but what do you do when the machine writes encrypted
data to the file and then crashes before you get to write your header?

Rod

wrote in message news:xxxxx@ntfsd…
> Hi all,
> In a preclose callback I attempt to increase the file size in order to
> write a file footer with a paging FltWriteFile (write needs to be paging
> in order to be allowed post cleanup but paging writes can’t extend file).
> However, calling FltSetInformationFile never returns. Anyone know why it
> is not returning or of a way of writing my footer in a pre close?
>
> Thanks in advance!
>
> Callstack for deadlock:
>
> nt!KiSwapContext
> nt!KiSwapThread
> nt!KeWaitForSingleObject
> nt!FsRtlWaitOnIrp
> nt!FsRtlOplockBreakToNone
> nt!FsRtlCheckOplock
> Ntfs!NtfsCommonSetInformation
> Ntfs!NtfsFsdSetInformation
> nt!IopfCallDriver
> nt!IovCallDriver
> fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted
> fltmgr!FltPerformSynchronousIo
> fltmgr!FltSetInformationFile
> TetraShd!ResidentMiniFilterSetFileSize[My MiniFilter]
> TetraShd!ResidentMiniFilterPreClose[My MiniFilter]
> fltmgr!FltvPreOperation
> fltmgr!FltpPerformPreCallbacks
> fltmgr!FltpPassThroughInternal
> fltmgr!FltpPassThrough
>

After CleanUp, the file object is no longer valid for SetInfo request.

wrote in message news:xxxxx@ntfsd…
> Hi all,
> In a preclose callback I attempt to increase the file size in order to
> write a file footer with a paging FltWriteFile (write needs to be paging
> in order to be allowed post cleanup but paging writes can’t extend file).
> However, calling FltSetInformationFile never returns. Anyone know why it
> is not returning or of a way of writing my footer in a pre close?
>
> Thanks in advance!
>
> Callstack for deadlock:
>
> nt!KiSwapContext
> nt!KiSwapThread
> nt!KeWaitForSingleObject
> nt!FsRtlWaitOnIrp
> nt!FsRtlOplockBreakToNone
> nt!FsRtlCheckOplock
> Ntfs!NtfsCommonSetInformation
> Ntfs!NtfsFsdSetInformation
> nt!IopfCallDriver
> nt!IovCallDriver
> fltmgr!FltpLegacyProcessingAfterPreCallbacksCompleted
> fltmgr!FltPerformSynchronousIo
> fltmgr!FltSetInformationFile
> TetraShd!ResidentMiniFilterSetFileSize[My MiniFilter]
> TetraShd!ResidentMiniFilterPreClose[My MiniFilter]
> fltmgr!FltvPreOperation
> fltmgr!FltpPerformPreCallbacks
> fltmgr!FltpPassThroughInternal
> fltmgr!FltpPassThrough
>

That’s what I thought. Guess I’ll have to write the footer in pre-cleanup and keep the listening for paging irps until close. To answer Rod’s question, I plan on implementing a component that periodically backs up the file so that in the unlikely event that a crash happens the file can at least be recovered.