NFS bug in Ultrix 3.1 (on DEC3100)
Steve Freed
sfreed at gauss.unm.edu
Thu Nov 8 05:42:06 AEST 1990
In article <1990Nov6.022044.19498 at watcgl.waterloo.edu>, megauter at 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 at ariel.unm.edu
More information about the Comp.unix.ultrix
mailing list