diff options
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
-rw-r--r-- | fs/nfs/nfs4xdr.c | 137 |
1 files changed, 70 insertions, 67 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index e6161b213ed..95e92e43840 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -2298,7 +2298,7 @@ static void nfs4_xdr_enc_open(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
2298 | encode_getfh(xdr, &hdr); | 2298 | encode_getfh(xdr, &hdr); |
2299 | encode_getfattr(xdr, args->bitmask, &hdr); | 2299 | encode_getfattr(xdr, args->bitmask, &hdr); |
2300 | encode_restorefh(xdr, &hdr); | 2300 | encode_restorefh(xdr, &hdr); |
2301 | encode_getfattr(xdr, args->bitmask, &hdr); | 2301 | encode_getfattr(xdr, args->dir_bitmask, &hdr); |
2302 | encode_nops(&hdr); | 2302 | encode_nops(&hdr); |
2303 | } | 2303 | } |
2304 | 2304 | ||
@@ -2517,11 +2517,13 @@ static void nfs4_xdr_enc_getacl(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
2517 | encode_compound_hdr(xdr, req, &hdr); | 2517 | encode_compound_hdr(xdr, req, &hdr); |
2518 | encode_sequence(xdr, &args->seq_args, &hdr); | 2518 | encode_sequence(xdr, &args->seq_args, &hdr); |
2519 | encode_putfh(xdr, args->fh, &hdr); | 2519 | encode_putfh(xdr, args->fh, &hdr); |
2520 | replen = hdr.replen + op_decode_hdr_maxsz + nfs4_fattr_bitmap_maxsz + 1; | 2520 | replen = hdr.replen + op_decode_hdr_maxsz + 1; |
2521 | encode_getattr_two(xdr, FATTR4_WORD0_ACL, 0, &hdr); | 2521 | encode_getattr_two(xdr, FATTR4_WORD0_ACL, 0, &hdr); |
2522 | 2522 | ||
2523 | xdr_inline_pages(&req->rq_rcv_buf, replen << 2, | 2523 | xdr_inline_pages(&req->rq_rcv_buf, replen << 2, |
2524 | args->acl_pages, args->acl_pgbase, args->acl_len); | 2524 | args->acl_pages, args->acl_pgbase, args->acl_len); |
2525 | xdr_set_scratch_buffer(xdr, page_address(args->acl_scratch), PAGE_SIZE); | ||
2526 | |||
2525 | encode_nops(&hdr); | 2527 | encode_nops(&hdr); |
2526 | } | 2528 | } |
2527 | 2529 | ||
@@ -3790,7 +3792,8 @@ out_overflow: | |||
3790 | } | 3792 | } |
3791 | 3793 | ||
3792 | static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, | 3794 | static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, |
3793 | const struct nfs_server *server, uint32_t *uid, int may_sleep) | 3795 | const struct nfs_server *server, uint32_t *uid, |
3796 | struct nfs4_string *owner_name) | ||
3794 | { | 3797 | { |
3795 | uint32_t len; | 3798 | uint32_t len; |
3796 | __be32 *p; | 3799 | __be32 *p; |
@@ -3807,8 +3810,12 @@ static int decode_attr_owner(struct xdr_stream *xdr, uint32_t *bitmap, | |||
3807 | p = xdr_inline_decode(xdr, len); | 3810 | p = xdr_inline_decode(xdr, len); |
3808 | if (unlikely(!p)) | 3811 | if (unlikely(!p)) |
3809 | goto out_overflow; | 3812 | goto out_overflow; |
3810 | if (!may_sleep) { | 3813 | if (owner_name != NULL) { |
3811 | /* do nothing */ | 3814 | owner_name->data = kmemdup(p, len, GFP_NOWAIT); |
3815 | if (owner_name->data != NULL) { | ||
3816 | owner_name->len = len; | ||
3817 | ret = NFS_ATTR_FATTR_OWNER_NAME; | ||
3818 | } | ||
3812 | } else if (len < XDR_MAX_NETOBJ) { | 3819 | } else if (len < XDR_MAX_NETOBJ) { |
3813 | if (nfs_map_name_to_uid(server, (char *)p, len, uid) == 0) | 3820 | if (nfs_map_name_to_uid(server, (char *)p, len, uid) == 0) |
3814 | ret = NFS_ATTR_FATTR_OWNER; | 3821 | ret = NFS_ATTR_FATTR_OWNER; |
@@ -3828,7 +3835,8 @@ out_overflow: | |||
3828 | } | 3835 | } |
3829 | 3836 | ||
3830 | static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, | 3837 | static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, |
3831 | const struct nfs_server *server, uint32_t *gid, int may_sleep) | 3838 | const struct nfs_server *server, uint32_t *gid, |
3839 | struct nfs4_string *group_name) | ||
3832 | { | 3840 | { |
3833 | uint32_t len; | 3841 | uint32_t len; |
3834 | __be32 *p; | 3842 | __be32 *p; |
@@ -3845,8 +3853,12 @@ static int decode_attr_group(struct xdr_stream *xdr, uint32_t *bitmap, | |||
3845 | p = xdr_inline_decode(xdr, len); | 3853 | p = xdr_inline_decode(xdr, len); |
3846 | if (unlikely(!p)) | 3854 | if (unlikely(!p)) |
3847 | goto out_overflow; | 3855 | goto out_overflow; |
3848 | if (!may_sleep) { | 3856 | if (group_name != NULL) { |
3849 | /* do nothing */ | 3857 | group_name->data = kmemdup(p, len, GFP_NOWAIT); |
3858 | if (group_name->data != NULL) { | ||
3859 | group_name->len = len; | ||
3860 | ret = NFS_ATTR_FATTR_GROUP_NAME; | ||
3861 | } | ||
3850 | } else if (len < XDR_MAX_NETOBJ) { | 3862 | } else if (len < XDR_MAX_NETOBJ) { |
3851 | if (nfs_map_group_to_gid(server, (char *)p, len, gid) == 0) | 3863 | if (nfs_map_group_to_gid(server, (char *)p, len, gid) == 0) |
3852 | ret = NFS_ATTR_FATTR_GROUP; | 3864 | ret = NFS_ATTR_FATTR_GROUP; |
@@ -4283,7 +4295,7 @@ xdr_error: | |||
4283 | 4295 | ||
4284 | static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap, | 4296 | static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap, |
4285 | struct nfs_fattr *fattr, struct nfs_fh *fh, | 4297 | struct nfs_fattr *fattr, struct nfs_fh *fh, |
4286 | const struct nfs_server *server, int may_sleep) | 4298 | const struct nfs_server *server) |
4287 | { | 4299 | { |
4288 | int status; | 4300 | int status; |
4289 | umode_t fmode = 0; | 4301 | umode_t fmode = 0; |
@@ -4350,12 +4362,12 @@ static int decode_getfattr_attrs(struct xdr_stream *xdr, uint32_t *bitmap, | |||
4350 | goto xdr_error; | 4362 | goto xdr_error; |
4351 | fattr->valid |= status; | 4363 | fattr->valid |= status; |
4352 | 4364 | ||
4353 | status = decode_attr_owner(xdr, bitmap, server, &fattr->uid, may_sleep); | 4365 | status = decode_attr_owner(xdr, bitmap, server, &fattr->uid, fattr->owner_name); |
4354 | if (status < 0) | 4366 | if (status < 0) |
4355 | goto xdr_error; | 4367 | goto xdr_error; |
4356 | fattr->valid |= status; | 4368 | fattr->valid |= status; |
4357 | 4369 | ||
4358 | status = decode_attr_group(xdr, bitmap, server, &fattr->gid, may_sleep); | 4370 | status = decode_attr_group(xdr, bitmap, server, &fattr->gid, fattr->group_name); |
4359 | if (status < 0) | 4371 | if (status < 0) |
4360 | goto xdr_error; | 4372 | goto xdr_error; |
4361 | fattr->valid |= status; | 4373 | fattr->valid |= status; |
@@ -4396,7 +4408,7 @@ xdr_error: | |||
4396 | } | 4408 | } |
4397 | 4409 | ||
4398 | static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fattr, | 4410 | static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fattr, |
4399 | struct nfs_fh *fh, const struct nfs_server *server, int may_sleep) | 4411 | struct nfs_fh *fh, const struct nfs_server *server) |
4400 | { | 4412 | { |
4401 | __be32 *savep; | 4413 | __be32 *savep; |
4402 | uint32_t attrlen, | 4414 | uint32_t attrlen, |
@@ -4415,7 +4427,7 @@ static int decode_getfattr_generic(struct xdr_stream *xdr, struct nfs_fattr *fat | |||
4415 | if (status < 0) | 4427 | if (status < 0) |
4416 | goto xdr_error; | 4428 | goto xdr_error; |
4417 | 4429 | ||
4418 | status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, server, may_sleep); | 4430 | status = decode_getfattr_attrs(xdr, bitmap, fattr, fh, server); |
4419 | if (status < 0) | 4431 | if (status < 0) |
4420 | goto xdr_error; | 4432 | goto xdr_error; |
4421 | 4433 | ||
@@ -4426,9 +4438,9 @@ xdr_error: | |||
4426 | } | 4438 | } |
4427 | 4439 | ||
4428 | static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, | 4440 | static int decode_getfattr(struct xdr_stream *xdr, struct nfs_fattr *fattr, |
4429 | const struct nfs_server *server, int may_sleep) | 4441 | const struct nfs_server *server) |
4430 | { | 4442 | { |
4431 | return decode_getfattr_generic(xdr, fattr, NULL, server, may_sleep); | 4443 | return decode_getfattr_generic(xdr, fattr, NULL, server); |
4432 | } | 4444 | } |
4433 | 4445 | ||
4434 | /* | 4446 | /* |
@@ -4957,17 +4969,18 @@ decode_restorefh(struct xdr_stream *xdr) | |||
4957 | } | 4969 | } |
4958 | 4970 | ||
4959 | static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, | 4971 | static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, |
4960 | size_t *acl_len) | 4972 | struct nfs_getaclres *res) |
4961 | { | 4973 | { |
4962 | __be32 *savep; | 4974 | __be32 *savep, *bm_p; |
4963 | uint32_t attrlen, | 4975 | uint32_t attrlen, |
4964 | bitmap[3] = {0}; | 4976 | bitmap[3] = {0}; |
4965 | struct kvec *iov = req->rq_rcv_buf.head; | 4977 | struct kvec *iov = req->rq_rcv_buf.head; |
4966 | int status; | 4978 | int status; |
4967 | 4979 | ||
4968 | *acl_len = 0; | 4980 | res->acl_len = 0; |
4969 | if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0) | 4981 | if ((status = decode_op_hdr(xdr, OP_GETATTR)) != 0) |
4970 | goto out; | 4982 | goto out; |
4983 | bm_p = xdr->p; | ||
4971 | if ((status = decode_attr_bitmap(xdr, bitmap)) != 0) | 4984 | if ((status = decode_attr_bitmap(xdr, bitmap)) != 0) |
4972 | goto out; | 4985 | goto out; |
4973 | if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0) | 4986 | if ((status = decode_attr_length(xdr, &attrlen, &savep)) != 0) |
@@ -4979,18 +4992,30 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req, | |||
4979 | size_t hdrlen; | 4992 | size_t hdrlen; |
4980 | u32 recvd; | 4993 | u32 recvd; |
4981 | 4994 | ||
4995 | /* The bitmap (xdr len + bitmaps) and the attr xdr len words | ||
4996 | * are stored with the acl data to handle the problem of | ||
4997 | * variable length bitmaps.*/ | ||
4998 | xdr->p = bm_p; | ||
4999 | res->acl_data_offset = be32_to_cpup(bm_p) + 2; | ||
5000 | res->acl_data_offset <<= 2; | ||
5001 | |||
4982 | /* We ignore &savep and don't do consistency checks on | 5002 | /* We ignore &savep and don't do consistency checks on |
4983 | * the attr length. Let userspace figure it out.... */ | 5003 | * the attr length. Let userspace figure it out.... */ |
4984 | hdrlen = (u8 *)xdr->p - (u8 *)iov->iov_base; | 5004 | hdrlen = (u8 *)xdr->p - (u8 *)iov->iov_base; |
5005 | attrlen += res->acl_data_offset; | ||
4985 | recvd = req->rq_rcv_buf.len - hdrlen; | 5006 | recvd = req->rq_rcv_buf.len - hdrlen; |
4986 | if (attrlen > recvd) { | 5007 | if (attrlen > recvd) { |
4987 | dprintk("NFS: server cheating in getattr" | 5008 | if (res->acl_flags & NFS4_ACL_LEN_REQUEST) { |
4988 | " acl reply: attrlen %u > recvd %u\n", | 5009 | /* getxattr interface called with a NULL buf */ |
5010 | res->acl_len = attrlen; | ||
5011 | goto out; | ||
5012 | } | ||
5013 | dprintk("NFS: acl reply: attrlen %u > recvd %u\n", | ||
4989 | attrlen, recvd); | 5014 | attrlen, recvd); |
4990 | return -EINVAL; | 5015 | return -EINVAL; |
4991 | } | 5016 | } |
4992 | xdr_read_pages(xdr, attrlen); | 5017 | xdr_read_pages(xdr, attrlen); |
4993 | *acl_len = attrlen; | 5018 | res->acl_len = attrlen; |
4994 | } else | 5019 | } else |
4995 | status = -EOPNOTSUPP; | 5020 | status = -EOPNOTSUPP; |
4996 | 5021 | ||
@@ -5696,8 +5721,7 @@ static int nfs4_xdr_dec_open_downgrade(struct rpc_rqst *rqstp, | |||
5696 | status = decode_open_downgrade(xdr, res); | 5721 | status = decode_open_downgrade(xdr, res); |
5697 | if (status != 0) | 5722 | if (status != 0) |
5698 | goto out; | 5723 | goto out; |
5699 | decode_getfattr(xdr, res->fattr, res->server, | 5724 | decode_getfattr(xdr, res->fattr, res->server); |
5700 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5701 | out: | 5725 | out: |
5702 | return status; | 5726 | return status; |
5703 | } | 5727 | } |
@@ -5723,8 +5747,7 @@ static int nfs4_xdr_dec_access(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5723 | status = decode_access(xdr, res); | 5747 | status = decode_access(xdr, res); |
5724 | if (status != 0) | 5748 | if (status != 0) |
5725 | goto out; | 5749 | goto out; |
5726 | decode_getfattr(xdr, res->fattr, res->server, | 5750 | decode_getfattr(xdr, res->fattr, res->server); |
5727 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5728 | out: | 5751 | out: |
5729 | return status; | 5752 | return status; |
5730 | } | 5753 | } |
@@ -5753,8 +5776,7 @@ static int nfs4_xdr_dec_lookup(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5753 | status = decode_getfh(xdr, res->fh); | 5776 | status = decode_getfh(xdr, res->fh); |
5754 | if (status) | 5777 | if (status) |
5755 | goto out; | 5778 | goto out; |
5756 | status = decode_getfattr(xdr, res->fattr, res->server | 5779 | status = decode_getfattr(xdr, res->fattr, res->server); |
5757 | ,!RPC_IS_ASYNC(rqstp->rq_task)); | ||
5758 | out: | 5780 | out: |
5759 | return status; | 5781 | return status; |
5760 | } | 5782 | } |
@@ -5780,8 +5802,7 @@ static int nfs4_xdr_dec_lookup_root(struct rpc_rqst *rqstp, | |||
5780 | goto out; | 5802 | goto out; |
5781 | status = decode_getfh(xdr, res->fh); | 5803 | status = decode_getfh(xdr, res->fh); |
5782 | if (status == 0) | 5804 | if (status == 0) |
5783 | status = decode_getfattr(xdr, res->fattr, res->server, | 5805 | status = decode_getfattr(xdr, res->fattr, res->server); |
5784 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5785 | out: | 5806 | out: |
5786 | return status; | 5807 | return status; |
5787 | } | 5808 | } |
@@ -5807,8 +5828,7 @@ static int nfs4_xdr_dec_remove(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5807 | status = decode_remove(xdr, &res->cinfo); | 5828 | status = decode_remove(xdr, &res->cinfo); |
5808 | if (status) | 5829 | if (status) |
5809 | goto out; | 5830 | goto out; |
5810 | decode_getfattr(xdr, res->dir_attr, res->server, | 5831 | decode_getfattr(xdr, res->dir_attr, res->server); |
5811 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5812 | out: | 5832 | out: |
5813 | return status; | 5833 | return status; |
5814 | } | 5834 | } |
@@ -5841,14 +5861,12 @@ static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5841 | if (status) | 5861 | if (status) |
5842 | goto out; | 5862 | goto out; |
5843 | /* Current FH is target directory */ | 5863 | /* Current FH is target directory */ |
5844 | if (decode_getfattr(xdr, res->new_fattr, res->server, | 5864 | if (decode_getfattr(xdr, res->new_fattr, res->server)) |
5845 | !RPC_IS_ASYNC(rqstp->rq_task)) != 0) | ||
5846 | goto out; | 5865 | goto out; |
5847 | status = decode_restorefh(xdr); | 5866 | status = decode_restorefh(xdr); |
5848 | if (status) | 5867 | if (status) |
5849 | goto out; | 5868 | goto out; |
5850 | decode_getfattr(xdr, res->old_fattr, res->server, | 5869 | decode_getfattr(xdr, res->old_fattr, res->server); |
5851 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5852 | out: | 5870 | out: |
5853 | return status; | 5871 | return status; |
5854 | } | 5872 | } |
@@ -5884,14 +5902,12 @@ static int nfs4_xdr_dec_link(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5884 | * Note order: OP_LINK leaves the directory as the current | 5902 | * Note order: OP_LINK leaves the directory as the current |
5885 | * filehandle. | 5903 | * filehandle. |
5886 | */ | 5904 | */ |
5887 | if (decode_getfattr(xdr, res->dir_attr, res->server, | 5905 | if (decode_getfattr(xdr, res->dir_attr, res->server)) |
5888 | !RPC_IS_ASYNC(rqstp->rq_task)) != 0) | ||
5889 | goto out; | 5906 | goto out; |
5890 | status = decode_restorefh(xdr); | 5907 | status = decode_restorefh(xdr); |
5891 | if (status) | 5908 | if (status) |
5892 | goto out; | 5909 | goto out; |
5893 | decode_getfattr(xdr, res->fattr, res->server, | 5910 | decode_getfattr(xdr, res->fattr, res->server); |
5894 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5895 | out: | 5911 | out: |
5896 | return status; | 5912 | return status; |
5897 | } | 5913 | } |
@@ -5923,14 +5939,12 @@ static int nfs4_xdr_dec_create(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5923 | status = decode_getfh(xdr, res->fh); | 5939 | status = decode_getfh(xdr, res->fh); |
5924 | if (status) | 5940 | if (status) |
5925 | goto out; | 5941 | goto out; |
5926 | if (decode_getfattr(xdr, res->fattr, res->server, | 5942 | if (decode_getfattr(xdr, res->fattr, res->server)) |
5927 | !RPC_IS_ASYNC(rqstp->rq_task)) != 0) | ||
5928 | goto out; | 5943 | goto out; |
5929 | status = decode_restorefh(xdr); | 5944 | status = decode_restorefh(xdr); |
5930 | if (status) | 5945 | if (status) |
5931 | goto out; | 5946 | goto out; |
5932 | decode_getfattr(xdr, res->dir_fattr, res->server, | 5947 | decode_getfattr(xdr, res->dir_fattr, res->server); |
5933 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5934 | out: | 5948 | out: |
5935 | return status; | 5949 | return status; |
5936 | } | 5950 | } |
@@ -5962,8 +5976,7 @@ static int nfs4_xdr_dec_getattr(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
5962 | status = decode_putfh(xdr); | 5976 | status = decode_putfh(xdr); |
5963 | if (status) | 5977 | if (status) |
5964 | goto out; | 5978 | goto out; |
5965 | status = decode_getfattr(xdr, res->fattr, res->server, | 5979 | status = decode_getfattr(xdr, res->fattr, res->server); |
5966 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
5967 | out: | 5980 | out: |
5968 | return status; | 5981 | return status; |
5969 | } | 5982 | } |
@@ -6028,7 +6041,7 @@ nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6028 | status = decode_putfh(xdr); | 6041 | status = decode_putfh(xdr); |
6029 | if (status) | 6042 | if (status) |
6030 | goto out; | 6043 | goto out; |
6031 | status = decode_getacl(xdr, rqstp, &res->acl_len); | 6044 | status = decode_getacl(xdr, rqstp, res); |
6032 | 6045 | ||
6033 | out: | 6046 | out: |
6034 | return status; | 6047 | return status; |
@@ -6061,8 +6074,7 @@ static int nfs4_xdr_dec_close(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6061 | * an ESTALE error. Shouldn't be a problem, | 6074 | * an ESTALE error. Shouldn't be a problem, |
6062 | * though, since fattr->valid will remain unset. | 6075 | * though, since fattr->valid will remain unset. |
6063 | */ | 6076 | */ |
6064 | decode_getfattr(xdr, res->fattr, res->server, | 6077 | decode_getfattr(xdr, res->fattr, res->server); |
6065 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6066 | out: | 6078 | out: |
6067 | return status; | 6079 | return status; |
6068 | } | 6080 | } |
@@ -6093,13 +6105,11 @@ static int nfs4_xdr_dec_open(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6093 | goto out; | 6105 | goto out; |
6094 | if (decode_getfh(xdr, &res->fh) != 0) | 6106 | if (decode_getfh(xdr, &res->fh) != 0) |
6095 | goto out; | 6107 | goto out; |
6096 | if (decode_getfattr(xdr, res->f_attr, res->server, | 6108 | if (decode_getfattr(xdr, res->f_attr, res->server) != 0) |
6097 | !RPC_IS_ASYNC(rqstp->rq_task)) != 0) | ||
6098 | goto out; | 6109 | goto out; |
6099 | if (decode_restorefh(xdr) != 0) | 6110 | if (decode_restorefh(xdr) != 0) |
6100 | goto out; | 6111 | goto out; |
6101 | decode_getfattr(xdr, res->dir_attr, res->server, | 6112 | decode_getfattr(xdr, res->dir_attr, res->server); |
6102 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6103 | out: | 6113 | out: |
6104 | return status; | 6114 | return status; |
6105 | } | 6115 | } |
@@ -6147,8 +6157,7 @@ static int nfs4_xdr_dec_open_noattr(struct rpc_rqst *rqstp, | |||
6147 | status = decode_open(xdr, res); | 6157 | status = decode_open(xdr, res); |
6148 | if (status) | 6158 | if (status) |
6149 | goto out; | 6159 | goto out; |
6150 | decode_getfattr(xdr, res->f_attr, res->server, | 6160 | decode_getfattr(xdr, res->f_attr, res->server); |
6151 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6152 | out: | 6161 | out: |
6153 | return status; | 6162 | return status; |
6154 | } | 6163 | } |
@@ -6175,8 +6184,7 @@ static int nfs4_xdr_dec_setattr(struct rpc_rqst *rqstp, | |||
6175 | status = decode_setattr(xdr); | 6184 | status = decode_setattr(xdr); |
6176 | if (status) | 6185 | if (status) |
6177 | goto out; | 6186 | goto out; |
6178 | decode_getfattr(xdr, res->fattr, res->server, | 6187 | decode_getfattr(xdr, res->fattr, res->server); |
6179 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6180 | out: | 6188 | out: |
6181 | return status; | 6189 | return status; |
6182 | } | 6190 | } |
@@ -6356,8 +6364,7 @@ static int nfs4_xdr_dec_write(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6356 | if (status) | 6364 | if (status) |
6357 | goto out; | 6365 | goto out; |
6358 | if (res->fattr) | 6366 | if (res->fattr) |
6359 | decode_getfattr(xdr, res->fattr, res->server, | 6367 | decode_getfattr(xdr, res->fattr, res->server); |
6360 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6361 | if (!status) | 6368 | if (!status) |
6362 | status = res->count; | 6369 | status = res->count; |
6363 | out: | 6370 | out: |
@@ -6386,8 +6393,7 @@ static int nfs4_xdr_dec_commit(struct rpc_rqst *rqstp, struct xdr_stream *xdr, | |||
6386 | if (status) | 6393 | if (status) |
6387 | goto out; | 6394 | goto out; |
6388 | if (res->fattr) | 6395 | if (res->fattr) |
6389 | decode_getfattr(xdr, res->fattr, res->server, | 6396 | decode_getfattr(xdr, res->fattr, res->server); |
6390 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6391 | out: | 6397 | out: |
6392 | return status; | 6398 | return status; |
6393 | } | 6399 | } |
@@ -6546,8 +6552,7 @@ static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, | |||
6546 | status = decode_delegreturn(xdr); | 6552 | status = decode_delegreturn(xdr); |
6547 | if (status != 0) | 6553 | if (status != 0) |
6548 | goto out; | 6554 | goto out; |
6549 | decode_getfattr(xdr, res->fattr, res->server, | 6555 | decode_getfattr(xdr, res->fattr, res->server); |
6550 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6551 | out: | 6556 | out: |
6552 | return status; | 6557 | return status; |
6553 | } | 6558 | } |
@@ -6576,8 +6581,7 @@ static int nfs4_xdr_dec_fs_locations(struct rpc_rqst *req, | |||
6576 | goto out; | 6581 | goto out; |
6577 | xdr_enter_page(xdr, PAGE_SIZE); | 6582 | xdr_enter_page(xdr, PAGE_SIZE); |
6578 | status = decode_getfattr(xdr, &res->fs_locations->fattr, | 6583 | status = decode_getfattr(xdr, &res->fs_locations->fattr, |
6579 | res->fs_locations->server, | 6584 | res->fs_locations->server); |
6580 | !RPC_IS_ASYNC(req->rq_task)); | ||
6581 | out: | 6585 | out: |
6582 | return status; | 6586 | return status; |
6583 | } | 6587 | } |
@@ -6826,8 +6830,7 @@ static int nfs4_xdr_dec_layoutcommit(struct rpc_rqst *rqstp, | |||
6826 | status = decode_layoutcommit(xdr, rqstp, res); | 6830 | status = decode_layoutcommit(xdr, rqstp, res); |
6827 | if (status) | 6831 | if (status) |
6828 | goto out; | 6832 | goto out; |
6829 | decode_getfattr(xdr, res->fattr, res->server, | 6833 | decode_getfattr(xdr, res->fattr, res->server); |
6830 | !RPC_IS_ASYNC(rqstp->rq_task)); | ||
6831 | out: | 6834 | out: |
6832 | return status; | 6835 | return status; |
6833 | } | 6836 | } |
@@ -6958,7 +6961,7 @@ int nfs4_decode_dirent(struct xdr_stream *xdr, struct nfs_entry *entry, | |||
6958 | goto out_overflow; | 6961 | goto out_overflow; |
6959 | 6962 | ||
6960 | if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh, | 6963 | if (decode_getfattr_attrs(xdr, bitmap, entry->fattr, entry->fh, |
6961 | entry->server, 1) < 0) | 6964 | entry->server) < 0) |
6962 | goto out_overflow; | 6965 | goto out_overflow; |
6963 | if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID) | 6966 | if (entry->fattr->valid & NFS_ATTR_FATTR_MOUNTED_ON_FILEID) |
6964 | entry->ino = entry->fattr->mounted_on_fileid; | 6967 | entry->ino = entry->fattr->mounted_on_fileid; |