Commit d6fd6f82 authored by Max Kellermann's avatar Max Kellermann Committed by Ilya Dryomov
Browse files

ceph: fix memory leaks in __ceph_sync_read()



In two `break` statements, the call to ceph_release_page_vector() was
missing, leaking the allocation from ceph_alloc_page_vector().

Instead of adding the missing ceph_release_page_vector() calls, the
Ceph maintainers preferred to transfer page ownership to the
`ceph_osd_request` by passing `own_pages=true` to
osd_req_op_extent_osd_data_pages().  This requires postponing the
ceph_osdc_put_request() call until after the block that accesses the
`pages`.

Cc: stable@vger.kernel.org
Fixes: 03bc06c7 ("ceph: add new mount option to enable sparse reads")
Fixes: f0fe1e54 ("ceph: plumb in decryption during reads")
Signed-off-by: default avatarMax Kellermann <max.kellermann@ionos.com>
Reviewed-by: default avatarIlya Dryomov <idryomov@gmail.com>
Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
parent 78d4f34e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment