From owner-freebsd-current Mon Nov 29 15:25:49 1999 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 973C015631; Mon, 29 Nov 1999 15:25:22 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id PAA12356; Mon, 29 Nov 1999 15:25:21 -0800 (PST) (envelope-from dillon) Date: Mon, 29 Nov 1999 15:25:21 -0800 (PST) From: Matthew Dillon Message-Id: <199911292325.PAA12356@apollo.backplane.com> To: Eivind Eklund Cc: Julian Elischer , "Viren R.Shah" , Greg Lehey , freebsd-current@FreeBSD.org Subject: Re: repeatable crash in -current (softupdates, NFS) References: <14399.63511.296802.242618@jabberwock.rstcorp.com> <19991127191729.A53832@bitbox.follo.net> <14402.62122.461010.454021@jabberwock.rstcorp.com> <199911292152.NAA09656@apollo.backplane.com> <19991129235631.P60031@bitbox.follo.net> <199911292308.PAA12218@apollo.backplane.com> <19991130001724.S60031@bitbox.follo.net> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :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 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 majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message