aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c151
1 files changed, 128 insertions, 23 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 20b4e30e6c82..4d338be492cb 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -46,11 +46,13 @@
46#include <linux/proc_fs.h> 46#include <linux/proc_fs.h>
47#include <linux/kdev_t.h> 47#include <linux/kdev_t.h>
48#include <linux/sunrpc/clnt.h> 48#include <linux/sunrpc/clnt.h>
49#include <linux/sunrpc/msg_prot.h>
49#include <linux/nfs.h> 50#include <linux/nfs.h>
50#include <linux/nfs4.h> 51#include <linux/nfs4.h>
51#include <linux/nfs_fs.h> 52#include <linux/nfs_fs.h>
52#include <linux/nfs_idmap.h> 53#include <linux/nfs_idmap.h>
53#include "nfs4_fs.h" 54#include "nfs4_fs.h"
55#include "internal.h"
54 56
55#define NFSDBG_FACILITY NFSDBG_XDR 57#define NFSDBG_FACILITY NFSDBG_XDR
56 58
@@ -134,7 +136,7 @@ static int nfs4_stat_to_errno(int);
134#define decode_lookup_maxsz (op_decode_hdr_maxsz) 136#define decode_lookup_maxsz (op_decode_hdr_maxsz)
135#define encode_share_access_maxsz \ 137#define encode_share_access_maxsz \
136 (2) 138 (2)
137#define encode_createmode_maxsz (1 + encode_attrs_maxsz) 139#define encode_createmode_maxsz (1 + encode_attrs_maxsz + encode_verifier_maxsz)
138#define encode_opentype_maxsz (1 + encode_createmode_maxsz) 140#define encode_opentype_maxsz (1 + encode_createmode_maxsz)
139#define encode_claim_null_maxsz (1 + nfs4_name_maxsz) 141#define encode_claim_null_maxsz (1 + nfs4_name_maxsz)
140#define encode_open_maxsz (op_encode_hdr_maxsz + \ 142#define encode_open_maxsz (op_encode_hdr_maxsz + \
@@ -299,6 +301,8 @@ static int nfs4_stat_to_errno(int);
299 XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 4) 301 XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 4)
300#define decode_sequence_maxsz (op_decode_hdr_maxsz + \ 302#define decode_sequence_maxsz (op_decode_hdr_maxsz + \
301 XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5) 303 XDR_QUADLEN(NFS4_MAX_SESSIONID_LEN) + 5)
304#define encode_reclaim_complete_maxsz (op_encode_hdr_maxsz + 4)
305#define decode_reclaim_complete_maxsz (op_decode_hdr_maxsz + 4)
302#else /* CONFIG_NFS_V4_1 */ 306#else /* CONFIG_NFS_V4_1 */
303#define encode_sequence_maxsz 0 307#define encode_sequence_maxsz 0
304#define decode_sequence_maxsz 0 308#define decode_sequence_maxsz 0
@@ -676,6 +680,25 @@ static int nfs4_stat_to_errno(int);
676 decode_sequence_maxsz + \ 680 decode_sequence_maxsz + \
677 decode_putrootfh_maxsz + \ 681 decode_putrootfh_maxsz + \
678 decode_fsinfo_maxsz) 682 decode_fsinfo_maxsz)
683#define NFS4_enc_reclaim_complete_sz (compound_encode_hdr_maxsz + \
684 encode_sequence_maxsz + \
685 encode_reclaim_complete_maxsz)
686#define NFS4_dec_reclaim_complete_sz (compound_decode_hdr_maxsz + \
687 decode_sequence_maxsz + \
688 decode_reclaim_complete_maxsz)
689
690const u32 nfs41_maxwrite_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
691 compound_encode_hdr_maxsz +
692 encode_sequence_maxsz +
693 encode_putfh_maxsz +
694 encode_getattr_maxsz) *
695 XDR_UNIT);
696
697const u32 nfs41_maxread_overhead = ((RPC_MAX_HEADER_WITH_AUTH +
698 compound_decode_hdr_maxsz +
699 decode_sequence_maxsz +
700 decode_putfh_maxsz) *
701 XDR_UNIT);
679#endif /* CONFIG_NFS_V4_1 */ 702#endif /* CONFIG_NFS_V4_1 */
680 703
681static const umode_t nfs_type2fmt[] = { 704static const umode_t nfs_type2fmt[] = {
@@ -1140,6 +1163,7 @@ static inline void encode_openhdr(struct xdr_stream *xdr, const struct nfs_opena
1140static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg) 1163static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_openargs *arg)
1141{ 1164{
1142 __be32 *p; 1165 __be32 *p;
1166 struct nfs_client *clp;
1143 1167
1144 p = reserve_space(xdr, 4); 1168 p = reserve_space(xdr, 4);
1145 switch(arg->open_flags & O_EXCL) { 1169 switch(arg->open_flags & O_EXCL) {
@@ -1148,8 +1172,23 @@ static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_op
1148 encode_attrs(xdr, arg->u.attrs, arg->server); 1172 encode_attrs(xdr, arg->u.attrs, arg->server);
1149 break; 1173 break;
1150 default: 1174 default:
1151 *p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE); 1175 clp = arg->server->nfs_client;
1152 encode_nfs4_verifier(xdr, &arg->u.verifier); 1176 if (clp->cl_minorversion > 0) {
1177 if (nfs4_has_persistent_session(clp)) {
1178 *p = cpu_to_be32(NFS4_CREATE_GUARDED);
1179 encode_attrs(xdr, arg->u.attrs, arg->server);
1180 } else {
1181 struct iattr dummy;
1182
1183 *p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE4_1);
1184 encode_nfs4_verifier(xdr, &arg->u.verifier);
1185 dummy.ia_valid = 0;
1186 encode_attrs(xdr, &dummy, arg->server);
1187 }
1188 } else {
1189 *p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE);
1190 encode_nfs4_verifier(xdr, &arg->u.verifier);
1191 }
1153 } 1192 }
1154} 1193}
1155 1194
@@ -1539,6 +1578,14 @@ static void encode_create_session(struct xdr_stream *xdr,
1539 char machine_name[NFS4_MAX_MACHINE_NAME_LEN]; 1578 char machine_name[NFS4_MAX_MACHINE_NAME_LEN];
1540 uint32_t len; 1579 uint32_t len;
1541 struct nfs_client *clp = args->client; 1580 struct nfs_client *clp = args->client;
1581 u32 max_resp_sz_cached;
1582
1583 /*
1584 * Assumes OPEN is the biggest non-idempotent compound.
1585 * 2 is the verifier.
1586 */
1587 max_resp_sz_cached = (NFS4_dec_open_sz + RPC_REPHDRSIZE +
1588 RPC_MAX_AUTH_SIZE + 2) * XDR_UNIT;
1542 1589
1543 len = scnprintf(machine_name, sizeof(machine_name), "%s", 1590 len = scnprintf(machine_name, sizeof(machine_name), "%s",
1544 clp->cl_ipaddr); 1591 clp->cl_ipaddr);
@@ -1553,7 +1600,7 @@ static void encode_create_session(struct xdr_stream *xdr,
1553 *p++ = cpu_to_be32(args->fc_attrs.headerpadsz); /* header padding size */ 1600 *p++ = cpu_to_be32(args->fc_attrs.headerpadsz); /* header padding size */
1554 *p++ = cpu_to_be32(args->fc_attrs.max_rqst_sz); /* max req size */ 1601 *p++ = cpu_to_be32(args->fc_attrs.max_rqst_sz); /* max req size */
1555 *p++ = cpu_to_be32(args->fc_attrs.max_resp_sz); /* max resp size */ 1602 *p++ = cpu_to_be32(args->fc_attrs.max_resp_sz); /* max resp size */
1556 *p++ = cpu_to_be32(args->fc_attrs.max_resp_sz_cached); /* Max resp sz cached */ 1603 *p++ = cpu_to_be32(max_resp_sz_cached); /* Max resp sz cached */
1557 *p++ = cpu_to_be32(args->fc_attrs.max_ops); /* max operations */ 1604 *p++ = cpu_to_be32(args->fc_attrs.max_ops); /* max operations */
1558 *p++ = cpu_to_be32(args->fc_attrs.max_reqs); /* max requests */ 1605 *p++ = cpu_to_be32(args->fc_attrs.max_reqs); /* max requests */
1559 *p++ = cpu_to_be32(0); /* rdmachannel_attrs */ 1606 *p++ = cpu_to_be32(0); /* rdmachannel_attrs */
@@ -1592,6 +1639,19 @@ static void encode_destroy_session(struct xdr_stream *xdr,
1592 hdr->nops++; 1639 hdr->nops++;
1593 hdr->replen += decode_destroy_session_maxsz; 1640 hdr->replen += decode_destroy_session_maxsz;
1594} 1641}
1642
1643static void encode_reclaim_complete(struct xdr_stream *xdr,
1644 struct nfs41_reclaim_complete_args *args,
1645 struct compound_hdr *hdr)
1646{
1647 __be32 *p;
1648
1649 p = reserve_space(xdr, 8);
1650 *p++ = cpu_to_be32(OP_RECLAIM_COMPLETE);
1651 *p++ = cpu_to_be32(args->one_fs);
1652 hdr->nops++;
1653 hdr->replen += decode_reclaim_complete_maxsz;
1654}
1595#endif /* CONFIG_NFS_V4_1 */ 1655#endif /* CONFIG_NFS_V4_1 */
1596 1656
1597static void encode_sequence(struct xdr_stream *xdr, 1657static void encode_sequence(struct xdr_stream *xdr,
@@ -2096,7 +2156,7 @@ nfs4_xdr_enc_getacl(struct rpc_rqst *req, __be32 *p,
2096 encode_compound_hdr(&xdr, req, &hdr); 2156 encode_compound_hdr(&xdr, req, &hdr);
2097 encode_sequence(&xdr, &args->seq_args, &hdr); 2157 encode_sequence(&xdr, &args->seq_args, &hdr);
2098 encode_putfh(&xdr, args->fh, &hdr); 2158 encode_putfh(&xdr, args->fh, &hdr);
2099 replen = hdr.replen + nfs4_fattr_bitmap_maxsz + 1; 2159 replen = hdr.replen + op_decode_hdr_maxsz + nfs4_fattr_bitmap_maxsz + 1;
2100 encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr); 2160 encode_getattr_two(&xdr, FATTR4_WORD0_ACL, 0, &hdr);
2101 2161
2102 xdr_inline_pages(&req->rq_rcv_buf, replen << 2, 2162 xdr_inline_pages(&req->rq_rcv_buf, replen << 2,
@@ -2420,6 +2480,26 @@ static int nfs4_xdr_enc_get_lease_time(struct rpc_rqst *req, uint32_t *p,
2420 encode_nops(&hdr); 2480 encode_nops(&hdr);
2421 return 0; 2481 return 0;
2422} 2482}
2483
2484/*
2485 * a RECLAIM_COMPLETE request
2486 */
2487static int nfs4_xdr_enc_reclaim_complete(struct rpc_rqst *req, uint32_t *p,
2488 struct nfs41_reclaim_complete_args *args)
2489{
2490 struct xdr_stream xdr;
2491 struct compound_hdr hdr = {
2492 .minorversion = nfs4_xdr_minorversion(&args->seq_args)
2493 };
2494
2495 xdr_init_encode(&xdr, &req->rq_snd_buf, p);
2496 encode_compound_hdr(&xdr, req, &hdr);
2497 encode_sequence(&xdr, &args->seq_args, &hdr);
2498 encode_reclaim_complete(&xdr, args, &hdr);
2499 encode_nops(&hdr);
2500 return 0;
2501}
2502
2423#endif /* CONFIG_NFS_V4_1 */ 2503#endif /* CONFIG_NFS_V4_1 */
2424 2504
2425static void print_overflow_msg(const char *func, const struct xdr_stream *xdr) 2505static void print_overflow_msg(const char *func, const struct xdr_stream *xdr)
@@ -4528,6 +4608,11 @@ static int decode_destroy_session(struct xdr_stream *xdr, void *dummy)
4528{ 4608{
4529 return decode_op_hdr(xdr, OP_DESTROY_SESSION); 4609 return decode_op_hdr(xdr, OP_DESTROY_SESSION);
4530} 4610}
4611
4612static int decode_reclaim_complete(struct xdr_stream *xdr, void *dummy)
4613{
4614 return decode_op_hdr(xdr, OP_RECLAIM_COMPLETE);
4615}
4531#endif /* CONFIG_NFS_V4_1 */ 4616#endif /* CONFIG_NFS_V4_1 */
4532 4617
4533static int decode_sequence(struct xdr_stream *xdr, 4618static int decode_sequence(struct xdr_stream *xdr,
@@ -4554,7 +4639,7 @@ static int decode_sequence(struct xdr_stream *xdr,
4554 * If the server returns different values for sessionID, slotID or 4639 * If the server returns different values for sessionID, slotID or
4555 * sequence number, the server is looney tunes. 4640 * sequence number, the server is looney tunes.
4556 */ 4641 */
4557 status = -ESERVERFAULT; 4642 status = -EREMOTEIO;
4558 4643
4559 if (memcmp(id.data, res->sr_session->sess_id.data, 4644 if (memcmp(id.data, res->sr_session->sess_id.data,
4560 NFS4_MAX_SESSIONID_LEN)) { 4645 NFS4_MAX_SESSIONID_LEN)) {
@@ -4583,8 +4668,8 @@ static int decode_sequence(struct xdr_stream *xdr,
4583 dummy = be32_to_cpup(p++); 4668 dummy = be32_to_cpup(p++);
4584 /* target highest slot id - currently not processed */ 4669 /* target highest slot id - currently not processed */
4585 dummy = be32_to_cpup(p++); 4670 dummy = be32_to_cpup(p++);
4586 /* result flags - currently not processed */ 4671 /* result flags */
4587 dummy = be32_to_cpup(p); 4672 res->sr_status_flags = be32_to_cpup(p);
4588 status = 0; 4673 status = 0;
4589out_err: 4674out_err:
4590 res->sr_status = status; 4675 res->sr_status = status;
@@ -5309,7 +5394,7 @@ out:
5309} 5394}
5310 5395
5311/* 5396/*
5312 * FSINFO request 5397 * Decode FSINFO response
5313 */ 5398 */
5314static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, __be32 *p, 5399static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, __be32 *p,
5315 struct nfs4_fsinfo_res *res) 5400 struct nfs4_fsinfo_res *res)
@@ -5330,7 +5415,7 @@ static int nfs4_xdr_dec_fsinfo(struct rpc_rqst *req, __be32 *p,
5330} 5415}
5331 5416
5332/* 5417/*
5333 * PATHCONF request 5418 * Decode PATHCONF response
5334 */ 5419 */
5335static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, __be32 *p, 5420static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, __be32 *p,
5336 struct nfs4_pathconf_res *res) 5421 struct nfs4_pathconf_res *res)
@@ -5351,7 +5436,7 @@ static int nfs4_xdr_dec_pathconf(struct rpc_rqst *req, __be32 *p,
5351} 5436}
5352 5437
5353/* 5438/*
5354 * STATFS request 5439 * Decode STATFS response
5355 */ 5440 */
5356static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, __be32 *p, 5441static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, __be32 *p,
5357 struct nfs4_statfs_res *res) 5442 struct nfs4_statfs_res *res)
@@ -5372,7 +5457,7 @@ static int nfs4_xdr_dec_statfs(struct rpc_rqst *req, __be32 *p,
5372} 5457}
5373 5458
5374/* 5459/*
5375 * GETATTR_BITMAP request 5460 * Decode GETATTR_BITMAP response
5376 */ 5461 */
5377static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req, __be32 *p, struct nfs4_server_caps_res *res) 5462static int nfs4_xdr_dec_server_caps(struct rpc_rqst *req, __be32 *p, struct nfs4_server_caps_res *res)
5378{ 5463{
@@ -5411,7 +5496,7 @@ static int nfs4_xdr_dec_renew(struct rpc_rqst *rqstp, __be32 *p, void *dummy)
5411} 5496}
5412 5497
5413/* 5498/*
5414 * a SETCLIENTID request 5499 * Decode SETCLIENTID response
5415 */ 5500 */
5416static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, __be32 *p, 5501static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, __be32 *p,
5417 struct nfs_client *clp) 5502 struct nfs_client *clp)
@@ -5428,7 +5513,7 @@ static int nfs4_xdr_dec_setclientid(struct rpc_rqst *req, __be32 *p,
5428} 5513}
5429 5514
5430/* 5515/*
5431 * a SETCLIENTID_CONFIRM request 5516 * Decode SETCLIENTID_CONFIRM response
5432 */ 5517 */
5433static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo) 5518static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, __be32 *p, struct nfs_fsinfo *fsinfo)
5434{ 5519{
@@ -5448,7 +5533,7 @@ static int nfs4_xdr_dec_setclientid_confirm(struct rpc_rqst *req, __be32 *p, str
5448} 5533}
5449 5534
5450/* 5535/*
5451 * DELEGRETURN request 5536 * Decode DELEGRETURN response
5452 */ 5537 */
5453static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_delegreturnres *res) 5538static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nfs4_delegreturnres *res)
5454{ 5539{
@@ -5474,7 +5559,7 @@ out:
5474} 5559}
5475 5560
5476/* 5561/*
5477 * FS_LOCATIONS request 5562 * Decode FS_LOCATIONS response
5478 */ 5563 */
5479static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, __be32 *p, 5564static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, __be32 *p,
5480 struct nfs4_fs_locations_res *res) 5565 struct nfs4_fs_locations_res *res)
@@ -5504,7 +5589,7 @@ out:
5504 5589
5505#if defined(CONFIG_NFS_V4_1) 5590#if defined(CONFIG_NFS_V4_1)
5506/* 5591/*
5507 * EXCHANGE_ID request 5592 * Decode EXCHANGE_ID response
5508 */ 5593 */
5509static int nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp, uint32_t *p, 5594static int nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp, uint32_t *p,
5510 void *res) 5595 void *res)
@@ -5521,7 +5606,7 @@ static int nfs4_xdr_dec_exchange_id(struct rpc_rqst *rqstp, uint32_t *p,
5521} 5606}
5522 5607
5523/* 5608/*
5524 * a CREATE_SESSION request 5609 * Decode CREATE_SESSION response
5525 */ 5610 */
5526static int nfs4_xdr_dec_create_session(struct rpc_rqst *rqstp, uint32_t *p, 5611static int nfs4_xdr_dec_create_session(struct rpc_rqst *rqstp, uint32_t *p,
5527 struct nfs41_create_session_res *res) 5612 struct nfs41_create_session_res *res)
@@ -5538,7 +5623,7 @@ static int nfs4_xdr_dec_create_session(struct rpc_rqst *rqstp, uint32_t *p,
5538} 5623}
5539 5624
5540/* 5625/*
5541 * a DESTROY_SESSION request 5626 * Decode DESTROY_SESSION response
5542 */ 5627 */
5543static int nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp, uint32_t *p, 5628static int nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp, uint32_t *p,
5544 void *dummy) 5629 void *dummy)
@@ -5555,7 +5640,7 @@ static int nfs4_xdr_dec_destroy_session(struct rpc_rqst *rqstp, uint32_t *p,
5555} 5640}
5556 5641
5557/* 5642/*
5558 * a SEQUENCE request 5643 * Decode SEQUENCE response
5559 */ 5644 */
5560static int nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp, uint32_t *p, 5645static int nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp, uint32_t *p,
5561 struct nfs4_sequence_res *res) 5646 struct nfs4_sequence_res *res)
@@ -5572,7 +5657,7 @@ static int nfs4_xdr_dec_sequence(struct rpc_rqst *rqstp, uint32_t *p,
5572} 5657}
5573 5658
5574/* 5659/*
5575 * a GET_LEASE_TIME request 5660 * Decode GET_LEASE_TIME response
5576 */ 5661 */
5577static int nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp, uint32_t *p, 5662static int nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp, uint32_t *p,
5578 struct nfs4_get_lease_time_res *res) 5663 struct nfs4_get_lease_time_res *res)
@@ -5591,6 +5676,25 @@ static int nfs4_xdr_dec_get_lease_time(struct rpc_rqst *rqstp, uint32_t *p,
5591 status = decode_fsinfo(&xdr, res->lr_fsinfo); 5676 status = decode_fsinfo(&xdr, res->lr_fsinfo);
5592 return status; 5677 return status;
5593} 5678}
5679
5680/*
5681 * Decode RECLAIM_COMPLETE response
5682 */
5683static int nfs4_xdr_dec_reclaim_complete(struct rpc_rqst *rqstp, uint32_t *p,
5684 struct nfs41_reclaim_complete_res *res)
5685{
5686 struct xdr_stream xdr;
5687 struct compound_hdr hdr;
5688 int status;
5689
5690 xdr_init_decode(&xdr, &rqstp->rq_rcv_buf, p);
5691 status = decode_compound_hdr(&xdr, &hdr);
5692 if (!status)
5693 status = decode_sequence(&xdr, &res->seq_res, rqstp);
5694 if (!status)
5695 status = decode_reclaim_complete(&xdr, (void *)NULL);
5696 return status;
5697}
5594#endif /* CONFIG_NFS_V4_1 */ 5698#endif /* CONFIG_NFS_V4_1 */
5595 5699
5596__be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus) 5700__be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus)
@@ -5678,7 +5782,7 @@ static struct {
5678 { NFS4ERR_BAD_COOKIE, -EBADCOOKIE }, 5782 { NFS4ERR_BAD_COOKIE, -EBADCOOKIE },
5679 { NFS4ERR_NOTSUPP, -ENOTSUPP }, 5783 { NFS4ERR_NOTSUPP, -ENOTSUPP },
5680 { NFS4ERR_TOOSMALL, -ETOOSMALL }, 5784 { NFS4ERR_TOOSMALL, -ETOOSMALL },
5681 { NFS4ERR_SERVERFAULT, -ESERVERFAULT }, 5785 { NFS4ERR_SERVERFAULT, -EREMOTEIO },
5682 { NFS4ERR_BADTYPE, -EBADTYPE }, 5786 { NFS4ERR_BADTYPE, -EBADTYPE },
5683 { NFS4ERR_LOCKED, -EAGAIN }, 5787 { NFS4ERR_LOCKED, -EAGAIN },
5684 { NFS4ERR_SYMLINK, -ELOOP }, 5788 { NFS4ERR_SYMLINK, -ELOOP },
@@ -5705,7 +5809,7 @@ nfs4_stat_to_errno(int stat)
5705 } 5809 }
5706 if (stat <= 10000 || stat > 10100) { 5810 if (stat <= 10000 || stat > 10100) {
5707 /* The server is looney tunes. */ 5811 /* The server is looney tunes. */
5708 return -ESERVERFAULT; 5812 return -EREMOTEIO;
5709 } 5813 }
5710 /* If we cannot translate the error, the recovery routines should 5814 /* If we cannot translate the error, the recovery routines should
5711 * handle it. 5815 * handle it.
@@ -5767,6 +5871,7 @@ struct rpc_procinfo nfs4_procedures[] = {
5767 PROC(DESTROY_SESSION, enc_destroy_session, dec_destroy_session), 5871 PROC(DESTROY_SESSION, enc_destroy_session, dec_destroy_session),
5768 PROC(SEQUENCE, enc_sequence, dec_sequence), 5872 PROC(SEQUENCE, enc_sequence, dec_sequence),
5769 PROC(GET_LEASE_TIME, enc_get_lease_time, dec_get_lease_time), 5873 PROC(GET_LEASE_TIME, enc_get_lease_time, dec_get_lease_time),
5874 PROC(RECLAIM_COMPLETE, enc_reclaim_complete, dec_reclaim_complete),
5770#endif /* CONFIG_NFS_V4_1 */ 5875#endif /* CONFIG_NFS_V4_1 */
5771}; 5876};
5772 5877