[PATCH 28/30] nfsd41: add test for failed sequence operation

andros
2009-06-08T18:21:41Z

Failed sequence operations are not cached.

Signed-off-by: Andy Adamson <andros@netapp.com>
---
include/linux/nfsd/xdr4.h | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 026d3a5..3dbbbc3 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -460,6 +460,13 @@ struct nfsd4_compoundres {
struct nfsd4_compound_state cstate;
};

+static inline bool nfsd4_is_failed_sequence(struct nfsd4_compoundres *resp)
+{
+ struct nfsd4_compoundargs *args = resp->rqstp->rq_argp;
+ return resp->opcnt == 1 && args->ops[0].opnum == OP_SEQUENCE &&
+ resp->cstate.status;
+}
+
static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp)
{
struct nfsd4_compoundargs *args = resp->rqstp->rq_argp;
@@ -469,7 +476,8 @@ static inline bool nfsd4_is_solo_sequence(struct nfsd4_compoundres *resp)
static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp)
{
return !resp->cstate.slot->sl_cachethis ||
- nfsd4_is_solo_sequence(resp);
+ nfsd4_is_solo_sequence(resp) ||
+ nfsd4_is_failed_sequence(resp);
}

#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
--
1.5.4.3