Commit d6fd6f8
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: [email protected]
Fixes: 03bc06c ("ceph: add new mount option to enable sparse reads")
Fixes: f0fe1e5 ("ceph: plumb in decryption during reads")
Signed-off-by: Max Kellermann <[email protected]>
Reviewed-by: Ilya Dryomov <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>1 parent 78d4f34 commit d6fd6f8
1 file changed
+3
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1127 | 1127 | | |
1128 | 1128 | | |
1129 | 1129 | | |
1130 | | - | |
| 1130 | + | |
1131 | 1131 | | |
1132 | 1132 | | |
1133 | 1133 | | |
| |||
1186 | 1186 | | |
1187 | 1187 | | |
1188 | 1188 | | |
1189 | | - | |
1190 | | - | |
1191 | 1189 | | |
1192 | 1190 | | |
1193 | 1191 | | |
| |||
1221 | 1219 | | |
1222 | 1220 | | |
1223 | 1221 | | |
1224 | | - | |
| 1222 | + | |
| 1223 | + | |
1225 | 1224 | | |
1226 | 1225 | | |
1227 | 1226 | | |
| |||
0 commit comments