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.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index f624b693ce21..2a07755bd347 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -314,12 +314,18 @@ static int nfs_stat_to_errno(int);
314 encode_putfh_maxsz + \ 314 encode_putfh_maxsz + \
315 encode_savefh_maxsz + \ 315 encode_savefh_maxsz + \
316 encode_putfh_maxsz + \ 316 encode_putfh_maxsz + \
317 encode_rename_maxsz) 317 encode_rename_maxsz + \
318 encode_getattr_maxsz + \
319 encode_restorefh_maxsz + \
320 encode_getattr_maxsz)
318#define NFS4_dec_rename_sz (compound_decode_hdr_maxsz + \ 321#define NFS4_dec_rename_sz (compound_decode_hdr_maxsz + \
319 decode_putfh_maxsz + \ 322 decode_putfh_maxsz + \
320 decode_savefh_maxsz + \ 323 decode_savefh_maxsz + \
321 decode_putfh_maxsz + \ 324 decode_putfh_maxsz + \
322 decode_rename_maxsz) 325 decode_rename_maxsz + \
326 decode_getattr_maxsz + \
327 decode_restorefh_maxsz + \
328 decode_getattr_maxsz)
323#define NFS4_enc_link_sz (compound_encode_hdr_maxsz + \ 329#define NFS4_enc_link_sz (compound_encode_hdr_maxsz + \
324 encode_putfh_maxsz + \ 330 encode_putfh_maxsz + \
325 encode_savefh_maxsz + \ 331 encode_savefh_maxsz + \
@@ -1339,7 +1345,7 @@ static int nfs4_xdr_enc_rename(struct rpc_rqst *req, uint32_t *p, const struct n
1339{ 1345{
1340 struct xdr_stream xdr; 1346 struct xdr_stream xdr;
1341 struct compound_hdr hdr = { 1347 struct compound_hdr hdr = {
1342 .nops = 4, 1348 .nops = 7,
1343 }; 1349 };
1344 int status; 1350 int status;
1345 1351
@@ -1351,7 +1357,13 @@ static int nfs4_xdr_enc_rename(struct rpc_rqst *req, uint32_t *p, const struct n
1351 goto out; 1357 goto out;
1352 if ((status = encode_putfh(&xdr, args->new_dir)) != 0) 1358 if ((status = encode_putfh(&xdr, args->new_dir)) != 0)
1353 goto out; 1359 goto out;
1354 status = encode_rename(&xdr, args->old_name, args->new_name); 1360 if ((status = encode_rename(&xdr, args->old_name, args->new_name)) != 0)
1361 goto out;
1362 if ((status = encode_getfattr(&xdr, args->bitmask)) != 0)
1363 goto out;
1364 if ((status = encode_restorefh(&xdr)) != 0)
1365 goto out;
1366 status = encode_getfattr(&xdr, args->bitmask);
1355out: 1367out:
1356 return status; 1368 return status;
1357} 1369}
@@ -3533,7 +3545,14 @@ static int nfs4_xdr_dec_rename(struct rpc_rqst *rqstp, uint32_t *p, struct nfs4_
3533 goto out; 3545 goto out;
3534 if ((status = decode_putfh(&xdr)) != 0) 3546 if ((status = decode_putfh(&xdr)) != 0)
3535 goto out; 3547 goto out;
3536 status = decode_rename(&xdr, &res->old_cinfo, &res->new_cinfo); 3548 if ((status = decode_rename(&xdr, &res->old_cinfo, &res->new_cinfo)) != 0)
3549 goto out;
3550 /* Current FH is target directory */
3551 if (decode_getfattr(&xdr, res->new_fattr, res->server) != 0)
3552 goto out;
3553 if ((status = decode_restorefh(&xdr)) != 0)
3554 goto out;
3555 decode_getfattr(&xdr, res->old_fattr, res->server);
3537out: 3556out:
3538 return status; 3557 return status;
3539} 3558}