NetBSD Problem Report #1917
From gnats Mon Jan 8 14:17:26 1996
Received: from garage.uun.org by pain.lcs.mit.edu (8.6.12/8.6.9) with ESMTP id OAA13533 for <gnats-bugs@gnats.netbsd.org>; Mon, 8 Jan 1996 14:08:36 -0500
Message-Id: <199601081908.OAA01716@garage.uun.org>
Date: Mon, 8 Jan 1996 14:08:09 -0500
From: David Mazieres <dm@uun.org>
Reply-To: dm@uun.org
To: gnats-bugs@gnats.netbsd.org
Subject: Direct mounts don't work with amd
X-Send-Pr-Version: 3.95
>Number: 1917
>Category: kern
>Synopsis: Direct mounts don't work with amd
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Jan 08 14:20:01 +0000 1996
>Closed-Date: Thu May 23 22:41:40 +0000 1996
>Last-Modified: Thu May 23 22:43:01 +0000 1996
>Originator: David Mazieres
>Release: Jan 8, 1996
>Organization:
>Environment:
486 PC
System: 486 PC
>Description:
Direct mounts are broken, because the kernel can't NFS
mount a symlink, only a directory.
>How-To-Repeat:
Create a file amd.test with, for example, the following line:
usr/test type:=link;fs:=/usr/src/sys/arch
Then give the command
amd /usr/test amd.test -type:=direct
Try to cd /usr/test, and ls -al. You will get a stale NFS
file handle error.
>Fix:
Index: sys/nfs/nfs_bio.c
===================================================================
RCS file: /cvs/src/sys/nfs/nfs_bio.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -b -u -r1.1.1.1 -r1.2
--- nfs_bio.c 1995/10/18 08:53:21 1.1.1.1
+++ nfs_bio.c 1996/01/08 07:36:23 1.2
@@ -167,7 +167,11 @@
return (error);
}
}
- if (np->n_flag & NQNFSNONCACHE) {
+ /*
+ * Don't cache magic amd symlinks.
+ */
+ if (np->n_flag & NQNFSNONCACHE
+ || ((vp->v_flag & VROOT) && vp->v_type == VLNK)) {
switch (vp->v_type) {
case VREG:
error = nfs_readrpc(vp, uio, cred);
Index: sys/nfs/nfs_subs.c
===================================================================
RCS file: /cvs/src/sys/nfs/nfs_subs.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -r1.2 -r1.3
--- nfs_subs.c 1995/12/21 14:42:24 1.2
+++ nfs_subs.c 1996/01/08 07:36:26 1.3
@@ -698,7 +698,7 @@
* information.
*/
np = VTONFS(vp);
- if (vp->v_type == VNON) {
+ if (vp->v_type != vtyp) {
if (vtyp == VCHR && rdev == 0xffffffff)
vp->v_type = vtyp = VFIFO;
else
Index: sys/nfs/nfs_vfsops.c
===================================================================
RCS file: /cvs/src/sys/nfs/nfs_vfsops.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -u -r1.3 -r1.4
--- nfs_vfsops.c 1995/12/21 14:42:26 1.3
+++ nfs_vfsops.c 1996/01/08 07:36:28 1.4
@@ -486,6 +486,7 @@
register struct nfsmount *nmp;
struct nfsnode *np;
int error;
+ struct vattr attrs;
if (mp->mnt_flag & MNT_UPDATE) {
nmp = VFSTONFS(mp);
@@ -565,6 +566,7 @@
if (error = nfs_nget(mp, &nmp->nm_fh, &np))
goto bad;
*vpp = NFSTOV(np);
+ VOP_GETATTR(*vpp, &attrs, curproc->p_ucred, curproc);
return (0);
bad:
@@ -664,6 +666,7 @@
if (error = nfs_nget(mp, &nmp->nm_fh, &np))
return (error);
vp = NFSTOV(np);
+ if (vp->v_type == VNON)
vp->v_type = VDIR;
vp->v_flag = VROOT;
*vpp = vp;
Index: usr.sbin/amd/config/os-bsd44.h
===================================================================
RCS file: /cvs/src/usr.sbin/amd/config/os-bsd44.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -b -u -r1.1.1.1 -r1.2
--- os-bsd44.h 1995/10/18 08:47:14 1.1.1.1
+++ os-bsd44.h 1996/01/08 07:36:31 1.2
@@ -196,3 +196,8 @@
*/
#undef RE_HDR
#define RE_HDR <regexp.h>
+
+/*
+ * Need precise length links
+ */
+#define PRECISE_SYMLINKS
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed
State-Changed-By: fvdl
State-Changed-When: Thu May 23 18:41:40 EDT 1996
State-Changed-Why:
Closed; the fix was applied.
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.