Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Mar 2012 08:02:44 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r232644 - stable/9/sys/fs/nullfs
Message-ID:  <201203070802.q2782iQ6081993@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar  7 08:02:43 2012
New Revision: 232644
URL: http://svn.freebsd.org/changeset/base/232644

Log:
  MFC r232301:
  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.

Modified:
  stable/9/sys/fs/nullfs/null_vfsops.c
Directory Properties:
  stable/9/sys/   (props changed)

Modified: stable/9/sys/fs/nullfs/null_vfsops.c
==============================================================================
--- stable/9/sys/fs/nullfs/null_vfsops.c	Wed Mar  7 07:59:30 2012	(r232643)
+++ stable/9/sys/fs/nullfs/null_vfsops.c	Wed Mar  7 08:02:43 2012	(r232644)
@@ -307,6 +307,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?201203070802.q2782iQ6081993>