This message generated a parse failure. Raw output follows here. Please use 'back' to navigate. From devnull@lkml.org Thu Jun 6 17:53:48 2024 >From mailfetcher Wed Aug 14 23:58:02 2019 Envelope-to: lkml@grols.ch Delivery-date: Wed, 14 Aug 2019 23:57:52 +0200 Received: from stout.grols.ch [195.201.141.146] by 72459556e3a9 with IMAP (fetchmail-6.3.26) for (single-drop); Wed, 14 Aug 2019 23:58:02 +0200 (CEST) Received: from vger.kernel.org ([209.132.180.67]) by stout.grols.ch with esmtp (Exim 4.89) (envelope-from ) id 1hy1HE-0000zF-1W for lkml@grols.ch; Wed, 14 Aug 2019 23:57:52 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728821AbfHNV5n (ORCPT ); Wed, 14 Aug 2019 17:57:43 -0400 Received: from mail104.syd.optusnet.com.au ([211.29.132.246]:57130 "EHLO mail104.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728745AbfHNV5m (ORCPT ); Wed, 14 Aug Received: from dread.disaster.area (pa49-195-190-67.pa.nsw.optusnet.com.au [49.195.190.67]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 800D843DB39; Thu, 15 Aug 2019 07:57:37 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92) (envelope-from ) id 1hy1Fu-0006Ca-2B; Thu, 15 Aug 2019 07:56:30 +1000 Date: Thu, 15 Aug 2019 07:56:30 +1000 From: Dave Chinner To: Jeff Layton Cc: ira.weiny@intel.com, Andrew Morton , Jason Gunthorpe , Dan Williams , Matthew Wilcox , Jan Kara , Theodore Ts'o References: <20190809225833.6657-1-ira.weiny@intel.com> <20190809225833.6657-3-ira.weiny@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=TR82T6zjGmBjdfWdGgpkDw==:117 a=TR82T6zjGmBjdfWdGgpkDw==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=QyXUC8HyAAAA:8 a=7-415B0cAAAA:8 a=qa3ElbQomqnm_qv8Y-cA:9 a=Cj Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-Id: X-Mailing-List: linux-kernel@vger.kernel.org Received-SPF: none client-ip=209.132.180.67; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org X-Spam-Score: -0.7 X-Spam-Score-Bar: / X-Spam-Action: no action X-Spam-Report: Action: no action Symbol: ARC_NA(0.00) Symbol: RECEIVED_SPAMHAUS_FAIL(0.00) Symbol: BAYES_HAM(-2.99) Symbol: FROM_HAS_DN(0.00) Symbol: TO_DN_SOME(0.00) Symbol: PRECEDENCE_BULK(0.00) Symbol: MIME_GOOD(-0.10) Symbol: DMARC_NA(0.00) Symbol: AUTH_NA(1.00) Sy On Wed, Aug 14, 2019 at 10:15:06AM -0400, Jeff Layton wrote: > On Fri, 2019-08-09 at 15:58 -0700, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > Add an exclusive lease flag which indicates that the layout mechanism > > can not be broken. > > > > Exclusive layout leases allow the file system to know that pages may be > > GUP pined and that attempts to change the layout, ie truncate, should be > > failed. > > > > A process which attempts to break it's own exclusive lease gets an > > EDEADLOCK return to help determine that this is likely a programming bug > > vs someone else holding a resource. ..... > > diff --git a/include/uapi/asm-generic/fcntl.h b/include/uapi/asm-generic/fcntl.h > > index baddd54f3031..88b175ceccbc 100644 > > --- a/include/uapi/asm-generic/fcntl.h > > +++ b/include/uapi/asm-generic/fcntl.h > > @@ -176,6 +176,8 @@ struct f_owner_ex { > > > > #define F_LAYOUT 16 /* layout lease to allow longterm pins such as > > RDMA */ > > +#define F_EXCLUSIVE 32 /* layout lease is exclusive */ > > + /* FIXME or shoudl this be F_EXLCK??? */ > > > > /* operations for bsd flock(), also used by the kernel implementation */ > > #define LOCK_SH 1 /* shared lock */ > > This interface just seems weird to me. The existing F_*LCK values aren't > really set up to be flags, but are enumerated values (even if there are > some gaps on some arches). For instance, on parisc and sparc: I don't think we need to worry about this - the F_WRLCK version of the layout lease should have these exclusive access semantics (i.e other ops fail rather than block waiting for lease recall) and hence the API shouldn't need a new flag to specify them. i.e. the primary difference between F_RDLCK and F_WRLCK layout leases is that the F_RDLCK is a shared, co-operative lease model where only delays in operations will be seen, while F_WRLCK is a "guarantee exclusive access and I don't care what it breaks" model... :) Cheers, Dave. -- Dave Chinner david@fromorbit.com