summaryrefslogtreecommitdiff
path: root/net/ceph/messenger.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-03-04 22:29:57 -0600
committerSage Weil <sage@inktank.com>2013-05-01 21:16:41 -0700
commitebf18f47093e968105767eed4a0aa155e86b224e (patch)
tree90122481017a894850e46b8c86987bd31548fddc /net/ceph/messenger.c
parent27fa83852ba275361eaa1a1283cf6704fa8191a6 (diff)
ceph: only set message data pointers if non-empty
Change it so we only assign outgoing data information for messages if there is outgoing data to send. This then allows us to add a few more (currently commented-out) assertions. This is related to: http://tracker.ceph.com/issues/4284 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Greg Farnum <greg@inktank.com>
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r--net/ceph/messenger.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index d1183536d5a8..1965d785cf83 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -2692,6 +2692,8 @@ EXPORT_SYMBOL(ceph_con_keepalive);
void ceph_msg_data_set_pages(struct ceph_msg *msg, struct page **pages,
size_t length, size_t alignment)
{
+ /* BUG_ON(!pages); */
+ /* BUG_ON(!length); */
/* BUG_ON(msg->pages); */
/* BUG_ON(msg->page_count); */
@@ -2705,6 +2707,7 @@ void ceph_msg_data_set_pagelist(struct ceph_msg *msg,
struct ceph_pagelist *pagelist)
{
/* BUG_ON(!pagelist); */
+ /* BUG_ON(!pagelist->length); */
/* BUG_ON(msg->pagelist); */
msg->pagelist = pagelist;
@@ -2723,6 +2726,7 @@ EXPORT_SYMBOL(ceph_msg_data_set_bio);
void ceph_msg_data_set_trail(struct ceph_msg *msg, struct ceph_pagelist *trail)
{
/* BUG_ON(!trail); */
+ /* BUG_ON(!trail->length); */
/* BUG_ON(msg->trail); */
msg->trail = trail;