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/gnu/ext2fs/ext2_vfsops.c | 3 ++- sys/gnu/fs/ext2fs/ext2_vfsops.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/gnu') diff --git a/sys/gnu/ext2fs/ext2_vfsops.c b/sys/gnu/ext2fs/ext2_vfsops.c index a9c4160..c9544c1 100644 --- a/sys/gnu/ext2fs/ext2_vfsops.c +++ b/sys/gnu/ext2fs/ext2_vfsops.c @@ -933,7 +933,8 @@ loop: } if ((error = VOP_FSYNC(vp, cred, waitfor, td)) != 0) allerror = error; - vput(vp); + VOP_UNLOCK(vp, 0, td); + vrele(vp); mtx_lock(&mntvnode_mtx); } mtx_unlock(&mntvnode_mtx); diff --git a/sys/gnu/fs/ext2fs/ext2_vfsops.c b/sys/gnu/fs/ext2fs/ext2_vfsops.c index a9c4160..c9544c1 100644 --- a/sys/gnu/fs/ext2fs/ext2_vfsops.c +++ b/sys/gnu/fs/ext2fs/ext2_vfsops.c @@ -933,7 +933,8 @@ loop: } if ((error = VOP_FSYNC(vp, cred, waitfor, td)) != 0) allerror = error; - vput(vp); + VOP_UNLOCK(vp, 0, td); + vrele(vp); mtx_lock(&mntvnode_mtx); } mtx_unlock(&mntvnode_mtx); -- cgit v1.1