From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH] libceph: no outbound zero data
Date: Tue, 12 Mar 2013 20:02:59 -0500 [thread overview]
Message-ID: <513FD043.30707@inktank.com> (raw)
There is handling in write_partial_message_data() for the case where
only the length of--and no other information about--the data to be
sent has been specified. It uses the zero page as the source of
data to send in this case.
This case doesn't occur. All message senders set up a page array,
pagelist, or bio describing the data to be sent. So eliminate the
block of code that handles this (but check and issue a warning for
now, just in case it happens for some reason).
This resolves:
http://tracker.ceph.com/issues/4426
Signed-off-by: Alex Elder <elder@inktank.com>
---
net/ceph/messenger.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c
index 0d54ca4..c3f2fa1 100644
--- a/net/ceph/messenger.c
+++ b/net/ceph/messenger.c
@@ -1506,13 +1506,10 @@ static int write_partial_message_data(struct
ceph_connection *con)
&length, &last_piece);
#endif
} else {
- size_t resid = data_len - msg_pos->data_pos;
-
- page = zero_page;
- page_offset = msg_pos->page_pos;
- length = PAGE_SIZE - page_offset;
- length = min(resid, length);
- last_piece = length == resid;
+ WARN(1, "con %p data_len %u but no outbound data\n",
+ con, data_len);
+ ret = -EINVAL;
+ goto out;
}
if (do_datacrc && !msg_pos->did_page_crc) {
u32 crc = le32_to_cpu(msg->footer.data_crc);
--
1.7.9.5
next reply other threads:[~2013-03-13 1:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-13 1:02 Alex Elder [this message]
2013-03-14 19:49 ` [PATCH] libceph: no outbound zero data Josh Durgin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=513FD043.30707@inktank.com \
--to=elder@inktank.com \
--cc=ceph-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.