From owner-freebsd-fs@FreeBSD.ORG Thu Mar 28 01:45:26 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 E8835573; Thu, 28 Mar 2013 01:45:26 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-qe0-f45.google.com (mail-qe0-f45.google.com [209.85.128.45]) by mx1.freebsd.org (Postfix) with ESMTP id 9CE7EEF8; Thu, 28 Mar 2013 01:45:26 +0000 (UTC) Received: by mail-qe0-f45.google.com with SMTP id b4so4903106qen.4 for ; Wed, 27 Mar 2013 18:45:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=FS3mgNsZgh0E87awtM6qhaNO4G4sQSrgSsEaYl5XQpM=; b=x3oOiB0/sk3p0HvK/f9peduRw0JRH6nvxRIxknknFIFdolUfHm2/ZlHEEUWpdX2ufM o1tNmif3thx14P6hFFY/pT4aVkvMG9y1wZ1FBfxvd61g0ELD/4D3bY9JLaS+uyTO7Ibc Tct5RR+5ly9oudNzD1E29LL1c6Tte9/10zeTt14vMmE0vxKj8W9IhMyQfE7l07IuNTR6 8jrUbevS5Gbv1dPjDknB2ya6USsX6YZZz7DlWsakqTrx/3imis+ClRmPgGhwc4HZZ7yX nEbk7PKnxovWoj6ImuwwG4tSL76jkRpwbW8y+uX7atXp3QmX8ZD/LXUfWXn1zJq+PuiM I1Iw== MIME-Version: 1.0 X-Received: by 10.224.33.14 with SMTP id f14mr15790772qad.69.1364434672068; Wed, 27 Mar 2013 18:37:52 -0700 (PDT) Sender: mdf356@gmail.com Received: by 10.229.253.201 with HTTP; Wed, 27 Mar 2013 18:37:51 -0700 (PDT) In-Reply-To: References: Date: Wed, 27 Mar 2013 18:37:51 -0700 X-Google-Sender-Auth: 1Ya9g8m8aXcXnucHqY84C-jbqYY Message-ID: Subject: [RFC] use a shared lock for VOP_GETEXTATTR From: mdf@FreeBSD.org To: freebsd-current@freebsd.org, freebsd-fs@freebsd.org Content-Type: multipart/mixed; boundary=20cf3074b9a4f2ad3c04d8f23328 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 01:45:27 -0000 --20cf3074b9a4f2ad3c04d8f23328 Content-Type: text/plain; charset=ISO-8859-1 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? [sorry if this is a duplicate; I first sent from my non-FreeBSD mail] Thanks, matthew --20cf3074b9a4f2ad3c04d8f23328 Content-Type: application/octet-stream; name="0001-Use-a-shared-lock-for-VOP_GETEXTATTR-as-it-is-a-read.patch" Content-Disposition: attachment; filename="0001-Use-a-shared-lock-for-VOP_GETEXTATTR-as-it-is-a-read.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: f_het94ldq0 RnJvbSBhYTZkNmM3MTZiZDE5Y2UzMmUzYjkwODcyN2ZiZGE2NWQzNDViN2FiIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBNYXR0aGV3IEZsZW1pbmcgPG1kZkBGcmVlQlNELm9yZz4KRGF0 ZTogV2VkLCAyNyBNYXIgMjAxMyAxODoyMzoxNyAtMDcwMApTdWJqZWN0OiBbUEFUQ0hdIFVzZSBh IHNoYXJlZCBsb2NrIGZvciBWT1BfR0VURVhUQVRUUiwgYXMgaXQgaXMgYSByZWFkLWxpa2Ugb3Bl cmF0aW9uLgoKTUZDIGFmdGVyOgkxIHdlZWsKLS0tCiBzeXMva2Vybi92ZnNfZXh0YXR0ci5jIHwg ICAgMiAr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