From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Gunthorpe Subject: Re: [PATCH V2 for-next 2/7] IB/core: Add support for idr types Date: Thu, 30 Mar 2017 09:53:16 -0600 Message-ID: <20170330155316.GA19074@obsidianresearch.com> References: <1489939145-125246-1-git-send-email-matanb@mellanox.com> <1489939145-125246-3-git-send-email-matanb@mellanox.com> <20170329151028.GD2586@obsidianresearch.com> <20170329222744.GA30605@obsidianresearch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Matan Barak Cc: Matan Barak , Doug Ledford , linux-rdma , Liran Liss , Sean Hefty , Leon Romanovsky , Majd Dibbiny , Tal Alon , Yishai Hadas , Ira Weiny , Haggai Eran , Christoph Lameter List-Id: linux-rdma@vger.kernel.org On Thu, Mar 30, 2017 at 06:42:12PM +0300, Matan Barak wrote: > Yeah, I guess both are ok. I tend to like symmetrical approaches, but > I don't have a strong objection > to go with needs_kfree_rcu if you really prefer that. I think it reads a bit better and there are two fewer branches on lookup > > Since it is lookup_get the caller always has to call uobj_put on any > > failure, and that does fput for fds. No problem? > > > > Not necessarily. For example, lookup_get could fail because it can't > find a valid object. In that case, you have no object to > put. However, I'll just put a type->lookup_put in the release path, > so we could move that into the shared code. Sure, something like that > We don't have a release memory functions - we got rid of them awhile ago. > However, when you detach a driver based fd object, and the release > file_operations of that > fd points to driver code. You could get a nasty exception if you try > to close that file > after unbinding the context because the module was unloaded. Remember that fops holds a module lock on the functions inside struct file_operations. We must ensure that our functions in struct file_operations never call through to a driver after detach is called. So, no messing with modules should be needed.. Jason -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html