Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296521
b: refs/heads/master
c: 84495f4
h: refs/heads/master
i:
  296519: 16c4c4f
v: v3
  • Loading branch information
Alex Elder committed Mar 22, 2012
1 parent 999d7bc commit f1272ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f42299e6c3883c69c14079b8c88fe33815b2dcc3
refs/heads/master: 84495f496170a73ed79667b7fbf91947b7f47c87
13 changes: 9 additions & 4 deletions trunk/net/ceph/messenger.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ static char tag_keepalive = CEPH_MSGR_TAG_KEEPALIVE;
static struct lock_class_key socket_class;
#endif

/*
* When skipping (ignoring) a block of input we read it into a "skip
* buffer," which is this many bytes in size.
*/
#define SKIP_BUF_SIZE 1024

static void queue_con(struct ceph_connection *con);
static void con_work(struct work_struct *);
Expand Down Expand Up @@ -892,8 +897,7 @@ static int write_partial_msg_pages(struct ceph_connection *con)
MSG_DONTWAIT | MSG_NOSIGNAL |
MSG_MORE);

if (do_crc &&
(msg->pages || msg->pagelist || msg->bio || in_trail))
if (do_crc && kaddr != zero_page_address)
kunmap(page);

if (ret == -EAGAIN)
Expand Down Expand Up @@ -1982,8 +1986,9 @@ static int try_read(struct ceph_connection *con)
*
* FIXME: there must be a better way to do this!
*/
static char buf[1024];
int skip = min(1024, -con->in_base_pos);
static char buf[SKIP_BUF_SIZE];
int skip = min((int) sizeof (buf), -con->in_base_pos);

dout("skipping %d / %d bytes\n", skip, -con->in_base_pos);
ret = ceph_tcp_recvmsg(con->sock, buf, skip);
if (ret <= 0)
Expand Down

0 comments on commit f1272ee

Please sign in to comment.