Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1525776pxb; Thu, 4 Mar 2021 13:45:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5yk0uRQRuZ4rcacLhvlRIlv5sq3fS0ajlQclrj6/e37kx8SmdTfEfYF+lVaH/I6Q6KrAL X-Received: by 2002:a17:906:c007:: with SMTP id e7mr6595640ejz.518.1614894324064; Thu, 04 Mar 2021 13:45:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614894324; cv=none; d=google.com; s=arc-20160816; b=n6P7zK8xAikRuJOfZwkC1CcuWWkcKn1dC+1vO6J0WPpEzOCXX4RzjT594+G/uuGlcT hnhb+ELJVa2fENmymIAXtjdWoaqGbVFxHWdkBQBJhzJd6JHuFe2so+uF7cYmo7kjflrB P+lCHvEbY9sT8juWb/JFT7a5NtFBgdQqFV3Ws5CygKiEjfkwkkJAdpL9euEOSb05h19r Tv2G7D73yx9HIC7MzcT0yabdVMlhzm39rVuc41gEAt0+6sWTWm02C089NS5y5OFagb6e zN6Kwlqc33PvGlS3HsSXaGNnEYbw9LMZlBbmKfJ/RH54IuvQPmYHKbEluDv/OIQU8wwY OSzg== 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; bh=WRuuvE5cS0sB2/59ltrFXmzHwQMttJZSOgebLiC6WnU=; b=GKDH4TRbRi8fCnHUwrHZA9KsdWdz4n9P7no1Ooy/feF03UO/7N0auuOydzXAGuKXOr 5xJe5eKieWXTSiOh9yeQi8Nt5KlPMiIDpQ2mX6oTAnc0xrVhMnAVoCcLl2ti4490/03l zAlmdEClynvUkk9CRyNdc4ZN9xmKMSDEL/Q090xSlBaG+Z6Bj2ww26vRcWPc+S0lZaHI dq9DbEOOVsJF5APKDRRrXQAZELCXgc0LNjgNHexJdfqZbULhj3hO1icl9BSWfTiTKlgG SpoD8AgrS9iR6ffijl3+5cpj7du9DcRGP8Te7euf8Ngxgkt3Q4+tUgCk3WrLNg5cMa7b KQbg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 v21si264198ejg.258.2021.03.04.13.45.01; Thu, 04 Mar 2021 13:45:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241010AbhCCOSu (ORCPT + 99 others); Wed, 3 Mar 2021 09:18:50 -0500 Received: from verein.lst.de ([213.95.11.211]:36063 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1842937AbhCCKWo (ORCPT ); Wed, 3 Mar 2021 05:22:44 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id 4F89968CFE; Wed, 3 Mar 2021 10:44:54 +0100 (CET) Date: Wed, 3 Mar 2021 10:44:54 +0100 From: Christoph Hellwig To: "ruansy.fnst@fujitsu.com" Cc: Christoph Hellwig , "linux-kernel@vger.kernel.org" , "linux-xfs@vger.kernel.org" , "linux-nvdimm@lists.01.org" , "linux-fsdevel@vger.kernel.org" , "darrick.wong@oracle.com" , "dan.j.williams@intel.com" , "willy@infradead.org" , "jack@suse.cz" , "viro@zeniv.linux.org.uk" , "linux-btrfs@vger.kernel.org" , "ocfs2-devel@oss.oracle.com" , "david@fromorbit.com" , "rgoldwyn@suse.de" , Goldwyn Rodrigues Subject: Re: [PATCH v2 05/10] fsdax: Replace mmap entry in case of CoW Message-ID: <20210303094454.GA15967@lst.de> References: <20210226002030.653855-1-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 03, 2021 at 09:41:54AM +0000, ruansy.fnst@fujitsu.com wrote: > > > > > > > if (dirty) > > > __mark_inode_dirty(mapping->host, I_DIRTY_PAGES); > > > > I still think the __mark_inode_dirty should just be moved into the one > > caller that needs it. > > I found that the dirty flag will be used in the next few lines, so I keep > this function inside. If I move it outside, the drity flag should be passed > in as well. > > @@ -774,6 +780,9 @@ static void *dax_insert_entry(struct xa_state *xas, > if (dirty) > xas_set_mark(xas, PAGECACHE_TAG_DIRTY); > > + if (cow) > + xas_set_mark(xas, PAGECACHE_TAG_TOWRITE); > + > xas_unlock_irq(xas); > return entry; > } > > > So, may I ask what's your purpose for doing in that way? Oh, true. We can't just move that out as the xas needs to stay locked.