diff options
author | Alexander Kabaev <kan@FreeBSD.org> | 2003-11-02 04:52:53 +0000 |
---|---|---|
committer | Alexander Kabaev <kan@FreeBSD.org> | 2003-11-02 04:52:53 +0000 |
commit | cb9ddc80aee7da7181eedc5be2ae7b898123f38b (patch) | |
tree | 1ebb69eabd6780710c1f611211ad591a9dcf2865 /sys/ufs/ffs/ffs_vfsops.c | |
parent | 769a3635379b0b4fb3da1658b804b8b4a14d2e96 (diff) | |
download | src-cb9ddc80aee7da7181eedc5be2ae7b898123f38b.tar.gz src-cb9ddc80aee7da7181eedc5be2ae7b898123f38b.zip |
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.
Notes
Notes:
svn path=/head/; revision=121874
Diffstat (limited to 'sys/ufs/ffs/ffs_vfsops.c')
-rw-r--r-- | sys/ufs/ffs/ffs_vfsops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c index 40839aace66d..4e6d0ea00331 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; |