From owner-freebsd-fs@FreeBSD.ORG Thu Mar 28 05:56:27 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D3E8ECD9; Thu, 28 Mar 2013 05:56:27 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7461D9EC; Thu, 28 Mar 2013 05:56:27 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r2S5uN0K052050; Thu, 28 Mar 2013 07:56:23 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.0 kib.kiev.ua r2S5uN0K052050 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r2S5uNj4052049; Thu, 28 Mar 2013 07:56:23 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 28 Mar 2013 07:56:23 +0200 From: Konstantin Belousov To: mdf@FreeBSD.org Subject: Re: [RFC] use a shared lock for VOP_GETEXTATTR Message-ID: <20130328055623.GG3794@kib.kiev.ua> References: <20130328053205.GF3794@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="XsW72sOHJGfuGe9h" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: freebsd-fs@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 05:56:27 -0000 --XsW72sOHJGfuGe9h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 27, 2013 at 10:40:16PM -0700, mdf@FreeBSD.org wrote: > On Wed, Mar 27, 2013 at 10:32 PM, Konstantin Belousov > wrote: > > On Wed, Mar 27, 2013 at 06:37:51PM -0700, mdf@FreeBSD.org wrote: > >> VOP_GETEXTATTR is currently called with an exclusive lock, which seems > >> like overkill for what is essentially a read operation. I had a look > >> over the various in-tree filesystems and it didn't look like any of > >> them will have a problem if a shared-mode lock is used for > >> vop_getextattr. > >> > >> Does anyone know otherwise? Is someone using extended attributes > >> regularly who can test this? > > > > I think this change should be fine. At least it seems to for UFS. > > > > What other filesystems did you audited ? >=20 > I looked over zfs, pseudofs, unionfs, ffs/ufs. None seemed to have > any asserts on the lock type nor anything that looked like it would > try to modify anything. zfs, I think it was, even used VOP_ISLOCKED > to get the lock type in one path (but I think that was after a > lookup(), so it may have been on a different vnode). VOPs usually do not assert the lock state, unless the explicit unlock/lock is done, or some other call is made which asserts the lock. If zfs is fine =66rom your inspection, I think that the patch can be committed without an issue. --XsW72sOHJGfuGe9h Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJRU9uHAAoJEJDCuSvBvK1B5+oP/1A+CLA6d4Uj4cBEZH71gsPd nI4QzQ8Mr1zOP2yLH9clbtT29NDXb/zwbFRzHFh4R8UD8mnQzr6Aebkt+obzctCz a3JT6WF4D+uCPL+E5cUTaVpaA/8guQO+MlP3ECN21KqqDI5mAfHEshSLcbHeJi2Q MAmWID6Wn0ONIk2027pjP2rayQE0ECpKEoEuahPNeHjTecstY2EKA4nITXb+dVLj mgC7zpHlLeH0PD6/PM47RBIc/AqTi6B2Mj3swYuIEUo2PJYMzNG+pdl9IYg+VNzZ KklxpSNRkBwUGfPGLiIKxR3Bvr404x3/C4rBWGyyIDYs75q5C4pUfUnKImJ8aerg fp4gfwSZ58xMV5yNUIPQRuKh7pQdf6ha5Kc4THEBKk4Cl4KL0SCRk1NS/vnn+IIR nDYog1g6h421Nvx9EIP/SoyYHlyni0J8Q9DDvu6eQEyUGwQdBkWqg8aKXF/7pRFr cjJTPHZ23zCbNQF+h4kIyrkqgcUYr1PQeCw77YN17rhfR7gfgAVoUxdCI6B+Un62 Pl/X9vte63S/LpbAu584ItlOrVFzFMXoYM+lcTmqra2InKtl0CtyzUg7lDrsuii8 j1SnN/EPuWJB8VNIWHp4n9O/Z5iHURbJLz1sT0POp+bocFiTHa8Nas8GGB8wcCYQ pqdGv5PhGVeLuQWQm+nT =2MpL -----END PGP SIGNATURE----- --XsW72sOHJGfuGe9h--