summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@primarydata.com>2016-12-19 17:36:41 +0100
committerTrond Myklebust <trond.myklebust@primarydata.com>2016-12-19 23:29:58 +0100
commit9413a1a1bf5d58db610e3d9ba500f4150afa55ad (patch)
tree8e06ad6dd9da0c943d9e5cdeb4d841b51787257e /fs/nfs/nfs4proc.c
parentNFS: Don't abuse NFS_INO_REVAL_FORCED in nfs_post_op_update_inode_locked() (diff)
downloadlinux-9413a1a1bf5d58db610e3d9ba500f4150afa55ad.tar.xz
linux-9413a1a1bf5d58db610e3d9ba500f4150afa55ad.zip
NFSv4: Also ask for attributes when downgrading to a READ-only state
If we're downgrading from a READ+WRITE mode to a READ-only mode, then ask for cache consistency attributes so that we avoid the revalidation in nfs_close_context() Fixes: 3947b74d0f9d ("NFSv4: Don't request a GETATTR on open_downgrade.") Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/nfs4proc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 0d9fa18aa243..872ff6756723 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3200,9 +3200,10 @@ static void nfs4_close_prepare(struct rpc_task *task, void *data)
goto out_wait;
}
- if (calldata->arg.fmode == 0) {
+ if (calldata->arg.fmode == 0)
task->tk_msg.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_CLOSE];
+ if (calldata->arg.fmode == 0 || calldata->arg.fmode == FMODE_READ) {
/* Close-to-open cache consistency revalidation */
if (!nfs4_have_delegation(inode, FMODE_READ))
calldata->arg.bitmask = NFS_SERVER(inode)->cache_consistency_bitmask;