diff options
Diffstat (limited to 'fs/nfs/nfs4xdr.c')
| -rw-r--r-- | fs/nfs/nfs4xdr.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index ee4a74db95d0..18fae29b0301 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
| @@ -1198,12 +1198,13 @@ static void encode_getfattr(struct xdr_stream *xdr, const u32* bitmask, struct c | |||
| 1198 | } | 1198 | } |
| 1199 | 1199 | ||
| 1200 | static void encode_getfattr_open(struct xdr_stream *xdr, const u32 *bitmask, | 1200 | static void encode_getfattr_open(struct xdr_stream *xdr, const u32 *bitmask, |
| 1201 | const u32 *open_bitmap, | ||
| 1201 | struct compound_hdr *hdr) | 1202 | struct compound_hdr *hdr) |
| 1202 | { | 1203 | { |
| 1203 | encode_getattr_three(xdr, | 1204 | encode_getattr_three(xdr, |
| 1204 | bitmask[0] & nfs4_fattr_bitmap[0], | 1205 | bitmask[0] & open_bitmap[0], |
| 1205 | bitmask[1] & nfs4_fattr_bitmap[1], | 1206 | bitmask[1] & open_bitmap[1], |
| 1206 | bitmask[2] & FATTR4_WORD2_MDSTHRESHOLD, | 1207 | bitmask[2] & open_bitmap[2], |
| 1207 | hdr); | 1208 | hdr); |
| 1208 | } | 1209 | } |
| 1209 | 1210 | ||
| @@ -2221,7 +2222,7 @@ static void nfs4_xdr_enc_open(struct rpc_rqst *req, struct xdr_stream *xdr, | |||
| 2221 | encode_putfh(xdr, args->fh, &hdr); | 2222 | encode_putfh(xdr, args->fh, &hdr); |
| 2222 | encode_open(xdr, args, &hdr); | 2223 | encode_open(xdr, args, &hdr); |
| 2223 | encode_getfh(xdr, &hdr); | 2224 | encode_getfh(xdr, &hdr); |
| 2224 | encode_getfattr_open(xdr, args->bitmask, &hdr); | 2225 | encode_getfattr_open(xdr, args->bitmask, args->open_bitmap, &hdr); |
| 2225 | encode_nops(&hdr); | 2226 | encode_nops(&hdr); |
| 2226 | } | 2227 | } |
| 2227 | 2228 | ||
| @@ -4359,7 +4360,10 @@ static int decode_attr_mdsthreshold(struct xdr_stream *xdr, | |||
| 4359 | 4360 | ||
| 4360 | if (unlikely(bitmap[2] & (FATTR4_WORD2_MDSTHRESHOLD - 1U))) | 4361 | if (unlikely(bitmap[2] & (FATTR4_WORD2_MDSTHRESHOLD - 1U))) |
| 4361 | return -EIO; | 4362 | return -EIO; |
| 4362 | if (likely(bitmap[2] & FATTR4_WORD2_MDSTHRESHOLD)) { | 4363 | if (bitmap[2] & FATTR4_WORD2_MDSTHRESHOLD) { |
| 4364 | /* Did the server return an unrequested attribute? */ | ||
| 4365 | if (unlikely(res == NULL)) | ||
| 4366 | return -EREMOTEIO; | ||
| 4363 | p = xdr_inline_decode(xdr, 4); | 4367 | p = xdr_inline_decode(xdr, 4); |
| 4364 | if (unlikely(!p)) | 4368 | if (unlikely(!p)) |
| 4365 | goto out_overflow; | 4369 | goto out_overflow; |
| @@ -4372,6 +4376,7 @@ static int decode_attr_mdsthreshold(struct xdr_stream *xdr, | |||
| 4372 | __func__); | 4376 | __func__); |
| 4373 | 4377 | ||
| 4374 | status = decode_first_threshold_item4(xdr, res); | 4378 | status = decode_first_threshold_item4(xdr, res); |
| 4379 | bitmap[2] &= ~FATTR4_WORD2_MDSTHRESHOLD; | ||
| 4375 | } | 4380 | } |
| 4376 | return status; | 4381 | return status; |
| 4377 | out_overflow: | 4382 | out_overflow: |
