summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-04-11 09:23:56 +0000
committerjeff <jeff@FreeBSD.org>2005-04-11 09:23:56 +0000
commit1b29b37e26af38bd1aeef1d808338060588d0066 (patch)
tree7a9e7d468df316caa4378c2c47fe4f7f103fb940 /sys/kern
parentfbc2ade92cdf004d6552d9ffa87e3eda5696e1ba (diff)
downloadFreeBSD-src-1b29b37e26af38bd1aeef1d808338060588d0066.zip
FreeBSD-src-1b29b37e26af38bd1aeef1d808338060588d0066.tar.gz
- Assert that we're no longer doing recursive vn_locks in inactive/reclaim
as I'd like to get rid of the vxthread. - Handle lock requests which don't actually want a lock as this is a much more convenient place to handle this condition than in vget(). These requests simply want to know that VI_DOOMED isn't set. - Correct a test at the end of vn_lock, if error !=0 should be if error == 0, this has been broken since I comitted the VI_DOOMED changes, but no one ran into it because vget() duplicated this functionality. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/vfs_vnops.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index 8f90614..b51880c 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -796,14 +796,23 @@ debug_vn_lock(vp, flags, td, filename, line)
{
int error;
+ KASSERT(vp->v_vxthread != curthread,
+ ("recursive vn_lock in inactive/reclaim."));
do {
if ((flags & LK_INTERLOCK) == 0)
VI_LOCK(vp);
- if ((vp->v_iflag & VI_DOOMED) && vp->v_vxthread != td &&
- (flags & LK_NOWAIT)) {
+ if ((flags & LK_NOWAIT || (flags & LK_TYPE_MASK) == 0) &&
+ vp->v_iflag & VI_DOOMED && vp->v_vxthread != td) {
VI_UNLOCK(vp);
return (ENOENT);
}
+ /*
+ * Just polling to check validity.
+ */
+ if ((flags & LK_TYPE_MASK) == 0) {
+ VI_UNLOCK(vp);
+ return (0);
+ }
#ifdef DEBUG_LOCKS
vp->filename = filename;
vp->line = line;
@@ -818,7 +827,7 @@ debug_vn_lock(vp, flags, td, filename, line)
* Callers specify LK_RETRY if they wish to get dead vnodes.
* If RETRY is not set, we return ENOENT instead.
*/
- if (error != 0 && (vp->v_iflag & VI_DOOMED) &&
+ if (error == 0 && vp->v_iflag & VI_DOOMED &&
vp->v_vxthread != td && (flags & LK_RETRY) == 0) {
VOP_UNLOCK(vp, 0, td);
error = ENOENT;
OpenPOWER on IntegriCloud