🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #2344

Re: NFS bug in Ultrix 3.1 (on DEC3100)

#2344
From: Steve Freed
Date: Wed, 07 Nov 1990 18:42
66 lines
3116 bytes
In article <1990Nov6.022044.19498@watcgl.waterloo.edu>, megauter@watcgl.waterloo.edu (Marc E. Gauthier) writes:
> In developing an NFS client implementation, I discovered a bug in NFS server
> implementations under Ultrix (Ultrix-32 V3.1 (Rev. 11)).  The VAXen servers
> kept crashing while testing my client, and I wondered why - it seems that any
> time I refer to a file outside the filesystem I have mounted (either through an
> unmounted mount point, or by giving absolute path names), the VAX panics and
> reboots.

     In /usr/include/fs/nfs/nfs.h, the structure declaration for NFS file
handles (fhandle_t) is incorrect.  This causes sizeof(struct fhandle_t) to
yield 36 instead of the proper size (32).  The Ultrix kernel code that handles
the caching of NFS file handles depends upon this size and because of the
mis-declaration, it breaks when you use it.. this is also true when trying
to use amd.

Workarounds:

     For Ultrix 3.1, change the rfind() routine in sys/fs/nfs/nfs_subr.c to
use the proper file handle size.

*** /tmp/,RCSt1a09412   Wed Oct 24 15:14:09 1990
--- /tmp/,RCSt2a09412   Wed Oct 24 15:14:14 1990
***************
*** 748,754 ****
--- 748,760 ----
        for (gp = ih->gh_chain[0]; gp != (struct gnode *)ih; gp = gp->g_forw) {
                if (gno == gp->g_number && fsid == gp->g_dev) {

+ #ifdef UW
+                       /* For the MIPS architecture, sizeof(*fh) = 36,
+                          instead of the expected 32. */
+                       if (bcmp(vtofh((struct vnode *)gp), fh, NFS_FHSIZE)) {
+ #else
                        if (bcmp(vtofh((struct vnode *)gp), fh, sizeof(*fh))) {
+ #endif UW
  if (cachedebug) printf("rfind: rejected stale gnode, #%d, 0x%x\n",
  gp->g_number, gp);
                                continue;

For Ultrix 4.0, make the equivalent change to the nfs_match() routine in
sys/fs/nfs/nfs_subr.c:

*** /tmp/,RCSt1a09579   Wed Oct 24 15:27:21 1990
--- nfs_subr.c  Wed Oct 24 15:25:25 1990
***************
*** 607,613 ****
--- 607,619 ----
        struct rnode_data *rdp;
  {
        return(!bcmp(vtofh((struct vnode *)gp), rdp->rn_fh,
+ #ifdef UW
+                    /* For the MIPS architecture, sizeof(*fh) = 36,
+                       instead of the expected 32. */
+                    NFS_FHSIZE));
+ #else
                sizeof(fhandle_t)));
+ #endif UW
  }

  /*


-- 

Thanks,
Steve.                    sfreed@ariel.unm.edu
Technical Details
Message-ID: <1990Nov7.184206.23103@ariel.unm.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!unmvax!ariel.unm.edu!gauss.unm.edu!sfreed
References: <1990Nov6.022044.19498@watcgl.waterloo.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!unmvax!ariel.unm.edu!gauss.unm.edu!sfreed
From: sfreed@gauss.unm.edu (Steve Freed)
Newsgroups: comp.sys.dec,comp.unix.ultrix,comp.protocols.nfs
Subject: Re: NFS bug in Ultrix 3.1  (on DEC3100)
Message-ID: <1990Nov7.184206.23103@ariel.unm.edu>
Date: 7 Nov 90 18:42:06 GMT
References: <1990Nov6.022044.19498@watcgl.waterloo.edu>
Sender: news@ariel.unm.edu (USENET News System)
Reply-To: sfreed@gauss.unm.edu (Steve Freed)
Organization: University of New Mexico Math. & Stat. Dept., Albq, NM
Lines: 66