[OpenAFS-devel] OpenAFS 1.3.70 client - a "write" causes a zero-length FetchData RPC for every chunk

Rainer Toebbicke rtb@pclella.cern.ch
31 Aug 2004 11:56:04 +0200


Hello,

While tracing the 1.3.70 server (with largefile support, to a 1.3.70
client) I realized that for a file write (existing file, re-written with
truncate "dd of=..." from offset 0) the fileserver logs zillions of
FetchData requests. Improving a bit on the fileserver logging it turns
out that it is one zero-length FetchData for every chunk. 

There are some comments in afs_dcache.c () about bypassing 0-length
reads only for DV 0, but is this necessary?

The 1.2.10 client does not do this.

The reason (line 1826ff) is that owing to some code-restructuring in
afs_dcache.c "AFS_CHUNKTOBASE(chunk) >= avc->m.Length" is no longer
checked for.

The quick fix is of course
  "overWriteWholeChunk |= (AFS_CHUNKTOBASE(chunk)>=avc->m.Length)"
but somebody better check (and comment!) the purpose of "adjustsize" in
that context - I didn't understand it.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Rainer Toebbicke 
European Laboratory for Particle Physics(CERN) - Geneva, Switzerland  
Phone: +41 22 767 8985       Fax: +41 22 767 7155