From a8a6b8dd93082579d08282c65a6437d66fc5facc Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 28 Mar 2013 00:28:35 -0400 Subject: [PATCH] Windows: additional AFS_SUBSYSTEM_OBJECT_REF_COUNTING Add missing cases of reference count value changes which were not being logged. Change-Id: I8bc26f31f2725e2c324831bce3da0b68a7fb91d9 Reviewed-on: http://gerrit.openafs.org/9690 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp | 48 ++++++++++++++++++---- src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp | 10 ++--- 2 files changed, 43 insertions(+), 15 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp index 1854c0c4b..5a9c8335a 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC. - * Copyright (c) 2009, 2010, 2011 Your File System, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,10 +10,8 @@ * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright - * notice, - * this list of conditions and the following disclaimer in the - * documentation - * and/or other materials provided with the distribution. + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - Neither the names of Kernel Drivers, LLC and Your File System, Inc. * nor the names of their contributors may be used to endorse or promote * products derived from this software without specific prior written @@ -6777,6 +6775,7 @@ AFSFindObjectInfo( IN AFSVolumeCB *VolumeCB, DWORD ntStatus = STATUS_SUCCESS; ULONGLONG ullIndex; AFSObjectInfoCB *pObjectInfo = NULL; + LONG lCount; if ( AFSIsEqualFID( &VolumeCB->ObjectInformation.FileId, FileId)) { @@ -6800,8 +6799,14 @@ AFSFindObjectInfo( IN AFSVolumeCB *VolumeCB, if ( NT_SUCCESS( ntStatus)) { - AFSObjectInfoIncrement( pObjectInfo, - AFS_OBJECT_REFERENCE_FIND); + lCount = AFSObjectInfoIncrement( pObjectInfo, + AFS_OBJECT_REFERENCE_FIND); + + AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSFindObjectInfo Decrement count on object %p Cnt %d\n", + pObjectInfo, + lCount)); } return pObjectInfo; @@ -6810,9 +6815,16 @@ AFSFindObjectInfo( IN AFSVolumeCB *VolumeCB, void AFSReleaseObjectInfo( IN AFSObjectInfoCB **ppObjectInfo) { + LONG lCount; - AFSObjectInfoDecrement( *ppObjectInfo, - AFS_OBJECT_REFERENCE_FIND); + lCount = AFSObjectInfoDecrement( *ppObjectInfo, + AFS_OBJECT_REFERENCE_FIND); + + AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSReleaseObjectInfo Decrement count on object %p Cnt %d\n", + *ppObjectInfo, + lCount)); *ppObjectInfo = NULL; } @@ -8364,6 +8376,12 @@ AFSCloseLibrary() lCount = AFSObjectInfoDecrement( AFSGlobalDotDirEntry->ObjectInformation, AFS_OBJECT_REFERENCE_GLOBAL); + AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSCloseLibrary Decrement count on parent object %p Cnt %d\n", + AFSGlobalDotDirEntry->ObjectInformation, + lCount)); + AFSDeleteObjectInfo( &AFSGlobalDotDirEntry->ObjectInformation); ExDeleteResourceLite( &AFSGlobalDotDirEntry->NonPaged->Lock); @@ -8381,6 +8399,12 @@ AFSCloseLibrary() lCount = AFSObjectInfoDecrement( AFSGlobalDotDotDirEntry->ObjectInformation, AFS_OBJECT_REFERENCE_GLOBAL); + AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSCloseLibrary Decrement count on parent object %p Cnt %d\n", + AFSGlobalDotDotDirEntry->ObjectInformation, + lCount)); + AFSDeleteObjectInfo( &AFSGlobalDotDotDirEntry->ObjectInformation); ExDeleteResourceLite( &AFSGlobalDotDotDirEntry->NonPaged->Lock); @@ -8405,6 +8429,12 @@ AFSCloseLibrary() lCount = AFSObjectInfoDecrement( pDirNode->ObjectInformation, AFS_OBJECT_REFERENCE_GLOBAL); + AFSDbgTrace(( AFS_SUBSYSTEM_OBJECT_REF_COUNTING, + AFS_TRACE_LEVEL_VERBOSE, + "AFSCloseLibrary Decrement count on parent object %p Cnt %d\n", + pDirNode->ObjectInformation, + lCount)); + AFSDeleteObjectInfo( &pDirNode->ObjectInformation); ExDeleteResourceLite( &pDirNode->NonPaged->Lock); diff --git a/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp b/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp index 478f98709..32cab2036 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSWorker.cpp @@ -1,6 +1,6 @@ /* * Copyright (c) 2008, 2009, 2010, 2011 Kernel Drivers, LLC. - * Copyright (c) 2009, 2010, 2011 Your File System, Inc. + * Copyright (c) 2009, 2010, 2011, 2012, 2013 Your File System, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -10,10 +10,8 @@ * - Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright - * notice, - * this list of conditions and the following disclaimer in the - * documentation - * and/or other materials provided with the distribution. + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. * - Neither the names of Kernel Drivers, LLC and Your File System, Inc. * nor the names of their contributors may be used to endorse or promote * products derived from this software without specific prior written @@ -1065,7 +1063,7 @@ AFSExamineDirectory( IN AFSObjectInfoCB * pCurrentObject, AFSReleaseResource( &pCurrentChildObject->NonPagedInfo->ObjectInfoLock); - AFSDbgTrace(( AFS_SUBSYSTEM_CLEANUP_PROCESSING, + AFSDbgTrace(( AFS_SUBSYSTEM_CLEANUP_PROCESSING | AFS_SUBSYSTEM_OBJECT_REF_COUNTING, AFS_TRACE_LEVEL_VERBOSE, "AFSExamineDirectory Deleting object %p\n", pCurrentChildObject)); -- 2.39.5