From 8444ff7599862dff3ef82c229f9aa57355e09b26 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 15 Sep 2014 12:37:17 -0700 Subject: [PATCH] 3.10-stable patches added patches: libceph-gracefully-handle-large-reply-messages-from-the-mon.patch libceph-rename-ceph_msg-front_max-to-front_alloc_len.patch --- ...le-large-reply-messages-from-the-mon.patch | 39 ++++++++ ...eph_msg-front_max-to-front_alloc_len.patch | 93 +++++++++++++++++++ queue-3.10/series | 2 + 3 files changed, 134 insertions(+) create mode 100644 queue-3.10/libceph-gracefully-handle-large-reply-messages-from-the-mon.patch create mode 100644 queue-3.10/libceph-rename-ceph_msg-front_max-to-front_alloc_len.patch diff --git a/queue-3.10/libceph-gracefully-handle-large-reply-messages-from-the-mon.patch b/queue-3.10/libceph-gracefully-handle-large-reply-messages-from-the-mon.patch new file mode 100644 index 00000000000..308518b764c --- /dev/null +++ b/queue-3.10/libceph-gracefully-handle-large-reply-messages-from-the-mon.patch @@ -0,0 +1,39 @@ +From 73c3d4812b4c755efeca0140f606f83772a39ce4 Mon Sep 17 00:00:00 2001 +From: Sage Weil +Date: Mon, 4 Aug 2014 07:01:54 -0700 +Subject: libceph: gracefully handle large reply messages from the mon + +From: Sage Weil + +commit 73c3d4812b4c755efeca0140f606f83772a39ce4 upstream. + +We preallocate a few of the message types we get back from the mon. If we +get a larger message than we are expecting, fall back to trying to allocate +a new one instead of blindly using the one we have. + +Signed-off-by: Sage Weil +Reviewed-by: Ilya Dryomov +Signed-off-by: Greg Kroah-Hartman + +--- + net/ceph/mon_client.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/net/ceph/mon_client.c ++++ b/net/ceph/mon_client.c +@@ -1041,7 +1041,15 @@ static struct ceph_msg *mon_alloc_msg(st + if (!m) { + pr_info("alloc_msg unknown type %d\n", type); + *skip = 1; ++ } else if (front_len > m->front_alloc_len) { ++ pr_warning("mon_alloc_msg front %d > prealloc %d (%u#%llu)\n", ++ front_len, m->front_alloc_len, ++ (unsigned int)con->peer_name.type, ++ le64_to_cpu(con->peer_name.num)); ++ ceph_msg_put(m); ++ m = ceph_msg_new(type, front_len, GFP_NOFS, false); + } ++ + return m; + } + diff --git a/queue-3.10/libceph-rename-ceph_msg-front_max-to-front_alloc_len.patch b/queue-3.10/libceph-rename-ceph_msg-front_max-to-front_alloc_len.patch new file mode 100644 index 00000000000..199cff06fd5 --- /dev/null +++ b/queue-3.10/libceph-rename-ceph_msg-front_max-to-front_alloc_len.patch @@ -0,0 +1,93 @@ +From 3cea4c3071d4e55e9d7356efe9d0ebf92f0c2204 Mon Sep 17 00:00:00 2001 +From: Ilya Dryomov +Date: Thu, 9 Jan 2014 20:08:21 +0200 +Subject: libceph: rename ceph_msg::front_max to front_alloc_len + +From: Ilya Dryomov + +commit 3cea4c3071d4e55e9d7356efe9d0ebf92f0c2204 upstream. + +Rename front_max field of struct ceph_msg to front_alloc_len to make +its purpose more clear. + +Signed-off-by: Ilya Dryomov +Reviewed-by: Sage Weil +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/ceph/messenger.h | 2 +- + net/ceph/messenger.c | 6 +++--- + net/ceph/mon_client.c | 8 ++++---- + 3 files changed, 8 insertions(+), 8 deletions(-) + +--- a/include/linux/ceph/messenger.h ++++ b/include/linux/ceph/messenger.h +@@ -157,7 +157,7 @@ struct ceph_msg { + bool front_is_vmalloc; + bool more_to_follow; + bool needs_out_seq; +- int front_max; ++ int front_alloc_len; + unsigned long ack_stamp; /* tx: when we were acked */ + + struct ceph_msgpool *pool; +--- a/net/ceph/messenger.c ++++ b/net/ceph/messenger.c +@@ -3144,7 +3144,7 @@ struct ceph_msg *ceph_msg_new(int type, + INIT_LIST_HEAD(&m->data); + + /* front */ +- m->front_max = front_len; ++ m->front_alloc_len = front_len; + if (front_len) { + if (front_len > PAGE_CACHE_SIZE) { + m->front.iov_base = __vmalloc(front_len, flags, +@@ -3319,8 +3319,8 @@ EXPORT_SYMBOL(ceph_msg_last_put); + + void ceph_msg_dump(struct ceph_msg *msg) + { +- pr_debug("msg_dump %p (front_max %d length %zd)\n", msg, +- msg->front_max, msg->data_length); ++ pr_debug("msg_dump %p (front_alloc_len %d length %zd)\n", msg, ++ msg->front_alloc_len, msg->data_length); + print_hex_dump(KERN_DEBUG, "header: ", + DUMP_PREFIX_OFFSET, 16, 1, + &msg->hdr, sizeof(msg->hdr), true); +--- a/net/ceph/mon_client.c ++++ b/net/ceph/mon_client.c +@@ -152,7 +152,7 @@ static int __open_session(struct ceph_mo + /* initiatiate authentication handshake */ + ret = ceph_auth_build_hello(monc->auth, + monc->m_auth->front.iov_base, +- monc->m_auth->front_max); ++ monc->m_auth->front_alloc_len); + __send_prepared_auth_request(monc, ret); + } else { + dout("open_session mon%d already open\n", monc->cur_mon); +@@ -196,7 +196,7 @@ static void __send_subscribe(struct ceph + int num; + + p = msg->front.iov_base; +- end = p + msg->front_max; ++ end = p + msg->front_alloc_len; + + num = 1 + !!monc->want_next_osdmap + !!monc->want_mdsmap; + ceph_encode_32(&p, num); +@@ -897,7 +897,7 @@ static void handle_auth_reply(struct cep + ret = ceph_handle_auth_reply(monc->auth, msg->front.iov_base, + msg->front.iov_len, + monc->m_auth->front.iov_base, +- monc->m_auth->front_max); ++ monc->m_auth->front_alloc_len); + if (ret < 0) { + monc->client->auth_err = ret; + wake_up_all(&monc->client->auth_wq); +@@ -939,7 +939,7 @@ static int __validate_auth(struct ceph_m + return 0; + + ret = ceph_build_auth(monc->auth, monc->m_auth->front.iov_base, +- monc->m_auth->front_max); ++ monc->m_auth->front_alloc_len); + if (ret <= 0) + return ret; /* either an error, or no need to authenticate */ + __send_prepared_auth_request(monc, ret); diff --git a/queue-3.10/series b/queue-3.10/series index b6a5b98eb60..52bf82b1c79 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -69,3 +69,5 @@ ib-srp-fix-deadlock-between-host-removal-and-multipathd.patch dcache.c-get-rid-of-pointless-macros.patch vfs-fix-bad-hashing-of-dentries.patch tpm-provide-a-generic-means-to-override-the-chip-returned-timeouts.patch +libceph-rename-ceph_msg-front_max-to-front_alloc_len.patch +libceph-gracefully-handle-large-reply-messages-from-the-mon.patch -- 2.47.3