From 618baf4714471cc3fb5fab3d4269d35a9a8ade41 Mon Sep 17 00:00:00 2001 From: kan Date: Sun, 2 Nov 2003 04:52:53 +0000 Subject: Take care not to call vput if thread used in corresponding vget wasn't curthread, i.e. when we receive a thread pointer to use as a function argument. Use VOP_UNLOCK/vrele in these cases. The only case there td != curthread known at the moment is boot() calling sync with thread0 pointer. This fixes the panic on shutdown people have reported. --- sys/nfsclient/nfs_vfsops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/nfsclient') diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c index 880d2b1..3df0fa3 100644 --- a/sys/nfsclient/nfs_vfsops.c +++ b/sys/nfsclient/nfs_vfsops.c @@ -958,7 +958,8 @@ loop: error = VOP_FSYNC(vp, cred, waitfor, td); if (error) allerror = error; - vput(vp); + VOP_UNLOCK(vp, 0, td); + vrele(vp); mtx_lock(&mntvnode_mtx); } mtx_unlock(&mntvnode_mtx); -- cgit v1.1