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 14A50C2BA19 for ; Wed, 15 Apr 2020 14:03:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E78E4206A2 for ; Wed, 15 Apr 2020 14:03:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2636402AbgDOOD0 (ORCPT ); Wed, 15 Apr 2020 10:03:26 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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