Windows: Do not open file if shutdown in progress

Perform the shutdown check earlier in AFSCommonCreate() to prevent
a request from being processed after the service indicates that
a shutdown has begun.

Change-Id: I8959141b5e2161ffe960e93a500b1153d9594a28
Reviewed-on: http://gerrit.openafs.org/6647
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
This commit is contained in:
Jeffrey Altman 2012-02-03 11:14:50 -05:00 committed by Jeffrey Altman
parent 209df87d08
commit 4224dc5c28

View File

@ -187,6 +187,21 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
(ULONGLONG)PsGetCurrentThreadId(),
&stAuthGroup);
//
// If we are in shutdown mode then fail the request
//
if( BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_REDIRECTOR_SHUTDOWN))
{
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_WARNING,
"AFSCommonCreate (%08lX) Open request after shutdown\n",
Irp);
try_return( ntStatus = STATUS_TOO_LATE);
}
if( !BooleanFlagOn( AFSGlobalRoot->ObjectInformation.Flags, AFS_OBJECT_FLAGS_DIRECTORY_ENUMERATED))
{
@ -204,21 +219,6 @@ AFSCommonCreate( IN PDEVICE_OBJECT DeviceObject,
}
}
//
// If we are in shutdown mode then fail the request
//
if( BooleanFlagOn( pDeviceExt->DeviceFlags, AFS_DEVICE_FLAG_REDIRECTOR_SHUTDOWN))
{
AFSDbgLogMsg( AFS_SUBSYSTEM_FILE_PROCESSING,
AFS_TRACE_LEVEL_WARNING,
"AFSCommonCreate (%08lX) Open request after shutdown\n",
Irp);
try_return( ntStatus = STATUS_TOO_LATE);
}
//
// Go and parse the name for processing.
// If ulParseFlags is returned with AFS_PARSE_FLAG_FREE_FILE_BUFFER set,