aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-08-10 19:16:22 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-08-19 13:25:31 -0400
commit576163005de286bbd418fcb99cfd0971523a0c6d (patch)
tree0dfed2e6646039b55c23cf001f8bf6ebe575aa8a
parent832023bffb4b493f230be901f681020caf3ed1f8 (diff)
nfsd4: fix seqid_mutating_error
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>
-rw-r--r--fs/nfsd/nfs4xdr.c12
-rw-r--r--fs/nfsd/state.h6
2 files changed, 12 insertions, 6 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index c8bf405d19de..f81099605256 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1623,6 +1623,18 @@ static void write_cinfo(__be32 **p, struct nfsd4_change_info *c)
1623 \ 1623 \
1624 save = resp->p; 1624 save = resp->p;
1625 1625
1626static bool seqid_mutating_err(__be32 err)
1627{
1628 /* rfc 3530 section 8.1.5: */
1629 return err != nfserr_stale_clientid &&
1630 err != nfserr_stale_stateid &&
1631 err != nfserr_bad_stateid &&
1632 err != nfserr_bad_seqid &&
1633 err != nfserr_bad_xdr &&
1634 err != nfserr_resource &&
1635 err != nfserr_nofilehandle;
1636}
1637
1626/* 1638/*
1627 * Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This 1639 * Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This
1628 * is where sequence id's are incremented, and the replay cache is filled. 1640 * is where sequence id's are incremented, and the replay cache is filled.
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index 4eefaf1b42e8..5cfebe504056 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -447,12 +447,6 @@ struct nfs4_stateid {
447#define WR_STATE 0x00000020 447#define WR_STATE 0x00000020
448#define CLOSE_STATE 0x00000040 448#define CLOSE_STATE 0x00000040
449 449
450#define seqid_mutating_err(err) \
451 (((err) != nfserr_stale_clientid) && \
452 ((err) != nfserr_bad_seqid) && \
453 ((err) != nfserr_stale_stateid) && \
454 ((err) != nfserr_bad_stateid))
455
456struct nfsd4_compound_state; 450struct nfsd4_compound_state;
457 451
458extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, 452extern __be32 nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,