Lock the vnode while truncating the corefile. This fixes a panic

with softupdates dangling deps.

Submitted by:	peter
MFC:		ASAP :)
This commit is contained in:
Paul Saab 2001-09-26 01:24:07 +00:00
parent 9efaa0ae62
commit 88b1d98f31

View File

@ -2012,8 +2012,10 @@ coredump(struct thread *td)
}
VATTR_NULL(&vattr);
vattr.va_size = 0;
vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td);
VOP_LEASE(vp, td, cred, LEASE_WRITE);
VOP_SETATTR(vp, &vattr, cred, td);
VOP_UNLOCK(vp, 0, td);
PROC_LOCK(p);
p->p_acflag |= ACORE;
PROC_UNLOCK(p);