2013-08-20 17:13:45

by Myklebust, Trond

[permalink] [raw]
Subject: [PATCH] NFS: Remove the NFSv4 "open optimisation" from nfs_permission

Ever since commit 6168f62cb (Add ACCESS operation to OPEN compound)
the NFSv4 atomic open has primed the access cache, and so nfs_permission
will no longer do an RPC call on the wire.

Signed-off-by: Trond Myklebust <[email protected]>
---
fs/nfs/dir.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 39e69d4..5d737bd 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2245,11 +2245,6 @@ int nfs_permission(struct inode *inode, int mask)
case S_IFLNK:
goto out;
case S_IFREG:
- /* NFSv4 has atomic_open... */
- if (nfs_server_capable(inode, NFS_CAP_ATOMIC_OPEN)
- && (mask & MAY_OPEN)
- && !(mask & MAY_EXEC))
- goto out;
break;
case S_IFDIR:
/*
--
1.8.3.1



2013-08-20 17:22:18

by Adamson, Dros

[permalink] [raw]
Subject: Re: [PATCH] NFS: Remove the NFSv4 "open optimisation" from nfs_permission

Good catch!

-dros

On Aug 20, 2013, at 1:13 PM, Trond Myklebust <[email protected]> wrote:

> Ever since commit 6168f62cb (Add ACCESS operation to OPEN compound)
> the NFSv4 atomic open has primed the access cache, and so nfs_permission
> will no longer do an RPC call on the wire.
>
> Signed-off-by: Trond Myklebust <[email protected]>
> ---
> fs/nfs/dir.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
> index 39e69d4..5d737bd 100644
> --- a/fs/nfs/dir.c
> +++ b/fs/nfs/dir.c
> @@ -2245,11 +2245,6 @@ int nfs_permission(struct inode *inode, int mask)
> case S_IFLNK:
> goto out;
> case S_IFREG:
> - /* NFSv4 has atomic_open... */
> - if (nfs_server_capable(inode, NFS_CAP_ATOMIC_OPEN)
> - && (mask & MAY_OPEN)
> - && !(mask & MAY_EXEC))
> - goto out;
> break;
> case S_IFDIR:
> /*
> --
> 1.8.3.1
>