Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4552648ybg; Mon, 21 Oct 2019 10:41:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyGtlgy+yB6/NWGuYWqGtsdOBf+UoZ38SERkzh2eldyqQ6EnWBOSsv2J0afTxTGQBaiyZQN X-Received: by 2002:a50:af44:: with SMTP id g62mr26533380edd.164.1571679681969; Mon, 21 Oct 2019 10:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571679681; cv=none; d=google.com; s=arc-20160816; b=E1iPyRl0905ia8UiTN9H4r2tC2SbSF8+h+Ky5XMrkrgJo7EY05mguPJsi4NiPYFKlf Eda+Yfb+vGaqi6mV4zgOYtvlgLrKTxxmKLMYPlXD30Le4hOUKhtAulY4pBJTXAvi8ulZ xpJdb86svvMMn5GzQ4/Zy/tGZI5erZeZbivWmRs62bHPDLN76NLVwYsuR8mLlAFrP2sc 42rOHHpfceJeKtfxGx/oglilkqeEtkuK/zc04IoUAlpXgp/0pMRBTv3hEZbz482V/Ygr MXCYbL1z3ruyxy5fhW6OjfgsbZgY3GxUxP3c8nt5c/HWNOWFzVwstBxVvjtlfqP5muX9 LLhg== 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=nA3hPmt/Afl28r93zQp+ihuDFLN1erHp+0wfkJNhhfE=; b=Fzw4wnwPr/fFvsk1nJQqXQmLft3YMKG42VpjpztpLrTrmgtSr+zcV1/nnzL1i/xOPB 5XpnE10QPUgzdmnvWyezU8ZR06O7utn5ZRIDpyF/Wn4THP3GZ+7szQYKfryNARUjjfEw CJ5yU2S7C3svJw8pG3cY8bo48YPRu5Wz2XYBL25Gld2TiSgeG1OnEx6ffIS+1g6te6tk GPiH4bWmBevVyXWKqLhwD1cniuzBpVBw3Rn9Xms3g+yR39CQkNGKdizdtF1XNnuDhIMD K3HlyYr56qfKk1C9JR9Vrrv7keE/9oR/0IqLiGj72l01CNi45BFf+MlvaeP3MHo+mhxO EmUw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s39si3138481edm.338.2019.10.21.10.40.58; Mon, 21 Oct 2019 10:41:21 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729533AbfJURk2 (ORCPT + 99 others); Mon, 21 Oct 2019 13:40:28 -0400 Received: from mga04.intel.com ([192.55.52.120]:38681 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbfJURk2 (ORCPT ); Mon, 21 Oct 2019 13:40:28 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Oct 2019 10:40:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,324,1566889200"; d="scan'208";a="200508215" Received: from iweiny-desk2.sc.intel.com ([10.3.52.157]) by orsmga003.jf.intel.com with ESMTP; 21 Oct 2019 10:40:26 -0700 Date: Mon, 21 Oct 2019 10:40:26 -0700 From: Ira Weiny To: Dave Chinner Cc: linux-kernel@vger.kernel.org, Alexander Viro , "Darrick J. Wong" , Dan Williams , Christoph Hellwig , "Theodore Y. Ts'o" , Jan Kara , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/5] fs/xfs: Isolate the physical DAX flag from effective Message-ID: <20191021174025.GA23024@iweiny-DESK2.sc.intel.com> References: <20191020155935.12297-1-ira.weiny@intel.com> <20191020155935.12297-3-ira.weiny@intel.com> <20191021002621.GC8015@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191021002621.GC8015@dread.disaster.area> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 21, 2019 at 11:26:21AM +1100, Dave Chinner wrote: > On Sun, Oct 20, 2019 at 08:59:32AM -0700, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > xfs_ioctl_setattr_dax_invalidate() currently checks if the DAX flag is > > changing as a quick check. > > > > But the implementation mixes the physical (XFS_DIFLAG2_DAX) and > > effective (S_DAX) DAX flags. > > More nuanced than that. > > The idea was that if the mount option was set, clearing the > per-inode flag would override the mount option. i.e. the mount > option sets the S_DAX flag at inode instantiation, so using > FSSETXATTR to ensure the FS_XFLAG_DAX is not set would override the > mount option setting, giving applications a way of guranteeing they > aren't using DAX to access the data. At LSF/MM we discussed keeping the mount option as a global "chicken bit" as described by Matt Wilcox[1]. This preserves the existing behavior of turning it on no matter what but offers an alternative with the per-file flag. To do what you describe above, it was suggested, by Ted I believe, that an admin can set DAX on the root directory which will enable DAX by default through inheritance but allow users to turn it off if they desire. I'm concerned that all users who currently use '-o dax' will expect their current file systems to be using DAX when those mounts occur. Their physical inode flag is going to be 0 which, if we implement the 'turn off DAX' as you describe will mean they will not get the behavior they expect when booting on a new kernel. > > So if the mount option is going to live on, I suspect that we want > to keep this code as it stands. I don't think we can get rid of it soon but I would be in favor of working toward deprecating it. Regardless I think this keeps the semantics simple WRT the interaction of the mount and per-file flags. Ira [1] https://lwn.net/Articles/787973/ > > Cheers, > > Dave. > -- > Dave Chinner > david@fromorbit.com