Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp920562ybl; Fri, 9 Aug 2019 16:24:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXcB8X3eKS7Pw7XFNoCLdeuuIlsDU7v3NtDLsim/QZ+9Z0jkvhayWMiAw9uMXKzjE2TxBY X-Received: by 2002:a63:2b0c:: with SMTP id r12mr19553951pgr.206.1565393053744; Fri, 09 Aug 2019 16:24:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565393053; cv=none; d=google.com; s=arc-20160816; b=KDTrHJUHkiKaAi7pkbA0ljQhwhYJVjyiWCG3PCg5IUYXUVivwra3lPgYnbKNTajvfe OoX4ju8NjfCKHFSaSQWfMqAW45o8vTd4WwOySFHCkzLVmD9C5j2ZgBEWb/Hug+5UpSxX h+5nbwOW7ak9JJS3Ry6ndbNpK+Zeb53vfkJl1YaqQH5u7KwxGbblF5jtFNrjeiRGbbR1 g1afTO0NRwt8TASv3aFI+uSubZPYjEqhc7lCQSb68thQHj9ODMfgl1lMLJ/zItTZ8iko 4Ui6TizT4INCi8owBsDSWZYi/pN9Hmw7EuChURmpOSq2N7oa5lT7lGH8rgTqSwPOiaD8 Td2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=f9D/JEw7FTKyvjuHVi8UGqysW10nXJZAlR4Lf2Pks/k=; b=E1jKszYVXjBSc/a1f+W4IQa+IXZ75By6ek05FqkPzblejV1mqgTRxAgjB1tzxW1ybU 5Ym3AROOlmrzPO7C+aswM0XVuiRdT72n6njSNobN/j123S3bObp4JtOX8guNvtSqVAeA 0Itmmyv9gx1gzHQlf54SN1lvjXPz/D+kPonOmDGpwZwUzDxPQzyEgXutpNkSSgnMM5lF ABGnm9LfJEyB6bMVcEv4ZZyBDPiTrZtZY9V6u2443e04a0CLZ0+LU33pZ4U0LBtcfHIj 6aCx0/GwKKBgpeFQVwVJATA7MPvMKatyjDwhDKFhIjpncL3S9gxwAPam+xRg2N6Bh0+w 3LMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a187si54063809pge.269.2019.08.09.16.23.58; Fri, 09 Aug 2019 16:24:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727848AbfHIXXZ (ORCPT + 99 others); Fri, 9 Aug 2019 19:23:25 -0400 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:39592 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727012AbfHIXXZ (ORCPT ); Fri, 9 Aug 2019 19:23:25 -0400 Received: from dread.disaster.area (pa49-181-167-148.pa.nsw.optusnet.com.au [49.181.167.148]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 59581364BCE; Sat, 10 Aug 2019 09:23:17 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92) (envelope-from ) id 1hwED3-0001Oj-SN; Sat, 10 Aug 2019 09:22:09 +1000 Date: Sat, 10 Aug 2019 09:22:09 +1000 From: Dave Chinner To: ira.weiny@intel.com Cc: Andrew Morton , Jason Gunthorpe , Dan Williams , Matthew Wilcox , Jan Kara , Theodore Ts'o , John Hubbard , Michal Hocko , 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 Subject: Re: [RFC PATCH v2 08/19] fs/xfs: Fail truncate if page lease can't be broken Message-ID: <20190809232209.GA7777@dread.disaster.area> References: <20190809225833.6657-1-ira.weiny@intel.com> <20190809225833.6657-9-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190809225833.6657-9-ira.weiny@intel.com> 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=gu9DDhuZhshYSb5Zs/lkOA==:117 a=gu9DDhuZhshYSb5Zs/lkOA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=FmdZ9Uzk2mMA:10 a=QyXUC8HyAAAA:8 a=7-415B0cAAAA:8 a=0k3dsaUolkUxXiJpVawA:9 a=CjuIK1q_8ugA:10 a=biEYGPWJfzWAr4FL6Ov7:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 09, 2019 at 03:58:22PM -0700, ira.weiny@intel.com wrote: > From: Ira Weiny > > If pages are under a lease fail the truncate operation. We change the order of > lease breaks to directly fail the operation if the lease exists. > > Select EXPORT_BLOCK_OPS for FS_DAX to ensure that xfs_break_lease_layouts() is > defined for FS_DAX as well as pNFS. > > Signed-off-by: Ira Weiny > --- > fs/Kconfig | 1 + > fs/xfs/xfs_file.c | 5 +++-- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/fs/Kconfig b/fs/Kconfig > index 14cd4abdc143..c10b91f92528 100644 > --- a/fs/Kconfig > +++ b/fs/Kconfig > @@ -48,6 +48,7 @@ config FS_DAX > select DEV_PAGEMAP_OPS if (ZONE_DEVICE && !FS_DAX_LIMITED) > select FS_IOMAP > select DAX > + select EXPORTFS_BLOCK_OPS > help > Direct Access (DAX) can be used on memory-backed block devices. > If the block device supports DAX and the filesystem supports DAX, That looks wrong. If you require xfs_break_lease_layouts() outside of pnfs context, then move the function in the XFS code base to a file that is built in. It's only external dependency is on the break_layout() function, and XFS already has other unconditional direct calls to break_layout()... Cheers, Dave. -- Dave Chinner david@fromorbit.com