Date: Mon, 3 Nov 2008 14:11:06 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r184591 - in stable/7/sys: . kern Message-ID: <200811031411.mA3EB6t4068217@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811031411.mA3EB6t4068217>