projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5b2366b
)
RDS: Do not set op_active in r_m_copy_from_user().
author
Andy Grover
<
[email protected]
>
Thu, 4 Feb 2010 03:40:32 +0000
(19:40 -0800)
committer
Andy Grover
<
[email protected]
>
Thu, 9 Sep 2010 01:12:02 +0000
(18:12 -0700)
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 <
[email protected]
>
net/rds/message.c
patch
|
blob
|
history
net/rds/send.c
patch
|
blob
|
history
diff --git
a/net/rds/message.c
b/net/rds/message.c
index 4bd9504ca048762884d4be662fdf675cc6d21565..f4c3be0878e97226d1b2d28d8504f8374274d169 100644
(file)
--- 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 66dc6b04526165c040b718a468762ed0885c872c..ad89a63c430480277359acaef2c7d7b2fb6cf68d 100644
(file)
--- 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;