diff options
author | jeff <jeff@FreeBSD.org> | 2005-02-22 23:56:42 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-02-22 23:56:42 +0000 |
commit | 81846eae9c1ead2fd3b85f87fd20d383fc28f037 (patch) | |
tree | b2cead11e5e1afce30ed63b9f0d94639948c1a5d /sys/ufs/ffs | |
parent | 3305bcf4bbdffa9dfcdcef4bb7762485d95701a1 (diff) | |
download | FreeBSD-src-81846eae9c1ead2fd3b85f87fd20d383fc28f037.zip FreeBSD-src-81846eae9c1ead2fd3b85f87fd20d383fc28f037.tar.gz |
- Add VOP locking asserts in several functions that have been implicated in
recent deadlocks.
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r-- | sys/ufs/ffs/ffs_inode.c | 3 | ||||
-rw-r--r-- | sys/ufs/ffs/ffs_softdep.c | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/sys/ufs/ffs/ffs_inode.c b/sys/ufs/ffs/ffs_inode.c index 50c20ca..a338bda 100644 --- a/sys/ufs/ffs/ffs_inode.c +++ b/sys/ufs/ffs/ffs_inode.c @@ -161,6 +161,8 @@ ffs_truncate(vp, length, flags, cred, td) fs = oip->i_fs; ump = oip->i_ump; + ASSERT_VOP_LOCKED(vp, "ffs_truncate"); + if (length < 0) return (EINVAL); /* @@ -277,6 +279,7 @@ ffs_truncate(vp, length, flags, cred, td) #endif softdep_setup_freeblocks(oip, length, needextclean ? IO_EXT | IO_NORMAL : IO_NORMAL); + ASSERT_VOP_LOCKED(vp, "ffs_truncate1"); vinvalbuf(ovp, needextclean ? 0 : V_NORMAL, td, 0, 0); vnode_pager_setsize(vp, 0); oip->i_flag |= IN_CHANGE | IN_UPDATE; diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 1462ce0..2ebfa95 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -1842,6 +1842,7 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp) struct allocindir *aip; struct pagedep *pagedep; + ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_page"); aip = newallocindir(ip, ptrno, newblkno, oldblkno); ACQUIRE_LOCK(&lk); /* @@ -1871,6 +1872,7 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno) { struct allocindir *aip; + ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_meta"); aip = newallocindir(ip, ptrno, newblkno, 0); ACQUIRE_LOCK(&lk); WORKLIST_INSERT(&nbp->b_dep, &aip->ai_list); |