Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Feb 2012 15:09:20 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232301 - head/sys/fs/nullfs
Message-ID:  <201202291509.q1TF9Kt0032171@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Feb 29 15:09:20 2012
New Revision: 232301
URL: http://svn.freebsd.org/changeset/base/232301

Log:
  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

Modified:
  head/sys/fs/nullfs/null_vfsops.c

Modified: head/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- head/sys/fs/nullfs/null_vfsops.c	Wed Feb 29 15:06:40 2012	(r232300)
+++ head/sys/fs/nullfs/null_vfsops.c	Wed Feb 29 15:09:20 2012	(r232301)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201202291509.q1TF9Kt0032171>