aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorAndy Adamson <andros@netapp.com>2009-04-03 01:28:50 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-04-03 20:41:20 -0400
commit60adfc50de3855628dea8f8896a65f471f51301c (patch)
tree56b0b32f5c46cee80128ffaec1ac41588a821673 /fs/nfsd/nfs4xdr.c
parent496c262cf01106a546ffb7df6fea84b8b881ee19 (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/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 7fdee828f44e..059d4aad39b8 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -189,6 +189,11 @@ static __be32 *read_buf(struct nfsd4_compoundargs *argp, u32 nbytes)
189 return p; 189 return p;
190} 190}
191 191
192static int zero_clientid(clientid_t *clid)
193{
194 return (clid->cl_boot == 0) && (clid->cl_id == 0);
195}
196
192static int 197static int
193defer_free(struct nfsd4_compoundargs *argp, 198defer_free(struct nfsd4_compoundargs *argp,
194 void (*release)(const void *), void *p) 199 void (*release)(const void *), void *p)
@@ -584,6 +589,8 @@ nfsd4_decode_lockt(struct nfsd4_compoundargs *argp, struct nfsd4_lockt *lockt)
584 READ_BUF(lockt->lt_owner.len); 589 READ_BUF(lockt->lt_owner.len);
585 READMEM(lockt->lt_owner.data, lockt->lt_owner.len); 590 READMEM(lockt->lt_owner.data, lockt->lt_owner.len);
586 591
592 if (argp->minorversion && !zero_clientid(&lockt->lt_clientid))
593 return nfserr_inval;
587 DECODE_TAIL; 594 DECODE_TAIL;
588} 595}
589 596
@@ -994,6 +1001,8 @@ nfsd4_decode_release_lockowner(struct nfsd4_compoundargs *argp, struct nfsd4_rel
994 READ_BUF(rlockowner->rl_owner.len); 1001 READ_BUF(rlockowner->rl_owner.len);
995 READMEM(rlockowner->rl_owner.data, rlockowner->rl_owner.len); 1002 READMEM(rlockowner->rl_owner.data, rlockowner->rl_owner.len);
996 1003
1004 if (argp->minorversion && !zero_clientid(&rlockowner->rl_clientid))
1005 return nfserr_inval;
997 DECODE_TAIL; 1006 DECODE_TAIL;
998} 1007}
999 1008