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.