"EXCEPTION - AFSSetFileInfo\n");
ntStatus = STATUS_UNSUCCESSFUL;
+
+ if( bReleaseMain)
+ {
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+ }
}
AFSCompleteRequest( Irp,
//
// If this is a truncation we need to grab the paging IO resource.
//
+
AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
AFS_TRACE_LEVEL_VERBOSE,
"AFSSetAllocationInfo Acquiring Fcb PagingIo lock %08lX EXCL %08lX\n",
bReleasePaging = TRUE;
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
pFcb->Header.AllocationSize = pBuffer->AllocationSize;
//
// Tell Cc if allocation is increased.
//
+
+ AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetAllocationInfo Acquiring Fcb PagingIo lock %08lX EXCL %08lX\n",
+ &pFcb->NPFcb->PagingResource,
+ PsGetCurrentThread());
+
+ AFSAcquireExcl( &pFcb->NPFcb->PagingResource,
+ TRUE);
+
+ bReleasePaging = TRUE;
+
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+
bTellCc = pBuffer->AllocationSize.QuadPart > pFcb->Header.AllocationSize.QuadPart;
pFcb->Header.AllocationSize = pBuffer->AllocationSize;
{
AFSReleaseResource( &pFcb->NPFcb->PagingResource);
+
+ AFSAcquireExcl( &pFcb->NPFcb->Resource,
+ TRUE);
}
return ntStatus;
}
else
{
+
//
// If this is a truncation we need to grab the paging
// IO resource.
bReleasePaging = TRUE;
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+
pFcb->Header.AllocationSize = pBuffer->EndOfFile;
pFcb->Header.FileSize = pBuffer->EndOfFile;
}
else
{
+
//
// extending the file, move EOF
//
+ //
+ // If this is a truncation we need to grab the paging
+ // IO resource.
+ //
+ AFSDbgLogMsg( AFS_SUBSYSTEM_LOCK_PROCESSING,
+ AFS_TRACE_LEVEL_VERBOSE,
+ "AFSSetAllocationInfo Acquiring Fcb PagingIo lock %08lX EXCL %08lX\n",
+ &pFcb->NPFcb->PagingResource,
+ PsGetCurrentThread());
+
+ AFSAcquireExcl( &pFcb->NPFcb->PagingResource,
+ TRUE);
+
+ bReleasePaging = TRUE;
+
+ //
+ // Must drop the Fcb Resource. When changing the file size
+ // a deadlock can occur with Trend Micro's filter if the file
+ // size is set to zero.
+ //
+
+ AFSReleaseResource( &pFcb->NPFcb->Resource);
+
pFcb->Header.FileSize = pBuffer->EndOfFile;
pFcb->ObjectInformation->EndOfFile = pBuffer->EndOfFile;
{
AFSReleaseResource( &pFcb->NPFcb->PagingResource);
+
+ AFSAcquireExcl( &pFcb->NPFcb->Resource,
+ TRUE);
}
return ntStatus;