]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.16.3/libceph-gracefully-handle-large-reply-messages-from-the-mon.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.16.3 / libceph-gracefully-handle-large-reply-messages-from-the-mon.patch
1 From 73c3d4812b4c755efeca0140f606f83772a39ce4 Mon Sep 17 00:00:00 2001
2 From: Sage Weil <sage@redhat.com>
3 Date: Mon, 4 Aug 2014 07:01:54 -0700
4 Subject: libceph: gracefully handle large reply messages from the mon
5
6 From: Sage Weil <sage@redhat.com>
7
8 commit 73c3d4812b4c755efeca0140f606f83772a39ce4 upstream.
9
10 We preallocate a few of the message types we get back from the mon. If we
11 get a larger message than we are expecting, fall back to trying to allocate
12 a new one instead of blindly using the one we have.
13
14 Signed-off-by: Sage Weil <sage@redhat.com>
15 Reviewed-by: Ilya Dryomov <ilya.dryomov@inktank.com>
16 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17
18 ---
19 net/ceph/mon_client.c | 8 ++++++++
20 1 file changed, 8 insertions(+)
21
22 --- a/net/ceph/mon_client.c
23 +++ b/net/ceph/mon_client.c
24 @@ -1181,7 +1181,15 @@ static struct ceph_msg *mon_alloc_msg(st
25 if (!m) {
26 pr_info("alloc_msg unknown type %d\n", type);
27 *skip = 1;
28 + } else if (front_len > m->front_alloc_len) {
29 + pr_warning("mon_alloc_msg front %d > prealloc %d (%u#%llu)\n",
30 + front_len, m->front_alloc_len,
31 + (unsigned int)con->peer_name.type,
32 + le64_to_cpu(con->peer_name.num));
33 + ceph_msg_put(m);
34 + m = ceph_msg_new(type, front_len, GFP_NOFS, false);
35 }
36 +
37 return m;
38 }
39