diff options
author | Andy Adamson <andros@netapp.com> | 2009-04-03 01:28:50 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-04-03 20:41:20 -0400 |
commit | 60adfc50de3855628dea8f8896a65f471f51301c (patch) | |
tree | 56b0b32f5c46cee80128ffaec1ac41588a821673 /fs/nfsd/nfs4proc.c | |
parent | 496c262cf01106a546ffb7df6fea84b8b881ee19 (diff) |
nfsd41: clientid handling
Extract the clientid from sessionid to set the op_clientid on open.
Verify that the clid for other stateful ops is zero for minorversion != 0
Do all other checks for stateful ops without sessions.
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Andy Adamson <andros@netapp.com>
[fixed whitespace indent]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfsd41 remove sl_session from nfsd4_open]
Signed-off-by: Andy Adamson <andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd/nfs4proc.c')
-rw-r--r-- | fs/nfsd/nfs4proc.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index aeb4888bdfad..3fdcca53212a 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -162,6 +162,15 @@ do_open_fhandle(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nfsd4_ | |||
162 | return status; | 162 | return status; |
163 | } | 163 | } |
164 | 164 | ||
165 | static void | ||
166 | copy_clientid(clientid_t *clid, struct nfsd4_session *session) | ||
167 | { | ||
168 | struct nfsd4_sessionid *sid = | ||
169 | (struct nfsd4_sessionid *)session->se_sessionid.data; | ||
170 | |||
171 | clid->cl_boot = sid->clientid.cl_boot; | ||
172 | clid->cl_id = sid->clientid.cl_id; | ||
173 | } | ||
165 | 174 | ||
166 | static __be32 | 175 | static __be32 |
167 | nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | 176 | nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, |
@@ -178,6 +187,9 @@ nfsd4_open(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
178 | if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) | 187 | if (open->op_create && open->op_claim_type != NFS4_OPEN_CLAIM_NULL) |
179 | return nfserr_inval; | 188 | return nfserr_inval; |
180 | 189 | ||
190 | if (nfsd4_has_session(cstate)) | ||
191 | copy_clientid(&open->op_clientid, cstate->session); | ||
192 | |||
181 | nfs4_lock_state(); | 193 | nfs4_lock_state(); |
182 | 194 | ||
183 | /* check seqid for replay. set nfs4_owner */ | 195 | /* check seqid for replay. set nfs4_owner */ |