aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/nfs/nfs4_fs.h24
-rw-r--r--fs/nfsd/nfs4xdr.c14
2 files changed, 1 insertions, 37 deletions
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 1ec1a85fa71c..1a652a0bd7db 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -13,30 +13,6 @@
13 13
14struct idmap; 14struct idmap;
15 15
16/*
17 * In a seqid-mutating op, this macro controls which error return
18 * values trigger incrementation of the seqid.
19 *
20 * from rfc 3010:
21 * The client MUST monotonically increment the sequence number for the
22 * CLOSE, LOCK, LOCKU, OPEN, OPEN_CONFIRM, and OPEN_DOWNGRADE
23 * operations. This is true even in the event that the previous
24 * operation that used the sequence number received an error. The only
25 * exception to this rule is if the previous operation received one of
26 * the following errors: NFSERR_STALE_CLIENTID, NFSERR_STALE_STATEID,
27 * NFSERR_BAD_STATEID, NFSERR_BAD_SEQID, NFSERR_BADXDR,
28 * NFSERR_RESOURCE, NFSERR_NOFILEHANDLE.
29 *
30 */
31#define seqid_mutating_err(err) \
32(((err) != NFSERR_STALE_CLIENTID) && \
33 ((err) != NFSERR_STALE_STATEID) && \
34 ((err) != NFSERR_BAD_STATEID) && \
35 ((err) != NFSERR_BAD_SEQID) && \
36 ((err) != NFSERR_BAD_XDR) && \
37 ((err) != NFSERR_RESOURCE) && \
38 ((err) != NFSERR_NOFILEHANDLE))
39
40enum nfs4_client_state { 16enum nfs4_client_state {
41 NFS4CLNT_MANAGER_RUNNING = 0, 17 NFS4CLNT_MANAGER_RUNNING = 0,
42 NFS4CLNT_CHECK_LEASE, 18 NFS4CLNT_CHECK_LEASE,
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 78c792fb59a8..04ad9a2ca3d0 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1623,18 +1623,6 @@ 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
1638/* 1626/*
1639 * Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This 1627 * Routine for encoding the result of a "seqid-mutating" NFSv4 operation. This
1640 * is where sequence id's are incremented, and the replay cache is filled. 1628 * is where sequence id's are incremented, and the replay cache is filled.
@@ -1643,7 +1631,7 @@ static bool seqid_mutating_err(__be32 err)
1643 */ 1631 */
1644 1632
1645#define ENCODE_SEQID_OP_TAIL(stateowner) do { \ 1633#define ENCODE_SEQID_OP_TAIL(stateowner) do { \
1646 if (seqid_mutating_err(nfserr) && stateowner) { \ 1634 if (seqid_mutating_err(ntohl(nfserr)) && stateowner) { \
1647 stateowner->so_seqid++; \ 1635 stateowner->so_seqid++; \
1648 stateowner->so_replay.rp_status = nfserr; \ 1636 stateowner->so_replay.rp_status = nfserr; \
1649 stateowner->so_replay.rp_buflen = \ 1637 stateowner->so_replay.rp_buflen = \