From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 12 Aug 2019 10:00:40 -0300 From: Jason Gunthorpe Subject: Re: [RFC PATCH v2 16/19] RDMA/uverbs: Add back pointer to system file object Message-ID: <20190812130039.GD24457@ziepe.ca> References: <20190809225833.6657-1-ira.weiny@intel.com> <20190809225833.6657-17-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190809225833.6657-17-ira.weiny@intel.com> Sender: owner-linux-mm@kvack.org To: ira.weiny@intel.com Cc: Andrew Morton , Dan Williams , Matthew Wilcox , Jan Kara , Theodore Ts'o , John Hubbard , Michal Hocko , Dave Chinner , linux-xfs@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-ext4@vger.kernel.org, linux-mm@kvack.org List-ID: On Fri, Aug 09, 2019 at 03:58:30PM -0700, ira.weiny@intel.com wrote: > From: Ira Weiny > > In order for MRs to be tracked against the open verbs context the ufile > needs to have a pointer to hand to the GUP code. > > No references need to be taken as this should be valid for the lifetime > of the context. > > Signed-off-by: Ira Weiny > drivers/infiniband/core/uverbs.h | 1 + > drivers/infiniband/core/uverbs_main.c | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h > index 1e5aeb39f774..e802ba8c67d6 100644 > +++ b/drivers/infiniband/core/uverbs.h > @@ -163,6 +163,7 @@ struct ib_uverbs_file { > struct page *disassociate_page; > > struct xarray idr; > + struct file *sys_file; /* backpointer to system file object */ > }; The 'struct file' has a lifetime strictly shorter than the ib_uverbs_file, which is kref'd on its own lifetime. Having a back pointer like this is confouding as it will be invalid for some of the lifetime of the struct. Jason