From: Anna Schumaker <Anna.Schumaker@Netapp.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>,
<linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/5] NFSv4: Don't check file access when reclaiming state
Date: Mon, 14 Nov 2016 15:44:59 -0500 [thread overview]
Message-ID: <2db857a6-a5eb-9b62-93fa-4c4ad81f35e7@Netapp.com> (raw)
In-Reply-To: <1478814070-17140-2-git-send-email-trond.myklebust@primarydata.com>
Hi Trond,
On 11/10/2016 04:41 PM, Trond Myklebust wrote:
> If we're reclaiming state after a reboot, or as part of returning a
> delegation, we don't need to check access modes again.
>
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
> fs/nfs/nfs4proc.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index 6a1d650e0419..4eead738da8e 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -1221,6 +1221,7 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
> atomic_inc(&sp->so_count);
> p->o_arg.open_flags = flags;
> p->o_arg.fmode = fmode & (FMODE_READ|FMODE_WRITE);
> + p->o_arg.claim = nfs4_map_atomic_open_claim(server, claim);
> p->o_arg.share_access = nfs4_map_atomic_open_share(server,
> fmode, flags);
> /* don't put an ACCESS op in OPEN compound if O_EXCL, because ACCESS
> @@ -1228,8 +1229,14 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
> if (!(flags & O_EXCL)) {
> /* ask server to check for all possible rights as results
> * are cached */
> - p->o_arg.access = NFS4_ACCESS_READ | NFS4_ACCESS_MODIFY |
> - NFS4_ACCESS_EXTEND | NFS4_ACCESS_EXECUTE;
> + switch (p->o_arg.claim) {
> + case NFS4_OPEN_CLAIM_NULL:
> + case NFS4_OPEN_CLAIM_FH:
> + p->o_arg.access = NFS4_ACCESS_READ |
> + NFS4_ACCESS_MODIFY |
> + NFS4_ACCESS_EXTEND |
> + NFS4_ACCESS_EXECUTE;
> + }
This adds these warnings when I compile:
fs/nfs/nfs4proc.c: In function 'nfs4_opendata_alloc':
fs/nfs/nfs4proc.c:1232:3: error: enumeration value 'NFS4_OPEN_CLAIM_PREVIOUS' not handled in switch [-Werror=switch]
switch (p->o_arg.claim) {
^~~~~~
fs/nfs/nfs4proc.c:1232:3: error: enumeration value 'NFS4_OPEN_CLAIM_DELEGATE_CUR' not handled in switch [-Werror=switch]
fs/nfs/nfs4proc.c:1232:3: error: enumeration value 'NFS4_OPEN_CLAIM_DELEGATE_PREV' not handled in switch [-Werror=switch]
fs/nfs/nfs4proc.c:1232:3: error: enumeration value 'NFS4_OPEN_CLAIM_DELEG_CUR_FH' not handled in switch [-Werror=switch]
fs/nfs/nfs4proc.c:1232:3: error: enumeration value 'NFS4_OPEN_CLAIM_DELEG_PREV_FH' not handled in switch [-Werror=switch]
Thanks,
Anna
> }
> p->o_arg.clientid = server->nfs_client->cl_clientid;
> p->o_arg.id.create_time = ktime_to_ns(sp->so_seqid.create_time);
> @@ -1239,7 +1246,6 @@ static struct nfs4_opendata *nfs4_opendata_alloc(struct dentry *dentry,
> p->o_arg.bitmask = nfs4_bitmask(server, label);
> p->o_arg.open_bitmap = &nfs4_fattr_bitmap[0];
> p->o_arg.label = nfs4_label_copy(p->a_label, label);
> - p->o_arg.claim = nfs4_map_atomic_open_claim(server, claim);
> switch (p->o_arg.claim) {
> case NFS4_OPEN_CLAIM_NULL:
> case NFS4_OPEN_CLAIM_DELEGATE_CUR:
>
next prev parent reply other threads:[~2016-11-14 20:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-10 21:41 [PATCH 0/5] Optimisations for state management Trond Myklebust
2016-11-10 21:41 ` [PATCH 1/5] NFSv4: Don't check file access when reclaiming state Trond Myklebust
2016-11-10 21:41 ` [PATCH 2/5] NFSv4: Don't ask for the change attribute " Trond Myklebust
2016-11-10 21:41 ` [PATCH 3/5] NFSv4: Don't request a GETATTR on open_downgrade Trond Myklebust
2016-11-10 21:41 ` [PATCH 4/5] NFSv4: Don't request close-to-open attribute when holding a delegation Trond Myklebust
2016-11-10 21:41 ` [PATCH 5/5] NFSv4: Optimise away forced revalidation when we know the attributes are OK Trond Myklebust
2016-11-10 22:18 ` [PATCH 1/5] NFSv4: Don't check file access when reclaiming state kbuild test robot
2016-11-14 20:44 ` Anna Schumaker [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-12-01 22:06 [PATCH 0/5] Performance optimsations for 4.10 Trond Myklebust
2016-12-01 22:06 ` [PATCH 1/5] NFSv4: Don't check file access when reclaiming state Trond Myklebust
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2db857a6-a5eb-9b62-93fa-4c4ad81f35e7@Netapp.com \
--to=anna.schumaker@netapp.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).