Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Mar 2013 15:09:05 +0000 (UTC)
From:      Matthew D Fleming <mdf@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r248933 - head/sys/kern
Message-ID:  <201303301509.r2UF95SK063638@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mdf
Date: Sat Mar 30 15:09:04 2013
New Revision: 248933
URL: http://svnweb.freebsd.org/changeset/base/248933

Log:
  Use a shared lock for VOP_GETEXTATTR, as it is a read-like operation.
  
  MFC after:	1 week

Modified:
  head/sys/kern/vfs_extattr.c
  head/sys/kern/vfs_vnops.c

Modified: head/sys/kern/vfs_extattr.c
==============================================================================
--- head/sys/kern/vfs_extattr.c	Sat Mar 30 13:30:27 2013	(r248932)
+++ head/sys/kern/vfs_extattr.c	Sat Mar 30 15:09:04 2013	(r248933)
@@ -326,7 +326,7 @@ extattr_get_vp(struct vnode *vp, int att
 	size_t size, *sizep;
 	int error;
 
-	vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+	vn_lock(vp, LK_SHARED | LK_RETRY);
 
 	/*
 	 * Slightly unusual semantics: if the user provides a NULL data

Modified: head/sys/kern/vfs_vnops.c
==============================================================================
--- head/sys/kern/vfs_vnops.c	Sat Mar 30 13:30:27 2013	(r248932)
+++ head/sys/kern/vfs_vnops.c	Sat Mar 30 15:09:04 2013	(r248933)
@@ -1758,7 +1758,7 @@ vn_extattr_get(struct vnode *vp, int iof
 	auio.uio_resid = *buflen;
 
 	if ((ioflg & IO_NODELOCKED) == 0)
-		vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
+		vn_lock(vp, LK_SHARED | LK_RETRY);
 
 	ASSERT_VOP_LOCKED(vp, "IO_NODELOCKED with no vp lock held");
 



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