Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp1676245pxb; Thu, 7 Oct 2021 12:39:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHQy9ny/XgxmQyOJH8mO8XirsX7NtCL6eOXnjrTCMvuVFy2J1/J6TteoyX/lk7WcU6C4w5 X-Received: by 2002:a17:906:b254:: with SMTP id ce20mr8070885ejb.306.1633635555189; Thu, 07 Oct 2021 12:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633635555; cv=none; d=google.com; s=arc-20160816; b=OmDouSZWVosCYIgWbSgCq9vS5BNPQR8Xp92n+HdZQ/6o28WZfZN9nUfvI1r55bG3JK ez37J6ePgnZoYH5HeSd5R3GuPgc+q65CqkYaSLEFbBfypF49TIJfzTv6trzcYq2Vk3gr 06p6ElR8Deg2VOT7cRi2tBww57iIhFFXVim4zP38HqucXjYDSMIJW346y5B/64SBzbTF wc4bNnicCSZcTOZtedenZ3FkrMUP2yEfUmUYQWqTbtCpD0w0g2xAqlwNaURNBUg66Lp3 XV4MToYZJKrhBVvkEeGfv6yS/SSzF2IxhM+PdeilZOiC4NS/KXAnTHJ/AgJRVOMfwlxW ToJA== 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 :dkim-signature:dkim-signature; bh=bn9jHUhGBy/09SeVT+oXfiBXLQm4zhIk/PLnuS4BfXI=; b=ll+sNaIQV5cDVO2C7HDJxxmbvcaUw8NN/m1n4N7+wqUqbpq8Sp2Zpz+cLfm3RXrBLR xpFjY/74dPntbApzkAwpgB+uWwGHqNWh4lm+6zjNshu04oiQvhl6SW1gjMY/bw6GQSK2 p8WI+CJX5MUBnc9U41XqmumQniPpYL1shtD3WFqYM1407FDbb1LwsV0gx6swkFtzsWmM E1Pcfga+LfcP9j/8HlslV0hrHzYOm2nfMFwuah4Bu8wZtucefVE71zOfnQ+L1cw8Hq5O cw9F6BN1pjDvjmNAorOv2enSHq9z1KAh4WGqwqBraZmnj51V/08mGhKSjrLxGComT000 6sFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="B/xXd3mE"; dkim=neutral (no key) header.i=@suse.cz; 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 j16si392506edj.235.2021.10.07.12.38.51; Thu, 07 Oct 2021 12:39:15 -0700 (PDT) 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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="B/xXd3mE"; dkim=neutral (no key) header.i=@suse.cz; 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 S242138AbhJGOsm (ORCPT + 99 others); Thu, 7 Oct 2021 10:48:42 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:57798 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233419AbhJGOsl (ORCPT ); Thu, 7 Oct 2021 10:48:41 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 1A13D200CA; Thu, 7 Oct 2021 14:46:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1633618007; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bn9jHUhGBy/09SeVT+oXfiBXLQm4zhIk/PLnuS4BfXI=; b=B/xXd3mEz5i39N+aRPpqCSx8dpZC3l3YxzQvpAAzQJ/JuNzH97nq4rXaBGubVqGO/CtkTQ SWV6nwz9TF+X3duxO6WwEvyVVlSmWhwaqBZJEw+u5HY2Eafvwri5A9ZfgfbSp8wxB22C3g vqmjgMO1TUZ/xSV2WFX2aF1Sb5xFhn8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1633618007; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bn9jHUhGBy/09SeVT+oXfiBXLQm4zhIk/PLnuS4BfXI=; b=ML+pYq8+P53uEk51AL6tU6Xo3jdPHvJ1X3hWA591UWgFCiZ54EKDX0ClBt/zTX0f6p4DHE 2ivBMw5ulqfDO0Bg== Received: from quack2.suse.cz (unknown [10.100.224.230]) by relay2.suse.de (Postfix) with ESMTP id 026BAA3B83; Thu, 7 Oct 2021 14:46:47 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D43BF1F2C96; Thu, 7 Oct 2021 16:46:46 +0200 (CEST) Date: Thu, 7 Oct 2021 16:46:46 +0200 From: Jan Kara To: Miklos Szeredi Cc: Chengguang Xu , Jan Kara , Amir Goldstein , linux-fsdevel , overlayfs , linux-kernel Subject: Re: [RFC PATCH v5 06/10] ovl: implement overlayfs' ->write_inode operation Message-ID: <20211007144646.GL12712@quack2.suse.cz> References: <20210923130814.140814-1-cgxu519@mykernel.net> <20210923130814.140814-7-cgxu519@mykernel.net> <17c5aba1fef.c5c03d5825886.6577730832510234905@mykernel.net> <17c5adfe5ea.12f1be94625921.4478415437452327206@mykernel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 07-10-21 15:34:19, Miklos Szeredi wrote: > On Thu, 7 Oct 2021 at 15:10, Chengguang Xu wrote: > > > However that wasn't what I was asking about. AFAICS ->write_inode() > > > won't start write back for dirty pages. Maybe I'm missing something, > > > but there it looks as if nothing will actually trigger writeback for > > > dirty pages in upper inode. > > > > > > > Actually, page writeback on upper inode will be triggered by overlayfs ->writepages and > > overlayfs' ->writepages will be called by vfs writeback function (i.e writeback_sb_inodes). > > Right. > > But wouldn't it be simpler to do this from ->write_inode()? You could but then you'd have to make sure you have I_DIRTY_SYNC always set when I_DIRTY_PAGES is set on the upper inode so that your ->write_inode() callback gets called. Overall I agree the logic would be probably simpler. Honza -- Jan Kara SUSE Labs, CR