Skip to content

Commit

Permalink
nfsd4: fix seqid_mutating_error
Browse files Browse the repository at this point in the history
The set of errors here does *not* agree with the set of errors specified
in the rfc!

While we're there, turn this macros into a function, for the usual
reasons, and move it to the one place where it's actually used.

Cc: stable@kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
J. Bruce Fields committed Aug 19, 2011
1 parent 832023b commit 5761630
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
12 changes: 12 additions & 0 deletions fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,18 @@ static void write_cinfo(__be32 **p, struct nfsd4_change_info *c)
\
save = resp->p;

static bool seqid_mutating_err(__be32 err)
{
/* rfc 3530 section 8.1.5: */
return err != nfserr_stale_clientid &&
err != nfserr_stale_stateid &&
err != nfserr_bad_stateid &&
err != nfserr_bad_seqid &&
err != nfserr_bad_xdr &&
err != nfserr_resource &&
err != nfserr_nofilehandle;
}

/*
* Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This
* is where sequence id's are incremented, and the replay cache is filled.
Expand Down
6 changes: 0 additions & 6 deletions fs/nfsd/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -447,12 +447,6 @@ struct nfs4_stateid {
#define WR_STATE 0x00000020
#define CLOSE_STATE 0x00000040

#define seqid_mutating_err(err) \
(((err) != nfserr_stale_clientid) && \
((err) != nfserr_bad_seqid) && \
((err) != nfserr_stale_stateid) && \
((err) != nfserr_bad_stateid))

struct nfsd4_compound_state;

extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
Expand Down

0 comments on commit 5761630

Please sign in to comment.