* [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked
@ 2020-08-25 16:35 Jason Gunthorpe
2020-08-26 6:37 ` Leon Romanovsky
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2020-08-25 16:35 UTC (permalink / raw)
To: linux-rdma; +Cc: Gal Pressman, Leon Romanovsky
Drivers that fail destroy can cause uverbs to leak uobjects. Drivers are
required to always eventually destroy their ubojects, so trigger a WARN_ON
to detect this driver bug.
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
---
drivers/infiniband/core/rdma_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
index 3962da54ffbf47..d2b5417a4d5170 100644
--- a/drivers/infiniband/core/rdma_core.c
+++ b/drivers/infiniband/core/rdma_core.c
@@ -895,8 +895,9 @@ void uverbs_destroy_ufile_hw(struct ib_uverbs_file *ufile,
if (__uverbs_cleanup_ufile(ufile, reason)) {
/*
* No entry was cleaned-up successfully during this
- * iteration
+ * iteration. It is a driver bug to fail destruction.
*/
+ WARN_ON(!list_empty(&ufile->uobjects));
break;
}
--
2.28.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked
2020-08-25 16:35 [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked Jason Gunthorpe
@ 2020-08-26 6:37 ` Leon Romanovsky
2020-08-26 8:10 ` Gal Pressman
2020-08-31 15:26 ` Jason Gunthorpe
2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2020-08-26 6:37 UTC (permalink / raw)
To: Jason Gunthorpe; +Cc: linux-rdma, Gal Pressman
On Tue, Aug 25, 2020 at 01:35:38PM -0300, Jason Gunthorpe wrote:
> Drivers that fail destroy can cause uverbs to leak uobjects. Drivers are
> required to always eventually destroy their ubojects, so trigger a WARN_ON
> to detect this driver bug.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/infiniband/core/rdma_core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked
2020-08-25 16:35 [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked Jason Gunthorpe
2020-08-26 6:37 ` Leon Romanovsky
@ 2020-08-26 8:10 ` Gal Pressman
2020-08-31 15:26 ` Jason Gunthorpe
2 siblings, 0 replies; 4+ messages in thread
From: Gal Pressman @ 2020-08-26 8:10 UTC (permalink / raw)
To: Jason Gunthorpe, linux-rdma; +Cc: Leon Romanovsky
On 25/08/2020 19:35, Jason Gunthorpe wrote:
> Drivers that fail destroy can cause uverbs to leak uobjects. Drivers are
> required to always eventually destroy their ubojects, so trigger a WARN_ON
> to detect this driver bug.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> ---
> drivers/infiniband/core/rdma_core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
> index 3962da54ffbf47..d2b5417a4d5170 100644
> --- a/drivers/infiniband/core/rdma_core.c
> +++ b/drivers/infiniband/core/rdma_core.c
> @@ -895,8 +895,9 @@ void uverbs_destroy_ufile_hw(struct ib_uverbs_file *ufile,
> if (__uverbs_cleanup_ufile(ufile, reason)) {
> /*
> * No entry was cleaned-up successfully during this
> - * iteration
> + * iteration. It is a driver bug to fail destruction.
> */
> + WARN_ON(!list_empty(&ufile->uobjects));
> break;
> }
>
>
Looks good,
Reviewed-by: Gal Pressman <galpress@amazon.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked
2020-08-25 16:35 [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked Jason Gunthorpe
2020-08-26 6:37 ` Leon Romanovsky
2020-08-26 8:10 ` Gal Pressman
@ 2020-08-31 15:26 ` Jason Gunthorpe
2 siblings, 0 replies; 4+ messages in thread
From: Jason Gunthorpe @ 2020-08-31 15:26 UTC (permalink / raw)
To: linux-rdma; +Cc: Gal Pressman, Leon Romanovsky
On Tue, Aug 25, 2020 at 01:35:38PM -0300, Jason Gunthorpe wrote:
> Drivers that fail destroy can cause uverbs to leak uobjects. Drivers are
> required to always eventually destroy their ubojects, so trigger a WARN_ON
> to detect this driver bug.
>
> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
> Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
> Reviewed-by: Gal Pressman <galpress@amazon.com>
> ---
> drivers/infiniband/core/rdma_core.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to for-next
Jason
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-31 15:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-25 16:35 [PATCH] RDMA/core: Trigger a WARN_ON if the driver causes uobjects to become leaked Jason Gunthorpe
2020-08-26 6:37 ` Leon Romanovsky
2020-08-26 8:10 ` Gal Pressman
2020-08-31 15:26 ` Jason Gunthorpe
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.