mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
NFSv4: Allow attribute caching with 'noac' mounts if client holds a delegation
If the server has given us a delegation on a file, we _know_ that we can cache the attribute information even when the user has specified 'noac'. Reviewed-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
a8ce4a8f37
commit
d7cf8dd012
2 changed files with 18 additions and 9 deletions
|
@ -161,14 +161,17 @@ static int nfs_revalidate_file_size(struct inode *inode, struct file *filp)
|
|||
struct nfs_server *server = NFS_SERVER(inode);
|
||||
struct nfs_inode *nfsi = NFS_I(inode);
|
||||
|
||||
if (server->flags & NFS_MOUNT_NOAC)
|
||||
goto force_reval;
|
||||
if (nfs_have_delegated_attributes(inode))
|
||||
goto out_noreval;
|
||||
|
||||
if (filp->f_flags & O_DIRECT)
|
||||
goto force_reval;
|
||||
if (nfsi->npages != 0)
|
||||
return 0;
|
||||
if (!(nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE) && !nfs_attribute_timeout(inode))
|
||||
return 0;
|
||||
if (nfsi->cache_validity & NFS_INO_REVAL_PAGECACHE)
|
||||
goto force_reval;
|
||||
if (nfs_attribute_timeout(inode))
|
||||
goto force_reval;
|
||||
out_noreval:
|
||||
return 0;
|
||||
force_reval:
|
||||
return __nfs_revalidate_inode(server, inode);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue