Index: vfs_subr.c =================================================================== RCS file: /data/ncvs/src/sys/kern/vfs_subr.c,v retrieving revision 1.446 diff -u -r1.446 vfs_subr.c --- vfs_subr.c 3 May 2003 08:09:23 -0000 1.446 +++ vfs_subr.c 12 May 2003 03:50:36 -0000 @@ -2881,28 +2881,24 @@ */ DB_SHOW_COMMAND(lockedvnods, lockedvnodes) { - struct thread *td = curthread; /* XXX */ struct mount *mp, *nmp; struct vnode *vp; + /* + * Note: because this is DDB, we can't obey the locking semantics + * for these structures, which means we could catch an inconsistent + * state and dereference a nasty pointer. Not much to be done + * about that. + */ printf("Locked vnodes\n"); - mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { - if (vfs_busy(mp, LK_NOWAIT, &mountlist_mtx, td)) { - nmp = TAILQ_NEXT(mp, mnt_list); - continue; - } - mtx_lock(&mntvnode_mtx); + nmp = TAILQ_NEXT(mp, mnt_list); TAILQ_FOREACH(vp, &mp->mnt_nvnodelist, v_nmntvnodes) { if (VOP_ISLOCKED(vp, NULL)) vprint(NULL, vp); } - mtx_unlock(&mntvnode_mtx); - mtx_lock(&mountlist_mtx); nmp = TAILQ_NEXT(mp, mnt_list); - vfs_unbusy(mp, td); } - mtx_unlock(&mountlist_mtx); } #endif