Module Name:    src
Committed By:   dholland
Date:           Mon Apr 18 00:38:33 UTC 2011

Modified Files:
        src/sys/nfs: nfs_serv.c

Log Message:
Back in -r1.60 of nfs_serv.c (a long time ago) VOP_MKNOD was changed
so nfsd no longer needed to do a lookup() call immediately afterwards
to retrieve the newly created object.

Since that change there has been no way for ISSYMLINK to be set upon
return from VOP_MKNOD (or before the call to VOP_MKNOD either) so
remove the test for it and associated block of dead code.

(I do not understand how this code was reachable before then either.
The logic in question is only reached if no object by that name
existed, and there's no reasonable way that a successful call to
VOP_MKNOD should ever create a symlink. The code appears to come from
4.4lite; maybe they had locking bugs?)


To generate a diff of this commit:
cvs rdiff -u -r1.158 -r1.159 src/sys/nfs/nfs_serv.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/nfs/nfs_serv.c
diff -u src/sys/nfs/nfs_serv.c:1.158 src/sys/nfs/nfs_serv.c:1.159
--- src/sys/nfs/nfs_serv.c:1.158	Mon Apr 11 01:33:05 2011
+++ src/sys/nfs/nfs_serv.c	Mon Apr 18 00:38:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs_serv.c,v 1.158 2011/04/11 01:33:05 dholland Exp $	*/
+/*	$NetBSD: nfs_serv.c,v 1.159 2011/04/18 00:38:33 dholland Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.158 2011/04/11 01:33:05 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nfs_serv.c,v 1.159 2011/04/18 00:38:33 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1527,18 +1527,6 @@
 			if (error) {
 				nfsm_reply(0);
 			}
-			if (nd.ni_cnd.cn_flags & ISSYMLINK) {
-				vput(nd.ni_vp);
-				vrele(nd.ni_dvp);
-				VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
-				if (nd.ni_pathbuf != NULL) {
-					pathbuf_destroy(nd.ni_pathbuf);
-					nd.ni_pathbuf = NULL;
-				}
-				error = EINVAL;
-				abort = 0;
-				nfsm_reply(0);
-			}
 		} else {
 			VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
 			if (nd.ni_pathbuf != NULL) {
@@ -1743,11 +1731,6 @@
 		error = VOP_MKNOD(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &va);
 		if (error)
 			goto out;
-		if (nd.ni_cnd.cn_flags & ISSYMLINK) {
-			vput(nd.ni_vp);
-			VOP_ABORTOP(nd.ni_dvp, &nd.ni_cnd);
-			error = EINVAL;
-		}
 	}
 out:
 	vp = nd.ni_vp;

Reply via email to