Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp1739550imn; Sun, 31 Jul 2022 20:32:54 -0700 (PDT) X-Google-Smtp-Source: AA6agR57FSUMP0KO8yjlTg1mpdWXd5toT1aS2wYaKbnNhrZgaQUkXov/l4tWx/yT4ZP6b7f2kAw4 X-Received: by 2002:a17:902:eb85:b0:16e:cea9:39b6 with SMTP id q5-20020a170902eb8500b0016ecea939b6mr8689846plg.52.1659324773933; Sun, 31 Jul 2022 20:32:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659324773; cv=none; d=google.com; s=arc-20160816; b=RPkve3bTBxG3wLgIaUNsP7qpQ3+vhhTyE2OZF8OENVO1S1oGvFmqPw7HH7m+Ah/PD0 TKPStVsAzXY27S88M8+Ue1QyG2/YfLOy6/4C4MOIMaLxDwIJvijMkgRT7+llzOBzULEL GTdwHbwKNIkIEUhJcBqukA5awwF05aT22EOS/21Bft4ALGV0XH0lOHgtsTp+dkSv+gbT 3CL+KGXRI4K3mqdCnCqZ9GbLOU35q10UAqzgmg7I2jeXkzZWppqm39BJalZv3vtzy7Af q7KA2cov1r0pQOw1hM/FuDUcy6rSxTzXcXROTF8hfAilaO16zYChTETluyI3C/DRJ59Z 11gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:feedback-id:dkim-signature:dkim-signature; bh=gMZgdyYp8cFAC5VD+4qabL5nDDePRou6YT7DYrrfPjI=; b=S25PeayQ8Ln+kHV1VGlnPxCgEKhSkH8m5XefDMJSzmcLQ+nHZF2A3NH86mHq0tzDBD yd7f7A7zgI3vivQAgqGrrGhbTgh/iZWJpiN47NGY+iDCraaR2gafom9QgL6E18bgFbkR QfGL/QptQ/Er8FwaYpg8X0J2y+JxssoA9BaO4SBJFzrX1XDLtfNC2XP+Mh66SbDDMhaE 2q8osHJbstTD8h/SO693qcMzQ7OiHb2mO5ChiYd4Cdp03BMB80HS4yH6sm9yHPG02XdO 4faOK4AKO6F/tzcv0I2RK6P4kEG38+ryB3utOkfu/QP5ra+jGKXA48/bcyFTpJ+TSVKx +bKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joshtriplett.org header.s=fm2 header.b=cOU1dy4e; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=tPwRgE+P; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-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 t62-20020a638141000000b0041b8f2bd530si3789546pgd.217.2022.07.31.20.32.32; Sun, 31 Jul 2022 20:32:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@joshtriplett.org header.s=fm2 header.b=cOU1dy4e; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=tPwRgE+P; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237876AbiHADZA (ORCPT + 99 others); Sun, 31 Jul 2022 23:25:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237074AbiHADY6 (ORCPT ); Sun, 31 Jul 2022 23:24:58 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C3AB65B1; Sun, 31 Jul 2022 20:24:56 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B1E785C00A3; Sun, 31 Jul 2022 23:24:55 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 31 Jul 2022 23:24:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= joshtriplett.org; h=cc:cc:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm2; t=1659324295; x=1659410695; bh=gMZgdyYp8c FAC5VD+4qabL5nDDePRou6YT7DYrrfPjI=; b=cOU1dy4e8cSqv41xnwzteNFNTM yLE3XusVWrc5D34bS8wI8UVs2plXSb9iuRTBydERXAlTqQi4MRp0ZPBOGRNGgi+c Web5EEeo514X0BI3sQ00PIGxwlto7di0tdXlS+D7i8ZgpzdpTHby96nOffG5jspa VhD9Il85hJriaZ2W0SDiQAcqv9vWt7HyVmaAzmBYTrMqf6Ri9Pu3WqY4XKnj5zM0 Sb9082pKnqiCkyKnC3OLCWCTtfCxhvlX9tHhWWOBZDaO8wBy/hE0GUUye8aomAXH f6e32YK4blQFiuC+5IVLtGyyXL/rHRihrjM/GoS4vOnmOYUe3siQi+1nvelA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:mime-version :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1659324295; x= 1659410695; bh=gMZgdyYp8cFAC5VD+4qabL5nDDePRou6YT7DYrrfPjI=; b=t PwRgE+PoeSiq4n7416AuxSOid+gooUjbYYiYkeHsncZvHfQBdstXrGzbsa92uGq8 piVNLSRVZKHvmaLRGE1DSIeCmlRQ34cgm/2hLyGEE5bufq1o7iNvFPbgOGk59rto YvLsAsKueVvZ0TekZCAOn2YNLMWRrMz6NCvOyylilHPlZGDPvHx2JQMYkyMbM5ru cjOIu0jN2Q5slDhlG5JGWX17LJ975J9IffLvVkRV38vRS3IcgWOXYMBX2prpMDSF rYXqsX4k8yIb5/Ta1yZ04hBiF81t0wy5Ff4aRI2uS/G66rC6FXArFVMzEtn7NhAZ mAQlSsUrxEfxjiMp/rqyA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddvvddgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvvefukfggtggusehttdertd dttddvnecuhfhrohhmpeflohhshhcuvfhrihhplhgvthhtuceojhhoshhhsehjohhshhht rhhiphhlvghtthdrohhrgheqnecuggftrfgrthhtvghrnhepuddvleehtedtgfdvvdelge eufedugeduveffkeejgefffedvieekhedvheelkefhnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepjhhoshhhsehjohhshhhtrhhiphhlvghtth drohhrgh X-ME-Proxy: Feedback-ID: i83e94755:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 31 Jul 2022 23:24:54 -0400 (EDT) Date: Sun, 31 Jul 2022 20:24:53 -0700 From: Josh Triplett To: Theodore Ts'o , Andreas Dilger Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ext4: Don't run ext4lazyinit for read-only filesystems Message-ID: <48b41da1498fcac3287e2e06b660680646c1c050.1659323972.git.josh@joshtriplett.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS 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-ext4@vger.kernel.org On a read-only filesystem, we won't invoke the block allocator, so we don't need to prefetch the block bitmaps. This avoids starting and running the ext4lazyinit thread at all on a system with no read-write ext4 filesystems (for instance, a container VM with read-only filesystems underneath an overlayfs). Fixes: 21175ca434c5 ("ext4: make prefetch_block_bitmaps default") Signed-off-by: Josh Triplett --- Tested in a VM, with a read-only ext4 root filesystem. Confirmed that ext4lazyinit starts without this patch, and does not start with this patch. (For a future merge window, not the current one. Please let me know if I need to re-send this at a later, more convenient time.) fs/ext4/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 845f2f8aee5f..20437acc8865 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3973,9 +3973,9 @@ int ext4_register_li_request(struct super_block *sb, goto out; } - if (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) && - (first_not_zeroed == ngroups || sb_rdonly(sb) || - !test_opt(sb, INIT_INODE_TABLE))) + if (sb_rdonly(sb) || + (test_opt(sb, NO_PREFETCH_BLOCK_BITMAPS) && + (first_not_zeroed == ngroups || !test_opt(sb, INIT_INODE_TABLE)))) goto out; elr = ext4_li_request_new(sb, first_not_zeroed); -- 2.36.1