Commit 7a04cfda authored by J. Bruce Fields's avatar J. Bruce Fields

nfsd: clarify check_op_ordering

Document a couple things that confused me on a recent reading.
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 4a269efb
...@@ -1603,7 +1603,7 @@ static const char *nfsd4_op_name(unsigned opnum); ...@@ -1603,7 +1603,7 @@ static const char *nfsd4_op_name(unsigned opnum);
*/ */
static __be32 nfs41_check_op_ordering(struct nfsd4_compoundargs *args) static __be32 nfs41_check_op_ordering(struct nfsd4_compoundargs *args)
{ {
struct nfsd4_op *op = &args->ops[0]; struct nfsd4_op *first_op = &args->ops[0];
/* These ordering requirements don't apply to NFSv4.0: */ /* These ordering requirements don't apply to NFSv4.0: */
if (args->minorversion == 0) if (args->minorversion == 0)
...@@ -1611,12 +1611,17 @@ static __be32 nfs41_check_op_ordering(struct nfsd4_compoundargs *args) ...@@ -1611,12 +1611,17 @@ static __be32 nfs41_check_op_ordering(struct nfsd4_compoundargs *args)
/* This is weird, but OK, not our problem: */ /* This is weird, but OK, not our problem: */
if (args->opcnt == 0) if (args->opcnt == 0)
return nfs_ok; return nfs_ok;
if (op->status == nfserr_op_illegal) if (first_op->status == nfserr_op_illegal)
return nfs_ok; return nfs_ok;
if (!(nfsd4_ops[op->opnum].op_flags & ALLOWED_AS_FIRST_OP)) if (!(nfsd4_ops[first_op->opnum].op_flags & ALLOWED_AS_FIRST_OP))
return nfserr_op_not_in_session; return nfserr_op_not_in_session;
if (op->opnum == OP_SEQUENCE) if (first_op->opnum == OP_SEQUENCE)
return nfs_ok; return nfs_ok;
/*
* So first_op is something allowed outside a session, like
* EXCHANGE_ID; but then it has to be the only op in the
* compound:
*/
if (args->opcnt != 1) if (args->opcnt != 1)
return nfserr_not_only_op; return nfserr_not_only_op;
return nfs_ok; return nfs_ok;
......
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