Commit 72d79ff8 authored by Trond Myklebust's avatar Trond Myklebust
Browse files

NFSv4.1: nfs4_opendata_check_deleg needs to handle NFS4_OPEN_CLAIM_DELEG_CUR_FH



We need to warn against broken NFSv4.1 servers that try to hand out
delegations in response to NFS4_OPEN_CLAIM_DELEG_CUR_FH.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 4a0954ef
...@@ -1458,12 +1458,18 @@ nfs4_opendata_check_deleg(struct nfs4_opendata *data, struct nfs4_state *state) ...@@ -1458,12 +1458,18 @@ nfs4_opendata_check_deleg(struct nfs4_opendata *data, struct nfs4_state *state)
if (delegation) if (delegation)
delegation_flags = delegation->flags; delegation_flags = delegation->flags;
rcu_read_unlock(); rcu_read_unlock();
if (data->o_arg.claim == NFS4_OPEN_CLAIM_DELEGATE_CUR) { switch (data->o_arg.claim) {
default:
break;
case NFS4_OPEN_CLAIM_DELEGATE_CUR:
case NFS4_OPEN_CLAIM_DELEG_CUR_FH:
pr_err_ratelimited("NFS: Broken NFSv4 server %s is " pr_err_ratelimited("NFS: Broken NFSv4 server %s is "
"returning a delegation for " "returning a delegation for "
"OPEN(CLAIM_DELEGATE_CUR)\n", "OPEN(CLAIM_DELEGATE_CUR)\n",
clp->cl_hostname); clp->cl_hostname);
} else if ((delegation_flags & 1UL<<NFS_DELEGATION_NEED_RECLAIM) == 0) return;
}
if ((delegation_flags & 1UL<<NFS_DELEGATION_NEED_RECLAIM) == 0)
nfs_inode_set_delegation(state->inode, nfs_inode_set_delegation(state->inode,
data->owner->so_cred, data->owner->so_cred,
&data->o_res); &data->o_res);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment