- Upgrade a shared lock request to exclusive in ffs_vget() if we have

to create the vnode.

Sponsored by:	Isilon Systems, Inc.
This commit is contained in:
Jeff Roberson 2005-03-29 10:10:51 +00:00
parent a69c43548d
commit d6919865fa

View File

@ -1176,6 +1176,15 @@ ffs_vget(mp, ino, flags, vpp)
if (error || *vpp != NULL)
return (error);
/*
* We must promote to an exclusive lock for vnode creation. This
* can happen if lookup is passed LOCKSHARED.
*/
if ((flags & LK_TYPE_MASK) == LK_SHARED) {
flags &= ~LK_TYPE_MASK;
flags |= LK_EXCLUSIVE;
}
/*
* We do not lock vnode creation as it is believed to be too
* expensive for such rare case as simultaneous creation of vnode