OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_76-2503-gc6782b8
Gerrit Code Review
gerrit@openafs.org
Thu, 10 May 2012 15:46:41 -0700 (PDT)
The following commit has been merged in the master branch:
commit c6782b86d77f8653d8dd4bc27d0cbcca5f13747f
Author: Jeffrey Altman <jaltman@your-file-system.com>
Date: Thu May 10 08:36:33 2012 -0400
Windows: Avoid deadlock during "fs memdump"
When the afs redirector is in use, it is possible that "fs memdump"
could be executed while all of the pages in the Windows page cache
are dirty with data that must be purged and flushed to \\afs. In
such a situation it is not safe for afsd_service.exe to hold
global locks such as buf_globalLock, cm_scacheLock, etc. while
performing WriteFile() calls against %TEMP%\afsd_alloc.log if
afsd_alloc.log was opened without the FILE_FLAG_NO_BUFFERING flag.
Doing so can result in a deadlock as it can become impossible for
the Windows page cache to purge data to complete the WriteFile()
as all extent operations block waiting for the global lock to
be cleared.
The correct long term approach would be to use the FILE_FLAG_NO_BUFFERING
flag when opening %TEMP%\afsd_alloc.log. However, this requires that
all writes to the file be performed using buffers that are consistent
with the drive geometry. Such an approach would be incompatible with
the _CrtMemDumpAllObjectsSince() operation and would require a redesign
of the current interfaces. See
http://msdn.microsoft.com/en-us/library/windows/desktop/cc644950(v=vs.85).aspx
for requirements when using non-buffered writes.
The short term fix is to dump the contents without holding the
global locks. This can result in an inconsistent view of the world
but will ensure that deadlocks are avoided. This patchset makes
such a change when the afs redirector is in use.
Change-Id: I6ffc0ff7c80707f16bf132f2dcab7dab5727894d
Reviewed-on: http://gerrit.openafs.org/7391
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/WINNT/afsd/cm_ioctl.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
--
OpenAFS Master Repository