Skip to content

Commit b2dc9a1

Browse files
author
Nagendra Tomar
committed
Reserve additiona space to support 4096 bytes path in symlink
1 parent aa21c12 commit b2dc9a1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

nfs/nfs.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,12 @@ struct rpc_pdu *rpc_nfs3_symlink_task(struct rpc_context *rpc, rpc_cb cb,
823823
{
824824
struct rpc_pdu *pdu;
825825

826-
pdu = rpc_allocate_pdu(rpc, NFS_PROGRAM, NFS_V3, NFS3_SYMLINK, cb, private_data, (zdrproc_t)zdr_SYMLINK3res, sizeof(SYMLINK3res));
826+
/*
827+
* symlink target max length is 4096 bytes and we need space to encode
828+
* symlink attributes too, so we use additional 512 bytes for request
829+
* encoding.
830+
*/
831+
pdu = rpc_allocate_pdu2(rpc, NFS_PROGRAM, NFS_V3, NFS3_SYMLINK, cb, private_data, (zdrproc_t)zdr_SYMLINK3res, sizeof(SYMLINK3res), 512, 0);
827832
if (pdu == NULL) {
828833
rpc_set_error(rpc, "Out of memory. Failed to allocate pdu for NFS3/SYMLINK call");
829834
return NULL;

0 commit comments

Comments
 (0)