libceph: enable fallback to ceph_msg_new() in ceph_msgpool_get()
authorIlya Dryomov <idryomov@gmail.com>
Thu, 11 Oct 2018 15:04:33 +0000 (17:04 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 22 Oct 2018 08:28:22 +0000 (10:28 +0200)
commit3b83f60da6dd1becd865c1e2745123a8ae378c25
tree3906ff65facb39ea2580025329a795890b526c9b
parent61d2f855042cfcce9b78fa10fe7cd2020598263b
libceph: enable fallback to ceph_msg_new() in ceph_msgpool_get()

ceph_msgpool_get() can fall back to ceph_msg_new() when it is asked for
a message whose front portion is larger than pool->front_len.  However
the caller always passes 0, effectively disabling that code path.  The
allocation goes to the message pool and returns a message with a front
that is smaller than requested, setting us up for a crash.

One example of this is a directory with a large number of snapshots.
If its snap context doesn't fit, we oops in encode_request_partial().

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
net/ceph/msgpool.c
net/ceph/osd_client.c