diff options
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/messenger.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index e8f236e87f38..1a22975945da 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -38,6 +38,11 @@ static char tag_keepalive = CEPH_MSGR_TAG_KEEPALIVE; | |||
38 | static struct lock_class_key socket_class; | 38 | static struct lock_class_key socket_class; |
39 | #endif | 39 | #endif |
40 | 40 | ||
41 | /* | ||
42 | * When skipping (ignoring) a block of input we read it into a "skip | ||
43 | * buffer," which is this many bytes in size. | ||
44 | */ | ||
45 | #define SKIP_BUF_SIZE 1024 | ||
41 | 46 | ||
42 | static void queue_con(struct ceph_connection *con); | 47 | static void queue_con(struct ceph_connection *con); |
43 | static void con_work(struct work_struct *); | 48 | static void con_work(struct work_struct *); |
@@ -892,8 +897,7 @@ static int write_partial_msg_pages(struct ceph_connection *con) | |||
892 | MSG_DONTWAIT | MSG_NOSIGNAL | | 897 | MSG_DONTWAIT | MSG_NOSIGNAL | |
893 | MSG_MORE); | 898 | MSG_MORE); |
894 | 899 | ||
895 | if (do_crc && | 900 | if (do_crc && kaddr != zero_page_address) |
896 | (msg->pages || msg->pagelist || msg->bio || in_trail)) | ||
897 | kunmap(page); | 901 | kunmap(page); |
898 | 902 | ||
899 | if (ret == -EAGAIN) | 903 | if (ret == -EAGAIN) |
@@ -1982,8 +1986,9 @@ more: | |||
1982 | * | 1986 | * |
1983 | * FIXME: there must be a better way to do this! | 1987 | * FIXME: there must be a better way to do this! |
1984 | */ | 1988 | */ |
1985 | static char buf[1024]; | 1989 | static char buf[SKIP_BUF_SIZE]; |
1986 | int skip = min(1024, -con->in_base_pos); | 1990 | int skip = min((int) sizeof (buf), -con->in_base_pos); |
1991 | |||
1987 | dout("skipping %d / %d bytes\n", skip, -con->in_base_pos); | 1992 | dout("skipping %d / %d bytes\n", skip, -con->in_base_pos); |
1988 | ret = ceph_tcp_recvmsg(con->sock, buf, skip); | 1993 | ret = ceph_tcp_recvmsg(con->sock, buf, skip); |
1989 | if (ret <= 0) | 1994 | if (ret <= 0) |