Skip to content

Commit

Permalink
NFSv4: Also ask for attributes when downgrading to a READ-only state
Browse files Browse the repository at this point in the history
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: 3947b74 ("NFSv4: Don't request a GETATTR on open_downgrade.")
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
trondmypd committed Dec 19, 2016
1 parent a5f925b commit 9413a1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9413a1a

Please sign in to comment.