:I think I (well, Alfred Perlstein) have found what the problem is - in
:nfs_symlink, newvp isn't initialized for NFSv2.  Unfortunately, I have
:zero clue about how to fix that - Alfred believes the checks for NFSv3
:may not be necessary - myself, I find the NFS code almost totally
:incomprehensible, and have tried to keep my fingers as much out of it
:as possible, but for the changes I'm working on now I have to touch it
::-(
:
:Eivind.

    Yes, I concur.  There are also problems with the ASSERT_VOP_*() macros...
    the filesystem code is not very good at NULLing out dead fields in namei()
    requests (it has caused me no end of trouble), so you can't assume
    that a non-null pointer is valid in the ASSERT's.  You *must* check the
    error return.  

    But that is not what caused the bug.  Alfred has it tagged.


        if (v3) {
                if (!error)
                        nfsm_mtofh(dvp, newvp, v3, gotvp);
                nfsm_wcc_data(dvp, wccflag);
        }

    nfsm_wcc_data() is an NFSv3 only mechanism, I believe.  But the 
    if (!error) nfsm_mtofh(...) can be moved to outside (before) that
    conditional.  I'll patch it in and test it.  Also, the nfsm macros
    are dangerous.

    I've added a little cleanup to this patch.  Viren, please try this 
    patch.

                                        -Matt
                                        Matthew Dillon 
                                        <[EMAIL PROTECTED]>

Index: nfs_vnops.c
===================================================================
RCS file: /FreeBSD/FreeBSD-CVS/src/sys/nfs/nfs_vnops.c,v
retrieving revision 1.146
diff -u -r1.146 nfs_vnops.c
--- nfs_vnops.c 1999/11/27 18:14:41     1.146
+++ nfs_vnops.c 1999/11/29 23:23:05
@@ -1806,11 +1806,10 @@
                txdr_nfsv2time(&vap->va_mtime, &sp->sa_mtime);
        }
        nfsm_request(dvp, NFSPROC_SYMLINK, cnp->cn_proc, cnp->cn_cred);
-       if (v3) {
-               if (!error)
-                       nfsm_mtofh(dvp, newvp, v3, gotvp);
+       if (!error)
+               nfsm_mtofh(dvp, newvp, v3, gotvp);
+       if (v3)
                nfsm_wcc_data(dvp, wccflag);
-       }
        nfsm_reqdone;
        /*
         * Kludge: Map EEXIST => 0 assuming that it is a reply to a retry.
@@ -1821,8 +1820,9 @@
        if (error) {
                if (newvp)
                        vput(newvp);
-       } else
+       } else {
                *ap->a_vpp = newvp;
+       }
        VTONFS(dvp)->n_flag |= NMODIFIED;
        if (!wccflag)
                VTONFS(dvp)->n_attrstamp = 0;


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to