diff options
author | Andy Grover <andy.grover@oracle.com> | 2010-02-04 06:40:32 +0300 |
---|---|---|
committer | Andy Grover <andy.grover@oracle.com> | 2010-09-09 05:12:02 +0400 |
commit | 372cd7dedfd1ea93a9ae8d9c282e910dc1b76773 (patch) | |
tree | 248c672e0fd7fdb8015c51d02a0e74df8d9feef9 /net/rds/send.c | |
parent | 5b2366bd2835919e2e6a836e837eab4a9274bd46 (diff) | |
download | linux-372cd7dedfd1ea93a9ae8d9c282e910dc1b76773.tar.xz |
RDS: Do not set op_active in r_m_copy_from_user().
Do not allocate sgs for data for 0-length datagrams
Set data.op_active in rds_sendmsg() instead of
rds_message_copy_from_user().
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Diffstat (limited to 'net/rds/send.c')
-rw-r--r-- | net/rds/send.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/rds/send.c b/net/rds/send.c index 66dc6b045261..ad89a63c4304 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; |