From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7FEA4CA9EA0 for ; Mon, 21 Oct 2019 00:26:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60C2121A4A for ; Mon, 21 Oct 2019 00:26:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726729AbfJUA01 (ORCPT ); Sun, 20 Oct 2019 20:26:27 -0400 Received: from mail105.syd.optusnet.com.au ([211.29.132.249]:39633 "EHLO mail105.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726200AbfJUA00 (ORCPT ); Sun, 20 Oct 2019 20:26:26 -0400 Received: from dread.disaster.area (pa49-180-40-48.pa.nsw.optusnet.com.au [49.180.40.48]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id B1C8A3639AA; Mon, 21 Oct 2019 11:26:22 +1100 (AEDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1iMLWf-0002md-68; Mon, 21 Oct 2019 11:26:21 +1100 Date: Mon, 21 Oct 2019 11:26:21 +1100 From: Dave Chinner To: ira.weiny@intel.com 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: <20191021002621.GC8015@dread.disaster.area> References: <20191020155935.12297-1-ira.weiny@intel.com> <20191020155935.12297-3-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191020155935.12297-3-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=P6RKvmIu c=1 sm=1 tr=0 a=y881pOMu+B+mZdf5UrsJdA==:117 a=y881pOMu+B+mZdf5UrsJdA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=XobE76Q3jBoA:10 a=QyXUC8HyAAAA:8 a=7-415B0cAAAA:8 a=SKUv1dWzumgnk67EJ3kA: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 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. So if the mount option is going to live on, I suspect that we want to keep this code as it stands. Cheers, Dave. -- Dave Chinner david@fromorbit.com