summaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4xdr.c
diff options
context:
space:
mode:
authorDavid Quigley <dpquigl@davequigley.com>2013-05-22 12:50:44 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-06-08 16:20:16 -0400
commitaa9c2669626ca7e5e5bab28e6caeb583fd40099b (patch)
tree632e008011b5a8b75edf5a2f4c3c0daf464f0cc4 /fs/nfs/nfs4xdr.c
parent14c43f767818c42f91ec7ffa586ee975845f68c8 (diff)
NFS: Client implementation of Labeled-NFS
This patch implements the client transport and handling support for labeled NFS. The patch adds two functions to encode and decode the security label recommended attribute which makes use of the LSM hooks added earlier. It also adds code to grab the label from the file attribute structures and encode the label to be sent back to the server. Acked-by: James Morris <james.l.morris@oracle.com> Signed-off-by: Matthew N. Dodd <Matthew.Dodd@sparta.com> Signed-off-by: Miguel Rodel Felipe <Rodel_FM@dsi.a-star.edu.sg> Signed-off-by: Phua Eu Gene <PHUA_Eu_Gene@dsi.a-star.edu.sg> Signed-off-by: Khin Mi Mi Aung <Mi_Mi_AUNG@dsi.a-star.edu.sg> Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r--fs/nfs/nfs4xdr.c154
1 files changed, 125 insertions, 29 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 727cfe080eae..2a3f77e14db6 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -102,12 +102,23 @@ static int nfs4_stat_to_errno(int);
102#define nfs4_path_maxsz (1 + ((3 + NFS4_MAXPATHLEN) >> 2)) 102#define nfs4_path_maxsz (1 + ((3 + NFS4_MAXPATHLEN) >> 2))
103#define nfs4_owner_maxsz (1 + XDR_QUADLEN(IDMAP_NAMESZ)) 103#define nfs4_owner_maxsz (1 + XDR_QUADLEN(IDMAP_NAMESZ))
104#define nfs4_group_maxsz (1 + XDR_QUADLEN(IDMAP_NAMESZ)) 104#define nfs4_group_maxsz (1 + XDR_QUADLEN(IDMAP_NAMESZ))
105#ifdef CONFIG_NFS_V4_SECURITY_LABEL
106/* PI(4 bytes) + LFS(4 bytes) + 1(for null terminator?) + MAXLABELLEN */
107#define nfs4_label_maxsz (4 + 4 + 1 + XDR_QUADLEN(NFS4_MAXLABELLEN))
108#define encode_readdir_space 24
109#define encode_readdir_bitmask_sz 3
110#else
111#define nfs4_label_maxsz 0
112#define encode_readdir_space 20
113#define encode_readdir_bitmask_sz 2
114#endif
105/* We support only one layout type per file system */ 115/* We support only one layout type per file system */
106#define decode_mdsthreshold_maxsz (1 + 1 + nfs4_fattr_bitmap_maxsz + 1 + 8) 116#define decode_mdsthreshold_maxsz (1 + 1 + nfs4_fattr_bitmap_maxsz + 1 + 8)
107/* This is based on getfattr, which uses the most attributes: */ 117/* This is based on getfattr, which uses the most attributes: */
108#define nfs4_fattr_value_maxsz (1 + (1 + 2 + 2 + 4 + 2 + 1 + 1 + 2 + 2 + \ 118#define nfs4_fattr_value_maxsz (1 + (1 + 2 + 2 + 4 + 2 + 1 + 1 + 2 + 2 + \
109 3 + 3 + 3 + nfs4_owner_maxsz + \ 119 3 + 3 + 3 + nfs4_owner_maxsz + \
110 nfs4_group_maxsz + decode_mdsthreshold_maxsz)) 120 nfs4_group_maxsz + nfs4_label_maxsz + \
121 decode_mdsthreshold_maxsz))
111#define nfs4_fattr_maxsz (nfs4_fattr_bitmap_maxsz + \ 122#define nfs4_fattr_maxsz (nfs4_fattr_bitmap_maxsz + \
112 nfs4_fattr_value_maxsz) 123 nfs4_fattr_value_maxsz)
113#define decode_getattr_maxsz (op_decode_hdr_maxsz + nfs4_fattr_maxsz) 124#define decode_getattr_maxsz (op_decode_hdr_maxsz + nfs4_fattr_maxsz)
@@ -115,6 +126,7 @@ static int nfs4_stat_to_errno(int);
115 1 + 2 + 1 + \ 126 1 + 2 + 1 + \
116 nfs4_owner_maxsz + \ 127 nfs4_owner_maxsz + \
117 nfs4_group_maxsz + \ 128 nfs4_group_maxsz + \
129 nfs4_label_maxsz + \
118 4 + 4) 130 4 + 4)
119#define encode_savefh_maxsz (op_encode_hdr_maxsz) 131#define encode_savefh_maxsz (op_encode_hdr_maxsz)
120#define decode_savefh_maxsz (op_decode_hdr_maxsz) 132#define decode_savefh_maxsz (op_decode_hdr_maxsz)
@@ -192,9 +204,11 @@ static int nfs4_stat_to_errno(int);
192 encode_stateid_maxsz + 3) 204 encode_stateid_maxsz + 3)
193#define decode_read_maxsz (op_decode_hdr_maxsz + 2) 205#define decode_read_maxsz (op_decode_hdr_maxsz + 2)
194#define encode_readdir_maxsz (op_encode_hdr_maxsz + \ 206#define encode_readdir_maxsz (op_encode_hdr_maxsz + \
195 2 + encode_verifier_maxsz + 5) 207 2 + encode_verifier_maxsz + 5 + \
208 nfs4_label_maxsz)
196#define decode_readdir_maxsz (op_decode_hdr_maxsz + \ 209#define decode_readdir_maxsz (op_decode_hdr_maxsz + \
197 decode_verifier_maxsz) 210 decode_verifier_maxsz + \
211 nfs4_label_maxsz + nfs4_fattr_maxsz)
198#define encode_readlink_maxsz (op_encode_hdr_maxsz) 212#define encode_readlink_maxsz (op_encode_hdr_maxsz)
199#define decode_readlink_maxsz (op_decode_hdr_maxsz + 1) 213#define decode_readlink_maxsz (op_decode_hdr_maxsz + 1)
200#define encode_write_maxsz (op_encode_hdr_maxsz + \ 214#define encode_write_maxsz (op_encode_hdr_maxsz + \
@@ -968,7 +982,9 @@ static void encode_nfs4_verifier(struct xdr_stream *xdr, const nfs4_verifier *ve
968 encode_opaque_fixed(xdr, verf->data, NFS4_VERIFIER_SIZE); 982 encode_opaque_fixed(xdr, verf->data, NFS4_VERIFIER_SIZE);
969} 983}
970 984
971static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const struct nfs_server *server) 985static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap,
986 const struct nfs4_label *label,
987 const struct nfs_server *server)
972{ 988{
973 char owner_name[IDMAP_NAMESZ]; 989 char owner_name[IDMAP_NAMESZ];
974 char owner_group[IDMAP_NAMESZ]; 990 char owner_group[IDMAP_NAMESZ];
@@ -1018,6 +1034,8 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
1018 } 1034 }
1019 len += 4 + (XDR_QUADLEN(owner_grouplen) << 2); 1035 len += 4 + (XDR_QUADLEN(owner_grouplen) << 2);
1020 } 1036 }
1037 if (label)
1038 len += 4 + 4 + 4 + (XDR_QUADLEN(label->len) << 2);
1021 if (iap->ia_valid & ATTR_ATIME_SET) 1039 if (iap->ia_valid & ATTR_ATIME_SET)
1022 len += 16; 1040 len += 16;
1023 else if (iap->ia_valid & ATTR_ATIME) 1041 else if (iap->ia_valid & ATTR_ATIME)
@@ -1072,6 +1090,13 @@ static void encode_attrs(struct xdr_stream *xdr, const struct iattr *iap, const
1072 bmval1 |= FATTR4_WORD1_TIME_MODIFY_SET; 1090 bmval1 |= FATTR4_WORD1_TIME_MODIFY_SET;
1073 *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME); 1091 *p++ = cpu_to_be32(NFS4_SET_TO_SERVER_TIME);
1074 } 1092 }
1093 if (label) {
1094 bmval2 |= FATTR4_WORD2_SECURITY_LABEL;
1095 *p++ = cpu_to_be32(label->lfs);
1096 *p++ = cpu_to_be32(label->pi);
1097 *p++ = cpu_to_be32(label->len);
1098 p = xdr_encode_opaque_fixed(p, label->label, label->len);
1099 }
1075 1100
1076 /* 1101 /*
1077 * Now we backfill the bitmap and the attribute buffer length. 1102 * Now we backfill the bitmap and the attribute buffer length.
@@ -1138,7 +1163,7 @@ static void encode_create(struct xdr_stream *xdr, const struct nfs4_create_arg *
1138 } 1163 }
1139 1164
1140 encode_string(xdr, create->name->len, create->name->name); 1165 encode_string(xdr, create->name->len, create->name->name);
1141 encode_attrs(xdr, create->attrs, create->server); 1166 encode_attrs(xdr, create->attrs, create->label, create->server);
1142} 1167}
1143 1168
1144static void encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap, struct compound_hdr *hdr) 1169static void encode_getattr_one(struct xdr_stream *xdr, uint32_t bitmap, struct compound_hdr *hdr)
@@ -1371,11 +1396,11 @@ static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_op
1371 switch(arg->createmode) { 1396 switch(arg->createmode) {
1372 case NFS4_CREATE_UNCHECKED: 1397 case NFS4_CREATE_UNCHECKED:
1373 *p = cpu_to_be32(NFS4_CREATE_UNCHECKED); 1398 *p = cpu_to_be32(NFS4_CREATE_UNCHECKED);
1374 encode_attrs(xdr, arg->u.attrs, arg->server); 1399 encode_attrs(xdr, arg->u.attrs, arg->label, arg->server);
1375 break; 1400 break;
1376 case NFS4_CREATE_GUARDED: 1401 case NFS4_CREATE_GUARDED:
1377 *p = cpu_to_be32(NFS4_CREATE_GUARDED); 1402 *p = cpu_to_be32(NFS4_CREATE_GUARDED);
1378 encode_attrs(xdr, arg->u.attrs, arg->server); 1403 encode_attrs(xdr, arg->u.attrs, arg->label, arg->server);
1379 break; 1404 break;
1380 case NFS4_CREATE_EXCLUSIVE: 1405 case NFS4_CREATE_EXCLUSIVE:
1381 *p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE); 1406 *p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE);
@@ -1385,7 +1410,7 @@ static inline void encode_createmode(struct xdr_stream *xdr, const struct nfs_op
1385 *p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE4_1); 1410 *p = cpu_to_be32(NFS4_CREATE_EXCLUSIVE4_1);
1386 encode_nfs4_verifier(xdr, &arg->u.verifier); 1411 encode_nfs4_verifier(xdr, &arg->u.verifier);
1387 dummy.ia_valid = 0; 1412 dummy.ia_valid = 0;
1388 encode_attrs(xdr, &dummy, arg->server); 1413 encode_attrs(xdr, &dummy, arg->label, arg->server);
1389 } 1414 }
1390} 1415}
1391 1416
@@ -1536,7 +1561,7 @@ static void encode_read(struct xdr_stream *xdr, const struct nfs_readargs *args,
1536 1561
1537static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req, struct compound_hdr *hdr) 1562static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg *readdir, struct rpc_rqst *req, struct compound_hdr *hdr)
1538{ 1563{
1539 uint32_t attrs[2] = { 1564 uint32_t attrs[3] = {
1540 FATTR4_WORD0_RDATTR_ERROR, 1565 FATTR4_WORD0_RDATTR_ERROR,
1541 FATTR4_WORD1_MOUNTED_ON_FILEID, 1566 FATTR4_WORD1_MOUNTED_ON_FILEID,
1542 }; 1567 };
@@ -1559,20 +1584,26 @@ static void encode_readdir(struct xdr_stream *xdr, const struct nfs4_readdir_arg
1559 encode_op_hdr(xdr, OP_READDIR, decode_readdir_maxsz, hdr); 1584 encode_op_hdr(xdr, OP_READDIR, decode_readdir_maxsz, hdr);
1560 encode_uint64(xdr, readdir->cookie); 1585 encode_uint64(xdr, readdir->cookie);
1561 encode_nfs4_verifier(xdr, &readdir->verifier); 1586 encode_nfs4_verifier(xdr, &readdir->verifier);
1562 p = reserve_space(xdr, 20); 1587 p = reserve_space(xdr, encode_readdir_space);
1563 *p++ = cpu_to_be32(dircount); 1588 *p++ = cpu_to_be32(dircount);
1564 *p++ = cpu_to_be32(readdir->count); 1589 *p++ = cpu_to_be32(readdir->count);
1565 *p++ = cpu_to_be32(2); 1590 *p++ = cpu_to_be32(encode_readdir_bitmask_sz);
1566
1567 *p++ = cpu_to_be32(attrs[0] & readdir->bitmask[0]); 1591 *p++ = cpu_to_be32(attrs[0] & readdir->bitmask[0]);
1568 *p = cpu_to_be32(attrs[1] & readdir->bitmask[1]); 1592 *p = cpu_to_be32(attrs[1] & readdir->bitmask[1]);
1593 if (encode_readdir_bitmask_sz > 2) {
1594 if (hdr->minorversion > 1)
1595 attrs[2] |= FATTR4_WORD2_SECURITY_LABEL;
1596 p++, *p++ = cpu_to_be32(attrs[2] & readdir->bitmask[2]);
1597 }
1569 memcpy(verf, readdir->verifier.data, sizeof(verf)); 1598 memcpy(verf, readdir->verifier.data, sizeof(verf));
1570 dprintk("%s: cookie = %Lu, verifier = %08x:%08x, bitmap = %08x:%08x\n", 1599
1600 dprintk("%s: cookie = %llu, verifier = %08x:%08x, bitmap = %08x:%08x:%08x\n",
1571 __func__, 1601 __func__,
1572 (unsigned long long)readdir->cookie, 1602 (unsigned long long)readdir->cookie,
1573 verf[0], verf[1], 1603 verf[0], verf[1],
1574 attrs[0] & readdir->bitmask[0], 1604 attrs[0] & readdir->bitmask[0],
1575 attrs[1] & readdir->bitmask[1]); 1605 attrs[1] & readdir->bitmask[1],
1606 attrs[2] & readdir->bitmask[2]);
1576} 1607}
1577 1608
1578static void encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req, struct compound_hdr *hdr) 1609static void encode_readlink(struct xdr_stream *xdr, const struct nfs4_readlink *readlink, struct rpc_rqst *req, struct compound_hdr *hdr)
@@ -1631,7 +1662,7 @@ static void encode_setattr(struct xdr_stream *xdr, const struct nfs_setattrargs
1631{ 1662{
1632 encode_op_hdr(xdr, OP_SETATTR, decode_setattr_maxsz, hdr); 1663 encode_op_hdr(xdr, OP_SETATTR, decode_setattr_maxsz, hdr);
1633 encode_nfs4_stateid(xdr, &arg->stateid); 1664 encode_nfs4_stateid(xdr, &arg->stateid);
1634 encode_attrs(xdr, arg->iap, server); 1665 encode_attrs(xdr, arg->iap, arg->label, server);
1635} 1666}
1636 1667
1637static void encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid, struct compound_hdr *hdr) 1668static void encode_setclientid(struct xdr_stream *xdr, const struct nfs4_setclientid *setclientid, struct compound_hdr *hdr)
@@ -4042,6 +4073,56 @@ static int decode_attr_time_delta(struct xdr_stream *xdr, uint32_t *bitmap,
4042 return status; 4073 return status;
4043} 4074}
4044 4075
4076static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
4077 struct nfs4_label *label)
4078{
4079 uint32_t pi = 0;
4080 uint32_t lfs = 0;
4081 __u32 len;
4082 __be32 *p;
4083 int status = 0;
4084
4085 if (unlikely(bitmap[2] & (FATTR4_WORD2_SECURITY_LABEL - 1U)))
4086 return -EIO;
4087 if (likely(bitmap[2] & FATTR4_WORD2_SECURITY_LABEL)) {
4088 p = xdr_inline_decode(xdr, 4);
4089 if (unlikely(!p))
4090 goto out_overflow;
4091 lfs = be32_to_cpup(p++);
4092 p = xdr_inline_decode(xdr, 4);
4093 if (unlikely(!p))
4094 goto out_overflow;
4095 pi = be32_to_cpup(p++);
4096 p = xdr_inline_decode(xdr, 4);
4097 if (unlikely(!p))
4098 goto out_overflow;
4099 len = be32_to_cpup(p++);
4100 p = xdr_inline_decode(xdr, len);
4101 if (unlikely(!p))
4102 goto out_overflow;
4103 if (len < NFS4_MAXLABELLEN) {
4104 if (label) {
4105 memcpy(label->label, p, len);
4106 label->len = len;
4107 label->pi = pi;
4108 label->lfs = lfs;
4109 status = NFS_ATTR_FATTR_V4_SECURITY_LABEL;
4110 }
4111 bitmap[2] &= ~FATTR4_WORD2_SECURITY_LABEL;
4112 } else
4113 printk(KERN_WARNING "%s: label too long (%u)!\n",
4114 __func__, len);
4115 }
4116 if (label && label->label)
4117 dprintk("%s: label=%s, len=%d, PI=%d, LFS=%d\n", __func__,
4118 (char *)label->label, label->len, label->pi, label->lfs);
4119 return status;
4120
4121out_overflow:
4122 print_overflow_msg(__func__, xdr);
4123 return -EIO;
4124}
4125
4045static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, struct timespec *time) 4126static int decode_attr_time_modify(struct xdr_stream *xdr, uint32_t *bitmap, struct timespec *time)
4046{ 4127{
4047 int status = 0; 4128 int status = 0;
@@ -4384,7 +4465,7 @@ out_overflow:
4384 4465
4385static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap, 4466static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap,
4386 struct nfs_fattr *fattr, struct nfs_fh *fh, 4467 struct nfs_fattr *fattr, struct nfs_fh *fh,
4387 struct nfs4_fs_locations *fs_loc, 4468 struct nfs4_fs_locations *fs_loc, struct nfs4_label *label,
4388 const struct nfs_server *server) 4469 const struct nfs_server *server)
4389{ 4470{
4390 int status; 4471 int status;
@@ -4492,6 +4573,13 @@ static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap,
4492 if (status < 0) 4573 if (status < 0)
4493 goto xdr_error; 4574 goto xdr_error;
4494 4575
4576 if (label) {
4577 status = decode_attr_security_label(xdr, bitmap, label);
4578 if (status < 0)
4579 goto xdr_error;
4580 fattr->valid |= status;
4581 }
4582
4495xdr_error: 4583xdr_error:
4496 dprintk("%s: xdr returned %d\n", __func__, -status); 4584 dprintk("%s: xdr returned %d\n", __func__, -status);
4497 return status; 4585 return status;
@@ -4499,7 +4587,7 @@ xdr_error:
4499 4587
4500static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fattr, 4588static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fattr,
4501 struct nfs_fh *fh, struct nfs4_fs_locations *fs_loc, 4589 struct nfs_fh *fh, struct nfs4_fs_locations *fs_loc,
4502 const struct nfs_server *server) 4590 struct nfs4_label *label, const struct nfs_server *server)
4503{ 4591{
4504 unsigned int savep; 4592 unsigned int savep;
4505 uint32_t attrlen, 4593 uint32_t attrlen,
@@ -4518,7 +4606,8 @@ static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fat
4518 if (status < 0) 4606 if (status < 0)
4519 goto xdr_error; 4607 goto xdr_error;
4520 4608
4521 status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, fs_loc, server); 4609 status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, fs_loc,
4610 label, server);
4522 if (status < 0) 4611 if (status < 0)
4523 goto xdr_error; 4612 goto xdr_error;
4524 4613
@@ -4528,10 +4617,16 @@ xdr_error:
4528 return status; 4617 return status;
4529} 4618}
4530 4619
4620static int decode_getfattr_label(struct xdr_stream *xdr, struct nfs_fattr *fattr,
4621 struct nfs4_label *label, const struct nfs_server *server)
4622{
4623 return decode_getfattr_generic(xdr, fattr, NULL, NULL, label, server);
4624}
4625
4531static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, 4626static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr,
4532 const struct nfs_server *server) 4627 const struct nfs_server *server)
4533{ 4628{
4534 return decode_getfattr_generic(xdr, fattr, NULL, NULL, server); 4629 return decode_getfattr_generic(xdr, fattr, NULL, NULL, NULL, server);
4535} 4630}
4536 4631
4537/* 4632/*
@@ -5923,7 +6018,7 @@ static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
5923 status = decode_getfh(xdr, res->fh); 6018 status = decode_getfh(xdr, res->fh);
5924 if (status) 6019 if (status)
5925 goto out; 6020 goto out;
5926 status = decode_getfattr(xdr, res->fattr, res->server); 6021 status = decode_getfattr_label(xdr, res->fattr, res->label, res->server);
5927out: 6022out:
5928 return status; 6023 return status;
5929} 6024}
@@ -5949,7 +6044,8 @@ static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp,
5949 goto out; 6044 goto out;
5950 status = decode_getfh(xdr, res->fh); 6045 status = decode_getfh(xdr, res->fh);
5951 if (status == 0) 6046 if (status == 0)
5952 status = decode_getfattr(xdr, res->fattr, res->server); 6047 status = decode_getfattr_label(xdr, res->fattr,
6048 res->label, res->server);
5953out: 6049out:
5954 return status; 6050 return status;
5955} 6051}
@@ -6040,7 +6136,7 @@ static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
6040 status = decode_restorefh(xdr); 6136 status = decode_restorefh(xdr);
6041 if (status) 6137 if (status)
6042 goto out; 6138 goto out;
6043 decode_getfattr(xdr, res->fattr, res->server); 6139 decode_getfattr_label(xdr, res->fattr, res->label, res->server);
6044out: 6140out:
6045 return status; 6141 return status;
6046} 6142}
@@ -6069,7 +6165,7 @@ static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
6069 status = decode_getfh(xdr, res->fh); 6165 status = decode_getfh(xdr, res->fh);
6070 if (status) 6166 if (status)
6071 goto out; 6167 goto out;
6072 decode_getfattr(xdr, res->fattr, res->server); 6168 decode_getfattr_label(xdr, res->fattr, res->label, res->server);
6073out: 6169out:
6074 return status; 6170 return status;
6075} 6171}
@@ -6101,7 +6197,7 @@ static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
6101 status = decode_putfh(xdr); 6197 status = decode_putfh(xdr);
6102 if (status) 6198 if (status)
6103 goto out; 6199 goto out;
6104 status = decode_getfattr(xdr, res->fattr, res->server); 6200 status = decode_getfattr_label(xdr, res->fattr, res->label, res->server);
6105out: 6201out:
6106 return status; 6202 return status;
6107} 6203}
@@ -6234,7 +6330,7 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
6234 goto out; 6330 goto out;
6235 if (res->access_request) 6331 if (res->access_request)
6236 decode_access(xdr, &res->access_supported, &res->access_result); 6332 decode_access(xdr, &res->access_supported, &res->access_result);
6237 decode_getfattr(xdr, res->f_attr, res->server); 6333 decode_getfattr_label(xdr, res->f_attr, res->f_label, res->server);
6238out: 6334out:
6239 return status; 6335 return status;
6240} 6336}
@@ -6311,7 +6407,7 @@ static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp,
6311 status = decode_setattr(xdr); 6407 status = decode_setattr(xdr);
6312 if (status) 6408 if (status)
6313 goto out; 6409 goto out;
6314 decode_getfattr(xdr, res->fattr, res->server); 6410 decode_getfattr_label(xdr, res->fattr, res->label, res->server);
6315out: 6411out:
6316 return status; 6412 return status;
6317} 6413}
@@ -6700,7 +6796,7 @@ static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req,
6700 xdr_enter_page(xdr, PAGE_SIZE); 6796 xdr_enter_page(xdr, PAGE_SIZE);
6701 status = decode_getfattr_generic(xdr, &res->fs_locations->fattr, 6797 status = decode_getfattr_generic(xdr, &res->fs_locations->fattr,
6702 NULL, res->fs_locations, 6798 NULL, res->fs_locations,
6703 res->fs_locations->server); 6799 NULL, res->fs_locations->server);
6704out: 6800out:
6705 return status; 6801 return status;
6706} 6802}
@@ -7113,7 +7209,7 @@ int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry,
7113 goto out_overflow; 7209 goto out_overflow;
7114 7210
7115 if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh, 7211 if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh,
7116 NULL, entry->server) < 0) 7212 NULL, entry->label, entry->server) < 0)
7117 goto out_overflow; 7213 goto out_overflow;
7118 if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID) 7214 if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID)
7119 entry->ino = entry->fattr->mounted_on_fileid; 7215 entry->ino = entry->fattr->mounted_on_fileid;