diff options
author | kib <kib@FreeBSD.org> | 2008-10-20 10:07:28 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-10-20 10:07:28 +0000 |
commit | 015479d466a4e5609bed16fe5bc0d7c02cd1a239 (patch) | |
tree | 2e8e4a6298da6d6b4717bf7466a4b356f9ff64fa /sys/kern/vfs_subr.c | |
parent | 604182d32eeb85fd6e8cc77ef635232c80913a42 (diff) | |
download | FreeBSD-src-015479d466a4e5609bed16fe5bc0d7c02cd1a239.zip FreeBSD-src-015479d466a4e5609bed16fe5bc0d7c02cd1a239.tar.gz |
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.
Reviewed by: tegge, attilio
Tested by: pho
MFC after: 2 weeks
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 18ad471..c8b4d97 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -368,7 +368,7 @@ vfs_busy(struct mount *mp, int flags, struct mtx *interlkp) } 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))) panic("vfs_busy: unexpected lock failure"); return (0); |