From ea417bf09acdf5d9f44a16d4325b3b99dda501e3 Mon Sep 17 00:00:00 2001 From: jhb Date: Fri, 16 Jul 2010 19:20:20 +0000 Subject: When the MNTK_EXTENDED_SHARED mount option was added, some filesystems were changed to defer the setting of VN_LOCK_ASHARE() (which clears LK_NOSHARE in the vnode lock's flags) until after they had determined if the vnode was a FIFO. This occurs after the vnode has been inserted a VFS hash or some similar table, so it is possible for another thread to find this vnode via vget() on an i-node number and block on the vnode lock. If the lockmgr interlock (vnode interlock for vnode locks) is not held when clearing the LK_NOSHARE flag, then the lk_flags field can be clobbered. As a result the thread blocked on the vnode lock may never get woken up. Fix this by holding the vnode interlock while modifying the lock flags in this case. MFC after: 3 days --- sys/fs/cd9660/cd9660_vfsops.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/fs/cd9660') diff --git a/sys/fs/cd9660/cd9660_vfsops.c b/sys/fs/cd9660/cd9660_vfsops.c index e27daf8..b8bc6c6 100644 --- a/sys/fs/cd9660/cd9660_vfsops.c +++ b/sys/fs/cd9660/cd9660_vfsops.c @@ -814,7 +814,9 @@ cd9660_vget_internal(mp, ino, flags, vpp, relocated, isodir) vp->v_op = &cd9660_fifoops; break; default: + VI_LOCK(vp); VN_LOCK_ASHARE(vp); + VI_UNLOCK(vp); break; } -- cgit v1.1