* [PATCH] RDMA/odp: Fix missed unlock in non-blocking invalidate_start
@ 2019-06-11 16:09 Jason Gunthorpe
2019-06-12 16:15 ` Leon Romanovsky
0 siblings, 1 reply; 3+ messages in thread
From: Jason Gunthorpe @ 2019-06-11 16:09 UTC (permalink / raw)
To: linux-rdma, Moni Shoua; +Cc: Jason Gunthorpe, stable
From: Jason Gunthorpe <jgg@mellanox.com>
If invalidate_start returns with EAGAIN then the umem_rwsem needs to be
unlocked as no invalidate_end will be called.
Cc: <stable@vger.kernel.org>
Fixes: ca748c39ea3f ("RDMA/umem: Get rid of per_mm->notifier_count")
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
---
drivers/infiniband/core/umem_odp.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c
index f962b5bbfa40e4..e4b13a32692a97 100644
--- a/drivers/infiniband/core/umem_odp.c
+++ b/drivers/infiniband/core/umem_odp.c
@@ -151,6 +151,7 @@ static int ib_umem_notifier_invalidate_range_start(struct mmu_notifier *mn,
{
struct ib_ucontext_per_mm *per_mm =
container_of(mn, struct ib_ucontext_per_mm, mn);
+ int rc;
if (mmu_notifier_range_blockable(range))
down_read(&per_mm->umem_rwsem);
@@ -167,11 +168,14 @@ static int ib_umem_notifier_invalidate_range_start(struct mmu_notifier *mn,
return 0;
}
- return rbt_ib_umem_for_each_in_range(&per_mm->umem_tree, range->start,
- range->end,
- invalidate_range_start_trampoline,
- mmu_notifier_range_blockable(range),
- NULL);
+ rc = rbt_ib_umem_for_each_in_range(&per_mm->umem_tree, range->start,
+ range->end,
+ invalidate_range_start_trampoline,
+ mmu_notifier_range_blockable(range),
+ NULL);
+ if (rc)
+ up_read(&per_mm->umem_rwsem);
+ return rc;
}
static int invalidate_range_end_trampoline(struct ib_umem_odp *item, u64 start,
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/odp: Fix missed unlock in non-blocking invalidate_start
2019-06-11 16:09 [PATCH] RDMA/odp: Fix missed unlock in non-blocking invalidate_start Jason Gunthorpe
@ 2019-06-12 16:15 ` Leon Romanovsky
2019-06-17 19:56 ` Doug Ledford
0 siblings, 1 reply; 3+ messages in thread
From: Leon Romanovsky @ 2019-06-12 16:15 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma, Moni Shoua, Jason Gunthorpe, stable
On Tue, Jun 11, 2019 at 01:09:51PM -0300, Jason Gunthorpe wrote:
> From: Jason Gunthorpe <jgg@mellanox.com>
>
> If invalidate_start returns with EAGAIN then the umem_rwsem needs to be
> unlocked as no invalidate_end will be called.
>
> Cc: <stable@vger.kernel.org>
> Fixes: ca748c39ea3f ("RDMA/umem: Get rid of per_mm->notifier_count")
> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> ---
> drivers/infiniband/core/umem_odp.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] RDMA/odp: Fix missed unlock in non-blocking invalidate_start
2019-06-12 16:15 ` Leon Romanovsky
@ 2019-06-17 19:56 ` Doug Ledford
0 siblings, 0 replies; 3+ messages in thread
From: Doug Ledford @ 2019-06-17 19:56 UTC (permalink / raw)
To: Leon Romanovsky, Jason Gunthorpe
Cc: linux-rdma, Moni Shoua, Jason Gunthorpe, stable
[-- Attachment #1: Type: text/plain, Size: 869 bytes --]
On Wed, 2019-06-12 at 19:15 +0300, Leon Romanovsky wrote:
> On Tue, Jun 11, 2019 at 01:09:51PM -0300, Jason Gunthorpe wrote:
> > From: Jason Gunthorpe <jgg@mellanox.com>
> >
> > If invalidate_start returns with EAGAIN then the umem_rwsem needs
> > to be
> > unlocked as no invalidate_end will be called.
> >
> > Cc: <stable@vger.kernel.org>
> > Fixes: ca748c39ea3f ("RDMA/umem: Get rid of per_mm-
> > >notifier_count")
> > Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
> > ---
> > drivers/infiniband/core/umem_odp.c | 14 +++++++++-----
> > 1 file changed, 9 insertions(+), 5 deletions(-)
> >
>
> Thanks,
> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Thanks, applied to for-next.
--
Doug Ledford <dledford@redhat.com>
GPG KeyID: B826A3330E572FDD
Key fingerprint = AE6B 1BDA 122B 23B4 265B 1274 B826 A333 0E57
2FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-17 19:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-11 16:09 [PATCH] RDMA/odp: Fix missed unlock in non-blocking invalidate_start Jason Gunthorpe
2019-06-12 16:15 ` Leon Romanovsky
2019-06-17 19:56 ` Doug Ledford
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.