libceph: define CEPH_MSG_MAX_MIDDLE_LEN
authorAlex Elder <elder@inktank.com>
Sat, 9 Mar 2013 00:51:03 +0000 (18:51 -0600)
committerSage Weil <sage@inktank.com>
Thu, 2 May 2013 04:16:29 +0000 (21:16 -0700)
This is probably unnecessary but the code read as if it were wrong
in read_partial_message().

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
include/linux/ceph/libceph.h
net/ceph/messenger.c

index 29818fc..5493d7b 100644 (file)
@@ -66,6 +66,7 @@ struct ceph_options {
 #define CEPH_OSD_IDLE_TTL_DEFAULT    60
 
 #define CEPH_MSG_MAX_FRONT_LEN (16*1024*1024)
+#define CEPH_MSG_MAX_MIDDLE_LEN        (16*1024*1024)
 #define CEPH_MSG_MAX_DATA_LEN  (16*1024*1024)
 
 #define CEPH_AUTH_NAME_DEFAULT   "guest"
index af0c35d..b8d0da5 100644 (file)
@@ -1887,7 +1887,7 @@ static int read_partial_message(struct ceph_connection *con)
        if (front_len > CEPH_MSG_MAX_FRONT_LEN)
                return -EIO;
        middle_len = le32_to_cpu(con->in_hdr.middle_len);
-       if (middle_len > CEPH_MSG_MAX_DATA_LEN)
+       if (middle_len > CEPH_MSG_MAX_MIDDLE_LEN)
                return -EIO;
        data_len = le32_to_cpu(con->in_hdr.data_len);
        if (data_len > CEPH_MSG_MAX_DATA_LEN)