diff options
author | Mi Jinlong <mijinlong@cn.fujitsu.com> | 2011-07-14 03:06:26 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-07-15 19:00:40 -0400 |
commit | ab1350b2b3c1dd2e465a6abdda608d8c44facfb8 (patch) | |
tree | 18fd3519952c45cc6d3bda7656513265e7ef6435 /fs/nfsd | |
parent | ee19cc406d4c0ae3118f59e000984d935b372871 (diff) |
nfsd41: Deny new lock before RECLAIM_COMPLETE done
Before nfs41 client's RECLAIM_COMPLETE done, nfs server should deny any
new locks or opens.
rfc5661:
" Whenever a client establishes a new client ID and before it does
the first non-reclaim operation that obtains a lock, it MUST send a
RECLAIM_COMPLETE with rca_one_fs set to FALSE, even if there are no
locks to reclaim. If non-reclaim locking operations are done before
the RECLAIM_COMPLETE, an NFS4ERR_GRACE error will be returned. "
Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 96b69299dcbe..121fd84e7f90 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -291,6 +291,15 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
291 | if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) | 291 | if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) |
292 | return nfserr_inval; | 292 | return nfserr_inval; |
293 | 293 | ||
294 | /* | ||
295 | * RFC5661 18.51.3 | ||
296 | * Before RECLAIM_COMPLETE done, server should deny new lock | ||
297 | */ | ||
298 | if (nfsd4_has_session(cstate) && | ||
299 | !cstate->session->se_client->cl_firststate && | ||
300 | open->op_claim_type != NFS4_OPEN_CLAIM_PREVIOUS) | ||
301 | return nfserr_grace; | ||
302 | |||
294 | if (nfsd4_has_session(cstate)) | 303 | if (nfsd4_has_session(cstate)) |
295 | copy_clientid(&open->op_clientid, cstate->session); | 304 | copy_clientid(&open->op_clientid, cstate->session); |
296 | 305 | ||