Date: Mon, 29 Nov 1999 15:25:21 -0800 (PST) From: Matthew Dillon <dillon@apollo.backplane.com> To: Eivind Eklund <eivind@FreeBSD.org> Cc: Julian Elischer <julian@whistle.com>, "Viren R.Shah" <viren@rstcorp.com>, Greg Lehey <grog@lemis.com>, freebsd-current@FreeBSD.org Subject: Re: repeatable crash in -current (softupdates, NFS) Message-ID: <199911292325.PAA12356@apollo.backplane.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
: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
<dillon@backplane.com>
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911292325.PAA12356>
