From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 5E01720945BA7 for ; Wed, 11 Oct 2017 19:14:30 -0700 (PDT) Received: by mail-oi0-x233.google.com with SMTP id g125so6277473oib.12 for ; Wed, 11 Oct 2017 19:18:00 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: 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> From: Dan Williams Date: Wed, 11 Oct 2017 19:17:58 -0700 Message-ID: Subject: Re: [PATCH v9 2/6] fs, mm: pass fd to ->mmap_validate() List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: Al Viro Cc: Jan Kara , "Darrick J. Wong" , Linux API , "linux-nvdimm@lists.01.org" , Dave Chinner , linux-xfs@vger.kernel.org, Linux MM , linux-fsdevel , Andrew Morton , Christoph Hellwig List-ID: On Wed, Oct 11, 2017 at 6:28 PM, Dan Williams wrote: > 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? Ugh, so I think the difference with F_SETLEASE is that the lease ends when the fd is closed. In the mmap case the lease follows the lifetime of the vma. I'll rethink this interface... _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: 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> From: Dan Williams Date: Wed, 11 Oct 2017 19:17:58 -0700 Message-ID: Subject: Re: [PATCH v9 2/6] fs, mm: pass fd to ->mmap_validate() To: Al Viro Cc: "linux-nvdimm@lists.01.org" , Jan Kara , "Darrick J. Wong" , Linux API , Dave Chinner , Christoph Hellwig , linux-xfs@vger.kernel.org, Linux MM , Jeff Moyer , linux-fsdevel , Andrew Morton , Ross Zwisler Content-Type: text/plain; charset="UTF-8" Sender: owner-linux-mm@kvack.org List-ID: On Wed, Oct 11, 2017 at 6:28 PM, Dan Williams wrote: > 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? Ugh, so I think the difference with F_SETLEASE is that the lease ends when the fd is closed. In the mmap case the lease follows the lifetime of the vma. I'll rethink this interface... -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi0-f50.google.com ([209.85.218.50]:54929 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753087AbdJLCSA (ORCPT ); Wed, 11 Oct 2017 22:18:00 -0400 Received: by mail-oi0-f50.google.com with SMTP id u130so6289174oib.11 for ; Wed, 11 Oct 2017 19:17:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: 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> From: Dan Williams Date: Wed, 11 Oct 2017 19:17:58 -0700 Message-ID: Subject: Re: [PATCH v9 2/6] fs, mm: pass fd to ->mmap_validate() Content-Type: text/plain; charset="UTF-8" Sender: linux-xfs-owner@vger.kernel.org List-ID: List-Id: xfs To: Al Viro Cc: "linux-nvdimm@lists.01.org" , Jan Kara , "Darrick J. Wong" , Linux API , Dave Chinner , Christoph Hellwig , linux-xfs@vger.kernel.org, Linux MM , Jeff Moyer , linux-fsdevel , Andrew Morton , Ross Zwisler On Wed, Oct 11, 2017 at 6:28 PM, Dan Williams wrote: > 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? Ugh, so I think the difference with F_SETLEASE is that the lease ends when the fd is closed. In the mmap case the lease follows the lifetime of the vma. I'll rethink this interface... 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 19:17:58 -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: 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:28 PM, Dan Williams wrote: > 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? Ugh, so I think the difference with F_SETLEASE is that the lease ends when the fd is closed. In the mmap case the lease follows the lifetime of the vma. I'll rethink this interface...