summaryrefslogtreecommitdiffstats
path: root/sys/ufs
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2003-11-02 04:52:53 +0000
committerkan <kan@FreeBSD.org>2003-11-02 04:52:53 +0000
commit618baf4714471cc3fb5fab3d4269d35a9a8ade41 (patch)
tree1ebb69eabd6780710c1f611211ad591a9dcf2865 /sys/ufs
parente8941020faeaacc1170c5ab92faa75b1cc622131 (diff)
downloadFreeBSD-src-618baf4714471cc3fb5fab3d4269d35a9a8ade41.zip
FreeBSD-src-618baf4714471cc3fb5fab3d4269d35a9a8ade41.tar.gz
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.
Diffstat (limited to 'sys/ufs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c6
-rw-r--r--sys/ufs/ufs/ufs_quota.c9
2 files changed, 10 insertions, 5 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 40839aa..4e6d0ea 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -537,7 +537,8 @@ loop:
ffs_load_inode(bp, ip, fs, ip->i_number);
ip->i_effnlink = ip->i_nlink;
brelse(bp);
- vput(vp);
+ VOP_UNLOCK(vp, 0, td);
+ vrele(vp);
mtx_lock(&mntvnode_mtx);
}
mtx_unlock(&mntvnode_mtx);
@@ -1166,7 +1167,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);
if (TAILQ_NEXT(vp, v_nmntvnodes) != nvp)
goto loop;
diff --git a/sys/ufs/ufs/ufs_quota.c b/sys/ufs/ufs/ufs_quota.c
index d34f148..11f4fb2 100644
--- a/sys/ufs/ufs/ufs_quota.c
+++ b/sys/ufs/ufs/ufs_quota.c
@@ -468,12 +468,14 @@ again:
goto again;
}
if (vp->v_type == VNON || vp->v_writecount == 0) {
- vput(vp);
+ VOP_UNLOCK(vp, 0, td);
+ vrele(vp);
mtx_lock(&mntvnode_mtx);
continue;
}
error = getinoquota(VTOI(vp));
- vput(vp);
+ VOP_UNLOCK(vp, 0, td);
+ vrele(vp);
mtx_lock(&mntvnode_mtx);
if (error)
break;
@@ -536,7 +538,8 @@ again:
dq = ip->i_dquot[type];
ip->i_dquot[type] = NODQUOT;
dqrele(vp, dq);
- vput(vp);
+ VOP_UNLOCK(vp, 0, td);
+ vrele(vp);
mtx_lock(&mntvnode_mtx);
if (TAILQ_NEXT(vp, v_nmntvnodes) != nextvp)
goto again;
OpenPOWER on IntegriCloud