Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp704204ybz; Wed, 15 Apr 2020 17:06:17 -0700 (PDT) X-Google-Smtp-Source: APiQypIs7Gzqz30Trz6ZfH1s5nAuMmv9m8sAJYoZpzvz06PUm0vdkWAnZsnm2m1MY/XBcVrPg9ug X-Received: by 2002:a05:6402:206c:: with SMTP id bd12mr27420499edb.287.1586995577789; Wed, 15 Apr 2020 17:06:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586995577; cv=none; d=google.com; s=arc-20160816; b=TbMsBNsmTUZu++/Ic3Tq4VZa9Zry1m6NkOt1zLp8JGyt66LWKEO65M5xg4VNNQPPeF WdfpzebyjxOKvv+nbVnhl4T0jpxR0P7wRZEz44sfNf4I1aV2zbUvDDB1+yWSCrPPrPkE ie+a5gayn/IQK36HSMe4RvhcaP2MXlWbT1g+ftiZ9c3LX/CL15aK86+WiKH7BqW826Y3 F3fEkbBPfITCDLcNtt5Wv1CgUOcgwdNUR30PS+yiCF6/Q4CXiHK0l5a/SbO+IgDXBNRk iqSM6qXNhvj/ivvppCoNkjd4XIpEJKmhuOOCbWNHjhhfzSbQ/SxSoJ9fFfSkmiPevlDR dHqg== 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=fKr6KiYBbJsaoUoznX61etZ6OZQuBwgEUqFuG0jiaXY=; b=ypiTq0BytAgtWjXQQ6BTi+5stvK2s+EHNpAruOX5nW5lCJRnNwePD5skSzUTiMoXzQ +qfAVVBdqymtFr4MScTT00mhgowfyVRX7ypEioR9xZE0xx2FD3z2R0NCky4/WaJfam6B d3i5+lX2vKMiXMyXO5lsmPh7ppyIj3WKwWRKBjuQkVKfxygayAfJpv908w5CxOxj0pbM cKZWpeDqdzfHg9fk+FxXx3OjaLAHyfLeW+PHDOtntDrtoGyzJfHp7EDLZQ01u/mif3FP JNB6CdScr7Oq9XME7LBOQw9s0MoicJOsjDFR5mvHg3rZgvJiKgSggvkaXfbl3v9kei6c z+hg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d16si7734980edr.480.2020.04.15.17.05.54; Wed, 15 Apr 2020 17:06:17 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2636346AbgDOODO (ORCPT + 99 others); Wed, 15 Apr 2020 10:03:14 -0400 Received: from mx2.suse.de ([195.135.220.15]:39446 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2633990AbgDOODL (ORCPT ); Wed, 15 Apr 2020 10:03:11 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 32C50AFB4; Wed, 15 Apr 2020 14:03:09 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id E8D8F1E1250; Wed, 15 Apr 2020 16:03:08 +0200 (CEST) Date: Wed, 15 Apr 2020 16:03:08 +0200 From: Jan Kara To: ira.weiny@intel.com Cc: linux-kernel@vger.kernel.org, Jan Kara , "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 7/8] fs/ext4: Only change S_DAX on inode load Message-ID: <20200415140308.GJ6126@quack2.suse.cz> References: <20200414040030.1802884-1-ira.weiny@intel.com> <20200414040030.1802884-8-ira.weiny@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200414040030.1802884-8-ira.weiny@intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 13-04-20 21:00:29, ira.weiny@intel.com wrote: > From: Ira Weiny > > To prevent complications with in memory inodes we only set S_DAX on > inode load. FS_XFLAG_DAX can be changed at any time and S_DAX will > change after inode eviction and reload. > > Add init bool to ext4_set_inode_flags() to indicate if the inode is > being newly initialized. > > Assert that S_DAX is not set on an inode which is just being loaded. > @@ -4408,11 +4408,13 @@ static bool ext4_enable_dax(struct inode *inode) > return (flags & EXT4_DAX_FL) == EXT4_DAX_FL; > } > > -void ext4_set_inode_flags(struct inode *inode) > +void ext4_set_inode_flags(struct inode *inode, bool init) > { > unsigned int flags = EXT4_I(inode)->i_flags; > unsigned int new_fl = 0; > > + J_ASSERT(!(IS_DAX(inode) && init)); > + WARN_ON or BUG_ON here? J_ASSERT is for journalling assertions... Otherwise the patch looks good. Honza -- Jan Kara SUSE Labs, CR