From owner-freebsd-current Mon Dec 7 19:28:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id TAA00497 for freebsd-current-outgoing; Mon, 7 Dec 1998 19:28:39 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from sicily.odyssey.cs.cmu.edu (SICILY.ODYSSEY.CS.CMU.EDU [128.2.185.138]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id TAA00491 for ; Mon, 7 Dec 1998 19:28:37 -0800 (PST) (envelope-from rvb+@sicily.odyssey.cs.cmu.edu) Cc: freebsd-current@FreeBSD.ORG Subject: Sloppy uio.uio_procp initialization ... References: <4.1.19981123122653.00abfe40@206.25.93.69> <19981125142249.B38959@matti.ee> From: "Robert V. Baron" Date: 07 Dec 1998 22:28:14 -0500 In-Reply-To: "Robert V. Baron"'s message of 02 Dec 1998 10:23:01 -0500 Message-ID: Lines: 30 X-Mailer: Gnus v5.4.46/Emacs 19.34 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Recently I fixed vnode_pager_input_old, because it was doing a VOP_READ into a Coda fs, but it had set the uio.uio_procp to 0 vs curproc. (Coda freaks because it vgets a vnode [and hence locks it with curproc], then tries to unlock it with a 0 process pointer.) I just noticed (the hard way) the same design happens in ktrwrite(): ktrwrite(vp, kth) struct vnode *vp; register struct ktr_header *kth; { struct uio auio; struct iovec aiov[2]; register struct proc *p = curproc; /* XXX */ int error; ... auio.uio_procp = (struct proc *)0; ... vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); error = VOP_WRITE(vp, &auio, IO_UNIT|IO_APPEND, p->p_ucred); VOP_UNLOCK(vp, 0, p); So here the vn_locks are using the actual process pointer, but since uio_procp is 0, coda will try an unlock not with curproc and fail. I'll change ktrwrite to use auio.uio_procp = curproc, Wed Noon EST, unless anyone objects. PS For the curious, Coda is locking and unlocking a vnode associated with the Coda vnode (which caches the file data) -- not the Coda vnode. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message