Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp346306iog; Wed, 15 Jun 2022 03:33:25 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sdaqLkheOrCW5A7zT8Ny+JH+ZfTY+G/J/Lh7CRD8MXVDUOL3bYEKvYlgrAzbygVoifPTPg X-Received: by 2002:a17:902:d4d1:b0:167:8b6c:5254 with SMTP id o17-20020a170902d4d100b001678b6c5254mr8624082plg.142.1655289205698; Wed, 15 Jun 2022 03:33:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655289205; cv=none; d=google.com; s=arc-20160816; b=ONLMJC9A6iMOftIt+FnnNT5CibvQDhy2Kwl2N1h2vOr47vAmuznkMp6BmFdf3h6OQj WwucZ4KAYoW88q3gaoJkV4GVaB97lSosj/c6/1djI48z1KtessFqXPrPMEOxTm12/pzS 6BhCoc2U5t5/jqJXs6oxITzB7gULUQ+jeI9NaWSaG0NCBjNmUQdfI8nRx2Bw92uFkixr LMg2SwsSm5l727+mQ51CInBE4O/lP5dlSDgb+nwbAQ7sYWDPOyq2DBwzne/fs7JjbSSI jMQTVGVfZ+B/P0Y/3EgT7cdrCh4KQ2FUQEr4ENmOII5TU65RjK8mIUsF7DzZGo78l7df OM/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=tBBtOz7K9YiymUBEHKlogoH1FpxY6bRraUxdMFY2N0c=; b=xGqjaB/Qpg4LJ9zpyp3loutrypxN/GUCBybZay+Cyvja1E5lrmcnrpBFFjLoX3XjDP NC0EUeuLTkJ2oskJdrOQAc3XbmDSq+wHfGUUIv+9cLD5tStZFCqUP1qDBmETbizs6ICC /ayI86jTZ7Qd3aWPdvLcSb4vIR/vDgy1XRNZ3u2B/g0Q0IR/Lh6OAHsIINxthkCYdQeh zJpSBBYSDE+8RTPuQEBCPwCH22bU7X8pQ+QjFzgYD6c4azJw44v8tzn8/MOTlaUdlyRM bj6OmntdA14ZJ8Fh33aAXMiRnRARjLOYroRj5df8TmOs/cv2uq5FY4KY7ue0si2EuNwW UErA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=If4+KDuy; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=E4D+smZT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o62-20020a17090a0a4400b001df8cee9818si1874620pjo.173.2022.06.15.03.33.12; Wed, 15 Jun 2022 03:33:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=If4+KDuy; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=E4D+smZT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347230AbiFOKEn (ORCPT + 99 others); Wed, 15 Jun 2022 06:04:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347207AbiFOKEl (ORCPT ); Wed, 15 Jun 2022 06:04:41 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AA473BBF9; Wed, 15 Jun 2022 03:04:40 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 060A31F8AA; Wed, 15 Jun 2022 10:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1655287479; 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=tBBtOz7K9YiymUBEHKlogoH1FpxY6bRraUxdMFY2N0c=; b=If4+KDuyGJu6SvM4LbZs1XQBCpPWPa2oAQf8dXy1jPIccOYPsl2PlLFgfHXVX28p3jqFfx uHO2QEqgthieowR8BKU9w4RjGknoREGp39LjK0cW00OxWxXs26/RIdq3YxiGdFLe4Xvn5T fwqhgZ3bOVmLdoXWqkMtNXEDb+VJSBU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1655287479; 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=tBBtOz7K9YiymUBEHKlogoH1FpxY6bRraUxdMFY2N0c=; b=E4D+smZTgJuutRiSSDt+Et9RgerzFxvY90ADS4ZJNe8UmyrvtISuN7HiZrvSZMF/oI6z4+ g6gbbU6U2+ouvlBQ== Received: from quack3.suse.cz (unknown [10.163.28.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8616B2C141; Wed, 15 Jun 2022 10:04:38 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id B8BF9A062E; Wed, 15 Jun 2022 12:04:32 +0200 (CEST) Date: Wed, 15 Jun 2022 12:04:32 +0200 From: Jan Kara To: Linus Torvalds Cc: Thomas Backlund , Jan Kara , Suzuki K Poulose , Greg Kroah-Hartman , Guenter Roeck , Linux Kernel Mailing List , stable , Andrew Morton , Shuah Khan , patches@kernelci.org, lkft-triage@lists.linaro.org, Pavel Machek , Jon Hunter , Florian Fainelli , Sudip Mukherjee , Slade Watkins Subject: Re: [PATCH 5.15 000/251] 5.15.47-rc2 review Message-ID: <20220615100432.gd7jeeyjk3qyayyi@quack3.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 14-06-22 11:51:35, Linus Torvalds wrote: > On Tue, Jun 14, 2022 at 11:20 AM Thomas Backlund wrote: > > > > I "think" this is the suggested fix: > > > > https://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git/commit/?h=for_next&id=46b6418e26c7c26f98ff9c2c2310bce5ae2aa4dd > > Ugh, this is just too ugly for words. > > That's not a fix. That's a "hide the problem" patch. I agree it is papering over the real problem. I consider that a stopgap solution so that machines can boot until we find a cleaner solution. > Now, admittedly clearly the "hide the problem" code already existed, > and was just moved earlier, but I really think this whole "we're > calling __mark_inode_dirty() on an inode that isn't even *initialized* > yet" is a much deeper issue, and shouldn't have some hacky work-around > in __mark_inode_dirty() that just happens to make it work. > > I don't mind that patch per se - moving the code is fine. > > But I *do* mind the patch when the reason is to hide that wrong > ordering of operations. > > Now, maybe a proper fix might be to say that new_inode_pseudo() should > always initialize i_state to I_DIRTY_ALL or something like that. The > comment already says that they cannot participate in writeback, so > maybe they should be disabled that way (ie a pseudo inode is always > dirty and marking it dirty does nothing). Sadly it is not so simple. Firstly, new_inode_pseudo() gets used for all inodes (through new_inode()), secondly, tmpfs allocates fully standard inodes through new_inode() as any other filesystem. We could check writeback capabilities of the sb->s_bdi in new_inode_pseudo() but that would not work for inodes that will become block device inodes because blockdev_superblock has noop_backing_dev_info so we'd have to specialcase that. Overall it looks a bit hairy to my taste. > And then you get rid of the noop_backing_dev_info entirely. And this would be even more difficult because there are other places that expect there's *some* bdi associated with each sb. > Or just make sure that noop_backing_dev_info is fully initialized > before it's used. > > Because I think the real problem here is that things have a pointer to > an uninitialized backing_dev_info. I fully agree with this. IMHO we need to initialize noop_backing_dev_info earlier but early init is not exactly my comfort zone so I have to verify whether various stuff in cgwb_bdi_init() is safe to call so early... Honza -- Jan Kara SUSE Labs, CR