Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/nfs Back in -r1.60 of nfs_serv.c (a long time ago) VOP_M...



details:   https://anonhg.NetBSD.org/src/rev/7e32e4ed67d7
branches:  trunk
changeset: 764364:7e32e4ed67d7
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Apr 18 00:38:33 2011 +0000

description:
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?)

diffstat:

 sys/nfs/nfs_serv.c |  21 ++-------------------
 1 files changed, 2 insertions(+), 19 deletions(-)

diffs (49 lines):

diff -r 08872f25e386 -r 7e32e4ed67d7 sys/nfs/nfs_serv.c
--- a/sys/nfs/nfs_serv.c        Mon Apr 18 00:26:11 2011 +0000
+++ b/sys/nfs/nfs_serv.c        Mon Apr 18 00:38:33 2011 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index