summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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