Windows: Refactor AFSValidateEntry
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 9 Apr 2012 22:41:13 +0000 (18:41 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 10 Apr 2012 12:48:42 +0000 (05:48 -0700)
commit779c27bf1daaf01c79c0bb7c687781151abb4383
treebf7079b1f264047e5b5a94c01f8231a9cbbd9455
parentd1e59d2d82787d19c81e60db68c76f45560b8465
Windows: Refactor AFSValidateEntry

Refactor AFSValidateEntry to avoid obtaining the
ObjectInformation->Fcb->Resource when it isn't necessary.
This will avoid contention and improve performance.

The only time that the Fcb->Resource is required is when
the object requires verification, the object is a FILE,
and the object was successfully evaluated.

Even with this reorganization there is a small window
of opportunity for a deadlock to occur if a CcPurgeCacheSection()
which is called with the Fcb->Resource held triggers a filter
driver to issue a CreateFile and in between the two operations
an invalidate object is received.

Change-Id: Iddf64f030c6a608ac29a10b7a9a7e130ae6c4249
Reviewed-on: http://gerrit.openafs.org/7143
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Derrick Brashear <shadow@dementix.org>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSGeneric.cpp