From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Williams Subject: Re: [PATCH v9 2/6] fs, mm: pass fd to ->mmap_validate() Date: Wed, 11 Oct 2017 18:28:32 -0700 Message-ID: References: <150776922692.9144.16963640112710410217.stgit@dwillia2-desk3.amr.corp.intel.com> <150776923838.9144.15727770472447035032.stgit@dwillia2-desk3.amr.corp.intel.com> <20171012012131.GD21978@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20171012012131.GD21978-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-nvdimm-bounces-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org Sender: "Linux-nvdimm" To: Al Viro Cc: Jan Kara , "Darrick J. Wong" , Linux API , "linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw@public.gmane.org" , Dave Chinner , linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Linux MM , linux-fsdevel , Andrew Morton , Christoph Hellwig List-Id: linux-api@vger.kernel.org On Wed, Oct 11, 2017 at 6:21 PM, Al Viro wrote: > On Wed, Oct 11, 2017 at 05:47:18PM -0700, Dan Williams wrote: >> The MAP_DIRECT mechanism for mmap intends to use a file lease to prevent >> block map changes while the file is mapped. It requires the fd to setup >> an fasync_struct for signalling lease break events to the lease holder. > > *UGH* > > That looks like one hell of a bad API. You are not even guaranteed that > descriptor will remain be still open by the time you pass it down to your > helper, nevermind the moment when event actually happens... What am I missing, fcntl(F_SETLEASE) seems to follow a similar pattern?