Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp747858ybz; Wed, 15 Apr 2020 18:05:37 -0700 (PDT) X-Google-Smtp-Source: APiQypJtodJQiaWwTZt2P0hCrprnmOLkFlq6/QQqLObUchnCienBecQEipXJxqbEqHt0Nhpjmoed X-Received: by 2002:a17:906:405a:: with SMTP id y26mr7262846ejj.31.1586999136895; Wed, 15 Apr 2020 18:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586999136; cv=none; d=google.com; s=arc-20160816; b=AWIPOhep8wt7OI3LlAoIb1hntV+QO9yV+2+0P1UhH2k1YRCigSBtTUrky2eYchx/iO MIgYXAg3zT8vQRqzRIDekgpzC7nxrLLpW+Tpc2Lm7jwJITJkT5vrXFu+/8RYElKFcKEx Fu60WYEKuw6qfGVKNklTEAKD1fT3/KN6s0MvZZfIvSoQzhmbHIScoFVXd4tt/RWO/5lI n6l7C7aLbYvRCSqr8VYdqwAnRPcXcgBrg5d1ug9MsHe31QVoukuxU7GEJu+Os/ex17GF AKh82jlcuzUfIB5T1vuJRisL9bthl6aude+suMUYWS+bh6sOg/mQfdZsDKVnOufO29+u ZLxA== 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:ironport-sdr:ironport-sdr; bh=GYbP3AVqokRqY2EO2jhO/UR/05Z/X8ORwhDZMNkE+fc=; b=wwQXqldCMIheQeS/Gb8dcfKl3wXYYNklPK8sFo3U9LHNBifIWCjHz59TnBawR6eWlk m6eGPaKZC7xfrZO+HQzX2zuU59aZXxDNhsWy9aGCR22CspkHrwhNkgknLcXTRtURyxsG nd24LX0iW5icuY3JfiZHMvaAzBdKyERwpOGEQIA05MIOFz4TAV7ul2CeN5+4O+V/UAXS AoeyQfhPCTVNXzD3O4fu7lhc3BC2UlqSYx4+I+vpXm+TTKZj+8W8PbWMb304Xiqg4EQU 98Zp4nr/9J0fLQqVbYapSlV0xT0g1In/IkGGif1ar7gDfTzwY92N+mee0vdK4aAxOxGr MScQ== 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 l61si11626694ede.343.2020.04.15.18.05.12; Wed, 15 Apr 2020 18:05:36 -0700 (PDT) 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 S2442087AbgDOUj0 (ORCPT + 99 others); Wed, 15 Apr 2020 16:39:26 -0400 Received: from mga11.intel.com ([192.55.52.93]:5824 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438376AbgDOUj0 (ORCPT ); Wed, 15 Apr 2020 16:39:26 -0400 IronPort-SDR: YXdlE5sGDTE2nXHPYp4kFm1d1ULAFC95iW/NGpKO3KD8QEyQse0Epkx0/tVgBFWUMZY0e+c20+ 1BMw/cYLxkGg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 13:39:25 -0700 IronPort-SDR: SCt4dNj4WEUs8M1Y/+OmMuJVAREuUDMSfkTCsNZ/iC/VnmW7zYxANvKOU14AxwPNRx9l6aKLI2 fIpf58+6za0A== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,388,1580803200"; d="scan'208";a="245783322" Received: from iweiny-desk2.sc.intel.com ([10.3.52.147]) by fmsmga008.fm.intel.com with ESMTP; 15 Apr 2020 13:39:25 -0700 Date: Wed, 15 Apr 2020 13:39:25 -0700 From: Ira Weiny To: Jan Kara Cc: linux-kernel@vger.kernel.org, "Darrick J. Wong" , Dan Williams , Dave Chinner , Christoph Hellwig , "Theodore Y. Ts'o" , Jeff Moyer , linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH RFC 4/8] fs/ext4: Introduce DAX inode flag Message-ID: <20200415203924.GD2309605@iweiny-DESK2.sc.intel.com> References: <20200414040030.1802884-1-ira.weiny@intel.com> <20200414040030.1802884-5-ira.weiny@intel.com> <20200415120846.GG6126@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200415120846.GG6126@quack2.suse.cz> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Apr 15, 2020 at 02:08:46PM +0200, Jan Kara wrote: > On Mon 13-04-20 21:00:26, ira.weiny@intel.com wrote: > > From: Ira Weiny > > > > Add a flag to preserve FS_XFLAG_DAX in the ext4 inode. > > > > Set the flag to be user visible and changeable. Set the flag to be > > inherited. Allow applications to change the flag at any time. > > > > Finally, on regular files, flag the inode to not be cached to facilitate > > changing S_DAX on the next creation of the inode. > > > > Signed-off-by: Ira Weiny > > --- > > fs/ext4/ext4.h | 13 +++++++++---- > > fs/ext4/ioctl.c | 21 ++++++++++++++++++++- > > 2 files changed, 29 insertions(+), 5 deletions(-) > > > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h > > index 61b37a052052..434021fcec88 100644 > > --- a/fs/ext4/ext4.h > > +++ b/fs/ext4/ext4.h > > @@ -415,13 +415,16 @@ struct flex_groups { > > #define EXT4_VERITY_FL 0x00100000 /* Verity protected inode */ > > #define EXT4_EA_INODE_FL 0x00200000 /* Inode used for large EA */ > > #define EXT4_EOFBLOCKS_FL 0x00400000 /* Blocks allocated beyond EOF */ > > + > > +#define EXT4_DAX_FL 0x00800000 /* Inode is DAX */ > > + > > You seem to be using somewhat older kernel... EXT4_EOFBLOCKS_FL doesn't > exist anymore (but still it's good to leave it reserved for some time so > the value you've chosen is OK). I'm on top of 5.6 released. Did this get removed for 5.7? I've heard there are some boot issues with 5.7-rc1 so I'm holding out for rc2. > > > @@ -813,6 +818,17 @@ static int ext4_ioctl_get_es_cache(struct file *filp, unsigned long arg) > > return error; > > } > > > > +static void ext4_dax_dontcache(struct inode *inode, unsigned int flags) > > +{ > > + struct ext4_inode_info *ei = EXT4_I(inode); > > + > > + if (S_ISDIR(inode->i_mode)) > > + return; > > + > > + if ((ei->i_flags ^ flags) == EXT4_DAX_FL) > > + inode->i_state |= I_DONTCACHE; > > +} > > + > > You probably want to use the function you've introduced in the XFS series > here... you mean: flag_inode_dontcache() ??? Yes that is done. I sent this prior to v8 (where that was added) of the other series... Ira > > Honza > -- > Jan Kara > SUSE Labs, CR