svn commit: r184591 - in stable/7/sys: . kern
Konstantin Belousov
kib at FreeBSD.org
Mon Nov 3 06:11:06 PST 2008
Author: kib
Date: Mon Nov 3 14:11:06 2008
New Revision: 184591
URL: http://svn.freebsd.org/changeset/base/184591
Log:
In vfs_busy(), lockmgr() cannot legitimately sleep, because code checked
MNTK_UNMOUNT before, and mnt_mtx is used as interlock. vfs_busy() always
tries to obtain a shared lock on mnt_lock, the other user is unmount who
tries to drain it, setting MNTK_UNMOUNT before.
Approved by: re (kensmith)
Modified:
stable/7/sys/ (props changed)
stable/7/sys/kern/vfs_subr.c
Modified: stable/7/sys/kern/vfs_subr.c
==============================================================================
--- stable/7/sys/kern/vfs_subr.c Mon Nov 3 14:08:08 2008 (r184590)
+++ stable/7/sys/kern/vfs_subr.c Mon Nov 3 14:11:06 2008 (r184591)
@@ -361,7 +361,7 @@ vfs_busy(struct mount *mp, int flags, st
}
if (interlkp)
mtx_unlock(interlkp);
- lkflags = LK_SHARED | LK_INTERLOCK;
+ lkflags = LK_SHARED | LK_INTERLOCK | LK_NOWAIT;
if (lockmgr(&mp->mnt_lock, lkflags, MNT_MTX(mp), td))
panic("vfs_busy: unexpected lock failure");
return (0);
More information about the svn-src-stable-7
mailing list