Windows: cm_GetBuffer does not need to contact file server when extended a file
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 28 Sep 2009 14:22:31 +0000 (16:22 +0200)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Mon, 28 Sep 2009 17:30:27 +0000 (10:30 -0700)
commit45e98a4455e1da7e79b70a4c42dccb07ab9102a6
tree7b470ab9005b3e132877a7813f2f7d2353ed97dc
parent50e98677ca5b62b3b82608c6da3e719956d3a03d
Windows: cm_GetBuffer does not need to contact file server when extended a file

If cm_GetBuffer is being called in order to obtain a buffer to store
data beyond the end of the existing file as known to the file server
there is no reason to contact the file server.  Instead use the cached
status info in order to allocate a new buffer zero initialized.

This logic avoids triggering the FetchData bug in all file servers
older than 1.4.12 and 1.5.65 in which the file server returns a
large negative number (filesize - requested_offset) when a FetchData
is received where the requested_offset is larger than the filesize.
It also avoids unnecessary work.

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/542
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
src/WINNT/afsd/cm_dcache.c