[OpenAFS] gcc reading beyond end of file on AFS

Derrick J Brashear shadow@dementia.org
Sat, 25 Jan 2003 13:42:44 -0500 (EST)


On Sat, 25 Jan 2003, RD Schaffer wrote:

> Hi there,
> 
>    I cannot explain technically what is going on. But I understand that  
> this is a bug in open afs, which I found a little while ago. If you  
> need a working version of afs to allow builds, you can use the arla  
> client. (I believe they already had this problem but fixed it.) I do  
> not know the schedule for a bug fix for openafs, but am interested to  
> know as well.

Get RCS version 1.4.2.5 of src/afs/DARWIN/osi_vnodeops.c and drop it in
your tree, then rebuild the client. Alternately, apply this patch:
*** openafs/src/afs/DARWIN/osi_vnodeops.c       2002/10/16 03:58:17 1.10
--- openafs/src/afs/DARWIN/osi_vnodeops.c       2003/01/07 23:03:35 1.11
***************
*** 467,472 ****
--- 467,477 ----
      }
      afs_BozonUnlock(&tvc->pvnLock, tvc);
      AFS_GUNLOCK();
+ 
+     /* Zero out rest of last page if there wasn't enough data in the file */
+     if (code == 0 && auio.uio_resid > 0)
+       memset(aiov.iov_base, 0, auio.uio_resid);
+ 
      kernel_upl_unmap(kernel_map, pl);
      if (!nocommit) {
        if (code)