Re: [PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-29 Thread Jason Gunthorpe
On Sun, Jun 28, 2015 at 05:33:04PM +0300, Yishai Hadas wrote: You are wrong here, we have here balanced put, the first is done as part of fput(filp) - ib_uverbs_event_close_file - kref_put(file-ref, ib_uverbs_release_event_file) and the second at the end of this function as part of the err:

Re: [PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-29 Thread Jason Gunthorpe
On Tue, Jun 30, 2015 at 12:22:02AM +0300, Yishai Hadas wrote: It should be: kref_put(uverbs_file-async_file-ref, ib_uverbs_release_event_file) instead of: kref_put(uverbs_file-async_file-ref, ib_uverbs_release_file); Right Please note that in that approach we duplicate above line as it

Re: [PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-29 Thread Yishai Hadas
On 6/29/2015 8:40 PM, Jason Gunthorpe wrote: On Sun, Jun 28, 2015 at 05:33:04PM +0300, Yishai Hadas wrote: You are wrong here, we have here balanced put, the first is done as part of fput(filp) - ib_uverbs_event_close_file - kref_put(file-ref, ib_uverbs_release_event_file) and the second at

Re: [PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-28 Thread Yishai Hadas
On 6/25/2015 8:52 PM, Jason Gunthorpe wrote: On Thu, Jun 25, 2015 at 02:46:02PM +0300, Yishai Hadas wrote: On 6/24/2015 8:57 PM, Jason Gunthorpe wrote: On Mon, Jun 22, 2015 at 05:47:14PM +0300, Yishai Hadas wrote: fd_install(resp.async_fd, filp); @@ -386,6 +376,7 @@ ssize_t

Re: [PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-25 Thread Yishai Hadas
On 6/24/2015 8:57 PM, Jason Gunthorpe wrote: On Mon, Jun 22, 2015 at 05:47:14PM +0300, Yishai Hadas wrote: fd_install(resp.async_fd, filp); @@ -386,6 +376,7 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file, return in_len; err_file: +

Re: [PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-25 Thread Jason Gunthorpe
On Thu, Jun 25, 2015 at 02:46:02PM +0300, Yishai Hadas wrote: On 6/24/2015 8:57 PM, Jason Gunthorpe wrote: On Mon, Jun 22, 2015 at 05:47:14PM +0300, Yishai Hadas wrote: fd_install(resp.async_fd, filp); @@ -386,6 +376,7 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file,

Re: [PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-24 Thread Jason Gunthorpe
On Mon, Jun 22, 2015 at 05:47:14PM +0300, Yishai Hadas wrote: fd_install(resp.async_fd, filp); @@ -386,6 +376,7 @@ ssize_t ib_uverbs_get_context(struct ib_uverbs_file *file, return in_len; err_file: + ib_uverbs_free_async_event_file(file); fput(filp); This looks

[PATCH for-next V5 1/5] IB/uverbs: Fix reference counting usage of event files

2015-06-22 Thread Yishai Hadas
Fix the reference counting usage to be handled in the event file creation/destruction function, instead of being done by the caller. This is done for both async/non-async event files. Based on Jason Gunthorpe report at https://www.mail-archive.com/ linux-rdma@vger.kernel.org/msg24680.html: The