Hello, This series fixes a bunch of memory management issues in messenger and OSD client code. The main objective was to stop allocating memory for message data items where erroring out isn't sensible, but I also patched a couple of old bugs that were masked by that behaviour, a fallback from mempool and some error path memory leaks. Thanks, Ilya Ilya Dryomov (10): libceph: introduce ceph_pagelist_alloc() libceph: don't consume a ref on pagelist in ceph_msg_data_add_pagelist() libceph: no need to call osd_req_opcode_valid() in osd_req_encode_op() ceph: num_ops is off by one in ceph_aio_retry_work() libceph: enable fallback to ceph_msg_new() in ceph_msgpool_get() libceph: assign cookies in linger_submit() libceph: introduce alloc_watch_request() libceph, rbd, ceph: move ceph_osdc_alloc_messages() calls libceph: preallocate message data items libceph: check reply num_data_items in setup_request_data() drivers/block/rbd.c | 19 +-- fs/ceph/acl.c | 3 +- fs/ceph/file.c | 12 +- fs/ceph/mds_client.c | 9 +- fs/ceph/xattr.c | 3 +- include/linux/ceph/messenger.h | 24 +--- include/linux/ceph/msgpool.h | 11 +- include/linux/ceph/pagelist.h | 11 +- net/ceph/messenger.c | 107 +++++++---------- net/ceph/msgpool.c | 27 +++-- net/ceph/osd_client.c | 264 +++++++++++++++++++++++++++-------------- net/ceph/pagelist.c | 20 ++++ 12 files changed, 290 insertions(+), 220 deletions(-) -- 2.14.4