Skip to content

Commit

Permalink
libceph: gracefully handle large reply messages from the mon
Browse files Browse the repository at this point in the history
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.

CC: [email protected]
Signed-off-by: Sage Weil <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
  • Loading branch information
liewegas authored and idryomov committed Sep 10, 2014
1 parent 255939e commit 73c3d48
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/ceph/mon_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,15 @@ static struct ceph_msg *mon_alloc_msg(struct ceph_connection *con,
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;
}

Expand Down

0 comments on commit 73c3d48

Please sign in to comment.