diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2012-02-29 15:09:20 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2012-02-29 15:09:20 +0000 |
commit | e4e1d9f38286b9be1539e733e49beb28c9457e5a (patch) | |
tree | 879331039425e047bf571a439547217e522bd3ac /sys/fs/nullfs/null_vfsops.c | |
parent | 409763cebaf1e79881fb2527df4f9d934fabd71e (diff) | |
download | src-e4e1d9f38286b9be1539e733e49beb28c9457e5a.tar.gz src-e4e1d9f38286b9be1539e733e49beb28c9457e5a.zip |
Always request exclusive lock for the lower vnode in nullfs_vget().
The null_nodeget() requires exclusive lock on lowervp to be able to
insmntque() new vnode.
Reported by: rea
Tested by: pho
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=232301
Diffstat (limited to 'sys/fs/nullfs/null_vfsops.c')
-rw-r--r-- | sys/fs/nullfs/null_vfsops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/fs/nullfs/null_vfsops.c b/sys/fs/nullfs/null_vfsops.c index b422077f0cf0..414d2e303da9 100644 --- a/sys/fs/nullfs/null_vfsops.c +++ b/sys/fs/nullfs/null_vfsops.c @@ -312,6 +312,12 @@ nullfs_vget(mp, ino, flags, vpp) struct vnode **vpp; { int error; + + KASSERT((flags & LK_TYPE_MASK) != 0, + ("nullfs_vget: no lock requested")); + flags &= ~LK_TYPE_MASK; + flags |= LK_EXCLUSIVE; + error = VFS_VGET(MOUNTTONULLMOUNT(mp)->nullm_vfs, ino, flags, vpp); if (error) return (error); |