summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/rds/message.c2
-rw-r--r--net/rds/send.c13
2 files changed, 8 insertions, 7 deletions
diff --git a/net/rds/message.c b/net/rds/message.c
index 4bd9504..f4c3be0 100644
--- a/net/rds/message.c
+++ b/net/rds/message.c
@@ -330,8 +330,6 @@ int rds_message_copy_from_user(struct rds_message *rm, struct iovec *first_iov,
sg++;
}
- rm->data.op_active = 1;
-
out:
return ret;
}
diff --git a/net/rds/send.c b/net/rds/send.c
index 66dc6b0..ad89a63 100644
--- a/net/rds/send.c
+++ b/net/rds/send.c
@@ -970,11 +970,14 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
goto out;
}
- rm->data.op_sg = rds_message_alloc_sgs(rm, ceil(payload_len, PAGE_SIZE));
- /* XXX fix this to not allocate memory */
- ret = rds_message_copy_from_user(rm, msg->msg_iov, payload_len);
- if (ret)
- goto out;
+ /* Attach data to the rm */
+ if (payload_len) {
+ rm->data.op_sg = rds_message_alloc_sgs(rm, ceil(payload_len, PAGE_SIZE));
+ ret = rds_message_copy_from_user(rm, msg->msg_iov, payload_len);
+ if (ret)
+ goto out;
+ }
+ rm->data.op_active = 1;
rm->m_daddr = daddr;
OpenPOWER on IntegriCloud