From 291027ce9c028ac1d95d7dd0164a5511808f6ede Mon Sep 17 00:00:00 2001 From: Alexander Kabaev Date: Sun, 4 Jan 2004 04:08:34 +0000 Subject: [PATCH] Avoid calling vprint on a vnode while holding its interlock mutex. Move diagnostic printf after vget. This might delay the debug output some, but at least it keeps kernel from exploding if DEBUG_VFS_LOCKS is in effect. --- sys/ufs/ffs/ffs_snapshot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 0e2191feb14..8a4d3b4aaa3 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -424,12 +424,12 @@ loop: MNT_ILOCK(mp); continue; } - if (snapdebug) - vprint("ffs_snapshot: busy vnode", xvp); if (vn_lock(xvp, LK_EXCLUSIVE | LK_INTERLOCK, td) != 0) { MNT_ILOCK(mp); goto loop; } + if (snapdebug) + vprint("ffs_snapshot: busy vnode", xvp); if (VOP_GETATTR(xvp, &vat, td->td_ucred, td) == 0 && vat.va_nlink > 0) { VOP_UNLOCK(xvp, 0, td);