Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp531620pxu; Tue, 1 Dec 2020 18:30:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwYZ+XOQtp+RF3NrWCMoCbbmAZ40apGT74cBxWj0HlGfwDJzYbkQ2+c59Ki4GoNM6hn6SJS X-Received: by 2002:a17:906:411b:: with SMTP id j27mr294599ejk.466.1606876256474; Tue, 01 Dec 2020 18:30:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606876256; cv=none; d=google.com; s=arc-20160816; b=JsFfx42kkRmPjwGRPv1pSwZbMqL/HJaV2MTINDlaaeXfDj3ThFo2jdYR/H+w/dS1JA ty4/LqSxQ20JBK2Ij++/oEtOTwKsHzvBOxpQXQ+kV7bDo1QtYWbSqq4bGxGL/ffE0wn4 B3qYhXk5JJGv7aqy2lf3kZZ8EOPESc1LP+o66L+rhGXr9mL1Q2b015zGsEBqVENFMRZy HgL/GI+QZd02H4UzreeZkIvcXhYR9ovEHWfl+dnpgh1EaFM4XSUoI9sG5JC05uC6+ddo QLv3LbtKD7IVXoSkW2SdTBlKt/YZbeF60eBNTA7zPVZ6Xk0WdZPhDVMzA40DafGdsCno xsYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=SCoJv3WCZ17Qay2PReUKvou8VqNpWqNSG999ge1+X14=; b=Z9RSwFmJouWFM3JVGjhtTw5ULqNqCPR3VY86n99HUl9/yo7l1aldLdR9HwxJPEmomG 7MIoYQYOw1IUv4RvOm93llEMy41CjwIKDuFlI/E7VtzRVTb3njxCNM2SgODMvYFNOkIL MH5lvJiY3a/z+wAooGbwXcYQ2hEvgY+7DooE5b0sbTWd180sy+x2ZntJt0cHiuL7edvm 89W1xRBGlH4piNQ0J0luclWs1ECX8H0BfEdRIN12r6SP434IGcS8jawr6wAMpfBT4POM 2ngs9ki+FrwS75wirzsoiUewdoClezEAxDsGeY9ImSqC44WajCCbLw33XJPjS2QSPM+o F6Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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. [23.128.96.18]) by mx.google.com with ESMTP id r24si191507edc.286.2020.12.01.18.30.29; Tue, 01 Dec 2020 18:30:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 S1726388AbgLBCaN (ORCPT + 99 others); Tue, 1 Dec 2020 21:30:13 -0500 Received: from mga14.intel.com ([192.55.52.115]:15224 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726245AbgLBCaN (ORCPT ); Tue, 1 Dec 2020 21:30:13 -0500 IronPort-SDR: nNGMQln6PDP1wT6Cd06CN9f9B6u6As7FmYMzMfgVwk/hUMp1F+40m3+XKD4sqKzaiJMP5v9uqf srX0BWBB9XeQ== X-IronPort-AV: E=McAfee;i="6000,8403,9822"; a="172158178" X-IronPort-AV: E=Sophos;i="5.78,385,1599548400"; d="scan'208";a="172158178" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2020 18:29:28 -0800 IronPort-SDR: tCo34gc8ONvympmjsivSknXt9rfuyemtxoJ1Hc4I2vCYiAYx7LYr4TwplrxLtN5gDjILu/TAEh TPD+jF8tJggg== X-IronPort-AV: E=Sophos;i="5.78,385,1599548400"; d="scan'208";a="549838785" Received: from iweiny-desk2.sc.intel.com (HELO localhost) ([10.3.52.147]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Dec 2020 18:29:26 -0800 Date: Tue, 1 Dec 2020 18:29:26 -0800 From: Ira Weiny To: Eric Sandeen Cc: Linus Torvalds , Dave Chinner , "Darrick J. Wong" , Eric Sandeen , Miklos Szeredi , David Howells , linux-fsdevel , linux-man , Linux Kernel Mailing List , xfs , Ext4 Developers List , Xiaoli Feng Subject: Re: [PATCH 2/2] statx: move STATX_ATTR_DAX attribute handling to filesystems Message-ID: <20201202022926.GA1455515@iweiny-DESK2.sc.intel.com> References: <05a0f4fd-7f62-8fbc-378d-886ccd5b3f11@redhat.com> <20201201173905.GI143045@magnolia> <20201201205243.GK2842436@dread.disaster.area> <9ab51770-1917-fc05-ff57-7677f17b6e44@sandeen.net> <15fd1754-371d-88ff-c60b-6635a2da0b13@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15fd1754-371d-88ff-c60b-6635a2da0b13@sandeen.net> User-Agent: Mutt/1.11.1 (2018-12-01) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Dec 01, 2020 at 04:26:43PM -0600, Eric Sandeen wrote: > On 12/1/20 4:12 PM, Linus Torvalds wrote: > > On Tue, Dec 1, 2020 at 2:03 PM Eric Sandeen wrote: > >> > >> That's why I was keen to just add DAX unconditionally at this point, and if we want > >> to invent/refine meanings for the mask, we can still try to do that? > > > > Oh Gods. Let's *not* make this some "random filesystem choice" where > > now semantics depends on what some filesystem decided to do, and > > different filesystems have very subtly different semantics. > > Well, I had hoped that refinement might start with the interface > documentation, I'm certainly not suggesting every filesystem should go > its own way. > > This all screams "please keep this in the VFS layer" so that we at > > least have _one_ place where these kinds of decisions are made. > > Making the "right decision" depends on what the mask actually means, > I guess. > > Today we set a DAX attribute in statx which is not set in the mask. > That seems clearly broken. Yes... and no. You can't set the statx DAX flag directly. It is only an indicator of the current file state. That state is affected by the inode mode and the DAX mount option. But I agree that having a bit set when the corresponding mask is 0 is odd. > > We can either leave that as it is, set DAX in the mask for everyone in > the VFS, or delegate that mask-setting task to the individual filesystems > so that it reflects , probably "can this inode ever be in dax > mode?" > > I honestly don't care if we keep setting the attribute itself in the VFS; > if that's the right thing to do, that's fine. (If so, it seems like > IS_IMMUTABLE -> STATX_ATTR_IMMUTABLE etc could be moved there, too.) The reason I put it in the VFS layer was that the statx was intended to be a VFS indication of the state of the inode. This differs from the FS_XFLAG_DAX which is a state of the on-disk inode. The VFS IS_DAX can be altered by the mount option forcing DAX or no-DAX. So there was a reason for having it at that level. But it is true that only FS's which support DAX will ever set IS_DAX() and having the attribute set near the mask probably makes the code a bit more clear. So I'm not opposed to the patch either. But users can't ever set the flag directly so I'm not sure if it being in the mask is going to confuse anyone. Ira > > -Eric