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.
This commit is contained in:
Alexander Kabaev 2004-01-04 04:08:34 +00:00
parent 3ff1b7c23f
commit 291027ce9c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124119

View File

@ -424,12 +424,12 @@ ffs_snapshot(mp, snapfile)
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);