OpenAFS CVS Commit: openafs/src/WINNT/afsd by jaltman

Sun, 03 Oct 2004 09:35:16 EDT

Update of /cvs/openafs/src/WINNT/afsd
In directory GRAND.CENTRAL.ORG:/home/jaltman/openafs/cvs-1-4/src/WINNT/afsd

Modified Files:
      Tag: openafs-stable-1_4_x
	afsd_flushvol.c afsd_service.c lanahelper.cpp lanahelper.h 
Log Message:
DELTA win-power-mgmt-flush-test-20041003

The windows power management code responds to a request to suspend or
hibernate by performing a "fs flushvol" as the logged in user on each
of the SMB/CIFS mounted shares.  This can be very time consuming if
the cell servers cannot be reached.

This patch adds a test to ensure that there is at least one network
adapter in the machine which is not a loopback adapter.

While developing this patch other areas of concern have been raised.
The power management code waits a fixed period of time based upon
the hard dead timeout before allowing the suspend/hibernate to continue.
This allows the machine to shutdown even if there are active flush
operations being performed.  This defeats the benefit of performing
the flush at all.

A better mechanism could be developed if the functions called via
cm_IoctlFlushVolume returned and checked error codes.  Then it might
be possible to abandon the flush operation if a Server Not Reachable
state was obtained.

The power management flush operations will also not work on Terminal
Server.  This would be important in the case where a terminal server
is shutting down due to a switch over to a UPS.  The reason it does
not work on Terminal Server is that there is that it is not possible
for afsd_service.exe to enumerate the SMB/CIFS shares and impersonate
the individual logged in users.

It would be preferred for there to be a new cm_FlushAll() function
implemented which was not dependent on the use of the ioctl mechanism
for the purpose of identifying a volume ID or a user ID.

--- DELTA config for openafs-stable-1_4_x follows ---
win-power-mgmt-flush-test-20041003 openafs/src/WINNT/afsd/afsd_flushvol.c 1.6
win-power-mgmt-flush-test-20041003 openafs/src/WINNT/afsd/afsd_service.c 1.28
win-power-mgmt-flush-test-20041003 openafs/src/WINNT/afsd/lanahelper.cpp 1.8
win-power-mgmt-flush-test-20041003 openafs/src/WINNT/afsd/lanahelper.h 1.3