Skip to content

Commit

Permalink
In vfs_busy(), lockmgr() cannot legitimately sleep, because code checked
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
kostikbel committed Nov 3, 2008
1 parent fc25ba9 commit 0cc3eaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/kern/vfs_subr.c
Expand Up @@ -361,7 +361,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), td))
panic("vfs_busy: unexpected lock failure");
return (0);
Expand Down

0 comments on commit 0cc3eaf

Please sign in to comment.