nfsd4: fix seqid_mutating_error
authorJ. Bruce Fields <bfields@redhat.com>
Wed, 10 Aug 2011 23:16:22 +0000 (19:16 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Nov 2011 17:35:57 +0000 (09:35 -0800)
commit 576163005de286bbd418fcb99cfd0971523a0c6d upstream.

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.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfsd/nfs4xdr.c
fs/nfsd/state.h

index 990181103214de4f45d305753aea2daa064f44c0..6c740974bfe0c0042235f88aa92434d193edb48d 100644 (file)
@@ -1548,6 +1548,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.
index 6bd2f3c21f2b7195b355be089084bc8222176a45..858c7baea2d2ffb290aad4e9691cb4bd54493f67 100644 (file)
@@ -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,