[8889] in Athena Bugs

home help back first fref pref prev next nref lref last post

Another NFS translator fix

daemon@ATHENA.MIT.EDU (Richard Basch)
Tue Jan 28 06:42:45 1992

Date: Tue, 28 Jan 92 06:42:28 -0500
To: afsbugs@transarc.com
Cc: hamel@transarc.com
Cc: bugs@MIT.EDU, bug-afs@Athena.MIT.EDU
From: "Richard Basch" <basch@MIT.EDU>


The readdir() function on some clients may hang because an EOF is never
sent back...  The following also optimizes the code by setting the EOF
whenever there is a short read (the end of the directory has been
reached), so that another roundtrip is not required to send zero data
and only an EOF.

The reason that many clients seem to work is that the readdir() function
within the C library is forgiving and will stop when the data count is
zero.  On OS/2 clients, this is not the case, thus causing an infinite
loop.

-Richard



*** /tmp/,RCSt1a05735	Tue Jan 28 06:38:33 1992
--- afs/afs_nfssrv.c	Mon Jan 27 15:19:12 1992
***************
*** 310,320 ****
  	 *  returns properly.
  	 */
  	error = afs_readdir_with_offlist(vp, &uio, u.u_cred, rd->rd_offlist);
! 	if (error || uio.uio_resid == rda->rda_count) {
  		rd->rd_size = 0;
  	} else {
  		rd->rd_size = rda->rda_count - uio.uio_resid;
! 		rd->rd_eof = FALSE;
  	}
  #ifdef	notdef
  #ifdef	AFS
--- 310,321 ----
  	 *  returns properly.
  	 */
  	error = afs_readdir_with_offlist(vp, &uio, u.u_cred, rd->rd_offlist);
! 	if (error) {
  		rd->rd_size = 0;
+ 		rd->rd_eof = TRUE;
  	} else {
  		rd->rd_size = rda->rda_count - uio.uio_resid;
! 		rd->rd_eof = (uio.uio_resid ? TRUE : FALSE);
  	}
  #ifdef	notdef
  #ifdef	AFS

home help back first fref pref prev next nref lref last post