diff options
author | Benny Halevy <bhalevy@panasas.com> | 2009-04-01 09:23:27 -0400 |
---|---|---|
committer | Benny Halevy <bhalevy@panasas.com> | 2009-06-17 17:11:39 -0400 |
commit | 281fe15dc1d6ad46992f18b7a6644269ec5f7138 (patch) | |
tree | 168baccd85401f61433c99b3f14b5b3ff833ff1d /fs/nfs | |
parent | 4aece6a19cf7f474f15eb861ba74db4479884ce3 (diff) |
nfs41: verify CB_SEQUENCE position in callback compound
CB_SEQUENCE must appear first in the callback compound RPC.
If it is not the first operation NFS4ERR_SEQUENCE_POS must be returned.
If the first operation ni the CB_COMPOUND is not CB_SEQUENCE then
NFS4ERR_OP_NOT_IN_SESSION must be returned.
Signed-off-by: Ricardo Labiaga <ricardo.labiaga@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
[nfs41: refactor op preprocessing out of process_op]
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback_xdr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c index 56a3cc510107..537f21da6e5f 100644 --- a/fs/nfs/callback_xdr.c +++ b/fs/nfs/callback_xdr.c | |||
@@ -521,6 +521,14 @@ out: | |||
521 | static __be32 | 521 | static __be32 |
522 | preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op) | 522 | preprocess_nfs41_op(int nop, unsigned int op_nr, struct callback_op **op) |
523 | { | 523 | { |
524 | if (op_nr == OP_CB_SEQUENCE) { | ||
525 | if (nop != 0) | ||
526 | return htonl(NFS4ERR_SEQUENCE_POS); | ||
527 | } else { | ||
528 | if (nop == 0) | ||
529 | return htonl(NFS4ERR_OP_NOT_IN_SESSION); | ||
530 | } | ||
531 | |||
524 | switch (op_nr) { | 532 | switch (op_nr) { |
525 | case OP_CB_GETATTR: | 533 | case OP_CB_GETATTR: |
526 | case OP_CB_RECALL: | 534 | case OP_CB_RECALL: |