[comp.protocols.appletalk] first problem report

cck@CUNIXC.COLUMBIA.EDU (Charlie C. Kim) (05/26/88)

Sigh.  I found both problems within hours after announcing the
distribution.

Charlie C. Kim
User Services
Columbia University

CAP Release 5.00 - PROBLEM REPORT: 0001

Two problems are reported here since they lie in the same module.

OS: any
Revision: n/a
Major local modifications: n/a
Machine Type: n/a
Date: 4/25/88
Reported by: Charlie C. Kim, cck@cunixc.columbia.edu
Priority: medium

Problem: Transferring a zero length file from an Aufs volume fails.

Diagnosis: CAP 5.0 modified FPRead (actually OSRead) to probe for end
of file even when a zero length request count was received.
Unfortunately, this causes problems when trying to copy zero length
files via the Finder.  In particular, the Finder displays an error
stating "This file could not be copied: (unknown error)".  Don't know
how this got by since it has been in there for quite a while now now.

Solution: Drop back to the old behavior and do not probe for end of
file on a zero length request.  I thought there was a good reason for
doing the probe, but memory and the rcs logs fail me.  A patch
follows.


OS: Ultrix
Revision: 1.2, 2.0 and possibly 1.1
Major local modifications: n/a
Machine Type: n/a
Date: 4/25/88
Reported by: Charlie C. Kim, cck@cunixc.columbia.edu
Priority: low

Problem: Aufs process have a very big data space causing problems on
small machines that are supposed to handle large number of Aufs
processes.

Diagnosis: In afpos.c, getmnt is used to return volume information
such as number of mounted file systems, etc.  getmnt before Ultrix 2.2
did not allow one to specify which file system information is wanted
on.  To maximize efficiency on systems with large numbers of mounted
files systems, NMOUNT (around 64) entries was requested from getmnt.
However, the data structure the information is returned in is very
large: around 2K.  Thus, about 128KB of stack space is required and is
sbrk'ed from the system.  This is faintly ridiculous: no other
routines require anything close to this amount of stack space.

Solution: The actual number of entries requested at a time is set by
the define NUMGETMNTBUF.  The "solution" is two fold.  First, backoff
the number of file systems gotten in a single try by default to 8.
Only very large system will require more.  Second, make NUMGETMNTBUF
be settable (as -DNUMGETMNTBUF=<n> in the aufs Makefile).  Note:
Ultrix 2.2 sites might wish to set this to 1 since Ultrix 2.2 allows
us to retrieve information about a specific file system.

PATCH:
%%START OF PATCH%%
*** /tmp/,RCSt1028456	Wed May 25 14:39:49 1988
--- /tmp/,RCSt2028456	Wed May 25 14:39:52 1988
***************
*** 1,7
  /*
!  * $Author: cck $ $Date: 88/05/13 09:19:18 $
!  * $Header: afpos.c,v 1.81 88/05/13 09:19:18 cck Rel $
!  * $Revision: 1.81 $
  */
  
  /*

--- 1,7 -----
  /*
!  * $Author: cck $ $Date: 88/05/25 14:37:02 $
!  * $Header: afpos.c,v 1.83 88/05/25 14:37:02 cck Rel $
!  * $Revision: 1.83 $
  */
  
  /*
***************
*** 199,205
  # endif
  private int oldgetmnt = ISOLDGETMNT; /* use new or old format getmnt */
  				/* default is based on compiling system */
! #define NUMGETMNTBUF NMOUNT	/* 8 before, let's not be conservative */
  				/* because on systems with many file */
  				/* systems we will get killed with 8 */
  #endif

--- 199,206 -----
  # endif
  private int oldgetmnt = ISOLDGETMNT; /* use new or old format getmnt */
  				/* default is based on compiling system */
! # ifndef NUMGETMNTBUF
! #  define NUMGETMNTBUF 8	/* 8 before, let's not be conservative */
  				/* because on systems with many file */
  				/* systems we will get killed with 8 */
  				/* Back off!!!!! struct fs_data is huge */
***************
*** 202,207
  #define NUMGETMNTBUF NMOUNT	/* 8 before, let's not be conservative */
  				/* because on systems with many file */
  				/* systems we will get killed with 8 */
  #endif
  
  import int errno;

--- 203,210 -----
  #  define NUMGETMNTBUF 8	/* 8 before, let's not be conservative */
  				/* because on systems with many file */
  				/* systems we will get killed with 8 */
+ 				/* Back off!!!!! struct fs_data is huge */
+ # endif
  #endif
  
  import int errno;
***************
*** 906,912
    register char c;
    int cnt,i;
  
- #ifdef notdef
    /* want to probe for eof -- probably there */
    if (reqcnt == 0) {
      *rl = 0;

--- 909,914 -----
    register char c;
    int cnt,i;
  
    /* want to probe for eof -- probably there */
    /* back off this.  If the request count is zero, then */
    /* don't tell them about EOF because zero length files */
***************
*** 908,913
  
  #ifdef notdef
    /* want to probe for eof -- probably there */
    if (reqcnt == 0) {
      *rl = 0;
      return(noErr);

--- 910,918 -----
    int cnt,i;
  
    /* want to probe for eof -- probably there */
+   /* back off this.  If the request count is zero, then */
+   /* don't tell them about EOF because zero length files */
+   /* will not get xfered properly */
    if (reqcnt == 0) {
      *rl = 0;
      return(noErr);
***************
*** 912,918
      *rl = 0;
      return(noErr);
    }
- #endif
  
    if (offs != *fpos)
      lseek(fd,(off_t)offs,L_SET);

--- 917,922 -----
      *rl = 0;
      return(noErr);
    }
  
    if (offs != *fpos)
      lseek(fd,(off_t)offs,L_SET);
***************
*** 917,923
    if (offs != *fpos)
      lseek(fd,(off_t)offs,L_SET);
  
!     if (OSTestLock(fd, reqcnt) != noErr) {
        return(aeLockErr);
    }
  

--- 921,927 -----
    if (offs != *fpos)
      lseek(fd,(off_t)offs,L_SET);
  
!   if (OSTestLock(fd, reqcnt) != noErr) {
        return(aeLockErr);
    }
  
***************
*** 1852,1857
      /* Ultrix 2.2 */
      /* use nostat_one -- we don't want to hang on nfs */
      /* return none if error or (0) - not found */
      if ((num=getmnt(&context, buffer, NOSTAT_ONE, nbytes)) <= 0)
        return(-1);
      bp = buffer;

--- 1856,1862 -----
      /* Ultrix 2.2 */
      /* use nostat_one -- we don't want to hang on nfs */
      /* return none if error or (0) - not found */
+     nbytes = sizeof(struct fs_data);
      if ((num=getmnt(&context, buffer, NOSTAT_ONE, nbytes)) <= 0)
        return(-1);
      bp = buffer;
%%END OF PATCH%%