From patchwork Wed Mar 25 23:10:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank van der Linden X-Patchwork-Id: 11458895 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A36F6161F for ; Wed, 25 Mar 2020 23:10:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 831772073E for ; Wed, 25 Mar 2020 23:10:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=amazon.com header.i=@amazon.com header.b="ZrCK63ef" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727452AbgCYXK4 (ORCPT ); Wed, 25 Mar 2020 19:10:56 -0400 Received: from smtp-fw-9101.amazon.com ([207.171.184.25]:57079 "EHLO smtp-fw-9101.amazon.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbgCYXK4 (ORCPT ); Wed, 25 Mar 2020 19:10:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1585177856; x=1616713856; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=vFxYbbJ0r1Vr860xlMErPtE+KLkDFnIDnLKOGik33OI=; b=ZrCK63efmQaj0UZ4em4O05Z54iq16UG0rjnZOSjPVYjzp+BSv+EGzZ+f 7aeIZ22WejFaOYtE86Q7T4cPc2Z4E2d5AIVm4hWoFYpSSeDjVb32y2MuK PDdqJH/iCvDuhWsNUg9KaCTFGBYuL2QSpU0c+pAVWXh04nt5JaZuTweo7 I=; IronPort-SDR: P1MRoKeFhvlJPM3nQJMwAw78SfinSP1SBoFFJZYaevWptu0XaWHdG1hwp5tr4yZV1ARNZLhS9o 10VRXn91/g2A== X-IronPort-AV: E=Sophos;i="5.72,306,1580774400"; d="scan'208";a="25116063" Received: from sea32-co-svc-lb4-vlan3.sea.corp.amazon.com (HELO email-inbound-relay-1a-af6a10df.us-east-1.amazon.com) ([10.47.23.38]) by smtp-border-fw-out-9101.sea19.amazon.com with ESMTP; 25 Mar 2020 23:10:53 +0000 Received: from EX13MTAUWA001.ant.amazon.com (iad55-ws-svc-p15-lb9-vlan3.iad.amazon.com [10.40.159.166]) by email-inbound-relay-1a-af6a10df.us-east-1.amazon.com (Postfix) with ESMTPS id 6BEB0A2D34; Wed, 25 Mar 2020 23:10:52 +0000 (UTC) Received: from EX13D13UWA001.ant.amazon.com (10.43.160.136) by EX13MTAUWA001.ant.amazon.com (10.43.160.58) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 25 Mar 2020 23:10:51 +0000 Received: from EX13MTAUWA001.ant.amazon.com (10.43.160.58) by EX13D13UWA001.ant.amazon.com (10.43.160.136) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 25 Mar 2020 23:10:51 +0000 Received: from dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (172.23.141.97) by mail-relay.amazon.com (10.43.160.118) with Microsoft SMTP Server id 15.0.1367.3 via Frontend Transport; Wed, 25 Mar 2020 23:10:51 +0000 Received: by dev-dsk-fllinden-2c-c1893d73.us-west-2.amazon.com (Postfix, from userid 6262777) id 5F839D92C5; Wed, 25 Mar 2020 23:10:51 +0000 (UTC) From: Frank van der Linden To: , , CC: Frank van der Linden Subject: [PATCH v2 07/13] NFSv4.2: query the extended attribute access bits Date: Wed, 25 Mar 2020 23:10:45 +0000 Message-ID: <20200325231051.31652-8-fllinden@amazon.com> X-Mailer: git-send-email 2.16.6 In-Reply-To: <20200325231051.31652-1-fllinden@amazon.com> References: <20200325231051.31652-1-fllinden@amazon.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org RFC 8276 defines separate ACCESS bits for extended attribute checking. Query them in nfs_do_access and opendata. Signed-off-by: Frank van der Linden --- fs/nfs/dir.c | 4 ++++ fs/nfs/nfs4proc.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index a0b564781e3e..bd2606539299 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -2646,6 +2646,10 @@ static int nfs_do_access(struct inode *inode, const struct cred *cred, int mask) * Determine which access bits we want to ask for... */ cache.mask = NFS_ACCESS_READ | NFS_ACCESS_MODIFY | NFS_ACCESS_EXTEND; + if (nfs_server_capable(inode, NFS_CAP_XATTR)) { + cache.mask |= NFS_ACCESS_XAREAD | NFS_ACCESS_XAWRITE | + NFS_ACCESS_XALIST; + } if (S_ISDIR(inode->i_mode)) cache.mask |= NFS_ACCESS_DELETE | NFS_ACCESS_LOOKUP; else diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 11eac1b46749..9207f945d75c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1341,6 +1341,12 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry, NFS4_ACCESS_MODIFY | NFS4_ACCESS_EXTEND | NFS4_ACCESS_EXECUTE; +#ifdef CONFIG_NFS_V4_2 + if (server->caps & NFS_CAP_XATTR) + p->o_arg.access |= NFS4_ACCESS_XAREAD | + NFS4_ACCESS_XAWRITE | + NFS4_ACCESS_XALIST; +#endif } } p->o_arg.clientid = server->nfs_client->cl_clientid;