]> Gentwo Git Trees - linux/.git/commit
ceph: fix memory leaks in __ceph_sync_read()
authorMax Kellermann <max.kellermann@ionos.com>
Thu, 5 Dec 2024 15:49:51 +0000 (16:49 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 16 Dec 2024 22:25:43 +0000 (23:25 +0100)
commitd6fd6f8280f0257ba93f16900a0d3d3912f32c79
tree1243e8880e26b69e7b12157cf08fc106171dc9b2
parent78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
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: 03bc06c7b0bd ("ceph: add new mount option to enable sparse reads")
Fixes: f0fe1e54cfcf ("ceph: plumb in decryption during reads")
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/file.c