RDMA/umem: updated bug fix in error handling path
Subsystems (2)
PATCH 1/1 RDMA/umem: updated bug fix in error handling path
From: John Hubbard <[email protected]>
The previous attempted bug fix overlooked the fact that ib_umem_odp_map_dma_single_page() was doing a put_page() upon hitting an error. So there was not really a bug there.
Therefore, this reverts the off-by-one change, but keeps the change to use release_pages() in the error path.
Fixes commit xxxxxxxxxxxx ("RDMA/umem: minor bug fix in error handling path")
Suggested-by Artemy Kovalyov <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Ira Weiny <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Doug Ledford <[email protected]>
Signed-off-by John Hubbard <[email protected]>
--- drivers/infiniband/core/umem_odp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/infiniband/core/umem_odp.c +6 -3
@@ -686,10 +686,13 @@ int ib_umem_odp_map_dma_pages(struct ib_umem_odp *umem_odp, u64 user_virt,if (ret <0 ) {/* -* Release pages, starting at the the first page -* that experienced an error. +* Release pages, remembering that the first page +* to hit an error was already released by +* ib_umem_odp_map_dma_single_page(). */ -release_pages (&local_page_list[j], npages - j); +if (npages - (j +1 ) >0 ) +release_pages (&local_page_list[j+1 ], + npages - (j +1 ));break ; } }
Signature · 1 line
2.21.0
Jason Gunthorpe
AppliedQuoted 20 lines · On Tue, Mar 05, 2019 at 06:00:22PM -0800, [email protected] wrote:
From: John Hubbard <[email protected]>
The previous attempted bug fix overlooked the fact that
ib_umem_odp_map_dma_single_page()was doing aput_page()upon hitting an error. So there was not really a bug there.Therefore, this reverts the off-by-one change, but keeps the change to use
release_pages()in the error path.Fixes commit xxxxxxxxxxxx ("RDMA/umem: minor bug fix in error handling path")Suggested-by Artemy Kovalyov <[email protected]>Cc Leon Romanovsky <[email protected]>Cc Ira Weiny <[email protected]>Cc Jason Gunthorpe <[email protected]>Cc Andrew Morton <[email protected]>Cc Doug Ledford <[email protected]>Signed-off-by John Hubbard <[email protected]>
Quoted 3 lines
--- drivers/infiniband/core/umem_odp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
Applied to for-next, thanks
Jason