Commit 66e0c4f
committed
ceph: fix memory leak in ceph_direct_read_write()
The bvecs array which is allocated in iter_get_bvecs_alloc() is leaked
and pages remain pinned if ceph_alloc_sparse_ext_map() fails.
There is no need to delay the allocation of sparse_ext map until after
the bvecs array is set up, so fix this by moving sparse_ext allocation
a bit earlier. Also, make a similar adjustment in __ceph_sync_read()
for consistency (a leak of the same kind in __ceph_sync_read() has been
addressed differently).
Cc: [email protected]
Fixes: 03bc06c ("ceph: add new mount option to enable sparse reads")
Signed-off-by: Ilya Dryomov <[email protected]>
Reviewed-by: Alex Markuze <[email protected]>1 parent 9abee47 commit 66e0c4f
1 file changed
+22
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1116 | 1116 | | |
1117 | 1117 | | |
1118 | 1118 | | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
1119 | 1129 | | |
1120 | 1130 | | |
1121 | 1131 | | |
| |||
1129 | 1139 | | |
1130 | 1140 | | |
1131 | 1141 | | |
1132 | | - | |
1133 | | - | |
1134 | | - | |
1135 | | - | |
1136 | | - | |
1137 | | - | |
1138 | | - | |
1139 | | - | |
1140 | | - | |
1141 | | - | |
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| |||
1551 | 1551 | | |
1552 | 1552 | | |
1553 | 1553 | | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1554 | 1564 | | |
1555 | 1565 | | |
1556 | 1566 | | |
| |||
1560 | 1570 | | |
1561 | 1571 | | |
1562 | 1572 | | |
| 1573 | + | |
| 1574 | + | |
1563 | 1575 | | |
1564 | 1576 | | |
1565 | 1577 | | |
| |||
1591 | 1603 | | |
1592 | 1604 | | |
1593 | 1605 | | |
1594 | | - | |
1595 | | - | |
1596 | | - | |
1597 | | - | |
1598 | | - | |
1599 | | - | |
1600 | | - | |
1601 | | - | |
1602 | | - | |
1603 | | - | |
1604 | | - | |
1605 | 1606 | | |
1606 | 1607 | | |
1607 | 1608 | | |
| |||
0 commit comments