Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp913478rwi; Wed, 19 Oct 2022 04:41:10 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4LDGB/TxzGe6bS9yB2ulESFqDSWJ9dDkRFYgaAmGmFkzPxjInGE3DsAjcToioF8+rw+ITp X-Received: by 2002:a65:464b:0:b0:42c:b0:9643 with SMTP id k11-20020a65464b000000b0042c00b09643mr7046239pgr.232.1666179670533; Wed, 19 Oct 2022 04:41:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666179670; cv=none; d=google.com; s=arc-20160816; b=nAt5Xq6M+MTNVnS1q/TDRjU/o4kIGtiKaNoytXzluQd5L71SNyv0AbSTpQyQfLVhto 3QtYpufHqrPWi4TppOHFOXOqKU82NlDxGsNS9ar6QGccGzzuX2aMGWStvRRb5Ne+cdVi l2qQ3AQYmrkx0GV2HOkn5CxX+8BVt7CND2WJgKKZHAVcFjS/fH0SW9dHmqhWt9aKFnZK oxuxRRXRUaS8LTsS8B8tPKCfet5j33ahDlNRuzF+EZSou42BzOsX3axzWK2Ygk0FrsLX FR/xXWV4NlWCrNfppnMKN8uG0q5x9M0dz1oslA7KCYQN1T8NLGk2q/2DaZ8nHPzpY2n2 puVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9daVrU25IW2QpB6wjlBp/YRrdYCBcO5Xn22j+0flm3k=; b=TyjUF/UyXPwrn9GKlBMnpYdIz8CQbLeMbd8HNdw9FSqh5HPhQUJdJuhyypAHU4N8h8 vJuShXvu5wqTpox3zNC2oKGTdR+9KZrc+kcqqHL9fv8CitfJN6Luafmrg/H4Y3DRttgf pcOoMcpx/paoiL/pCDCs9o9yhZxJ3pzR3ajVafk6NVQWwvU4JeOJshikweN+Hecf0nwN XUNnLs5+wWta+coMomBEGmxYahKwKF1PfLDntMqUrC6W8W5B7M7Y1Sz2CxOrRpUaCS0r jiNbbe40wekSUupVhTc/xD3nSjOiJKiVWpoUKgK5b/S3VpMj7+OhEo7p3OoJQ+rFPOMR c4mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fqHoEAJ0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f70-20020a636a49000000b0042b9117b723si17497389pgc.794.2022.10.19.04.40.59; Wed, 19 Oct 2022 04:41:10 -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=@linuxfoundation.org header.s=korg header.b=fqHoEAJ0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231328AbiJSKqO (ORCPT + 99 others); Wed, 19 Oct 2022 06:46:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233089AbiJSKo2 (ORCPT ); Wed, 19 Oct 2022 06:44:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CBA5FF252; Wed, 19 Oct 2022 03:21:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 880CBB8244B; Wed, 19 Oct 2022 08:59:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA4F8C433D6; Wed, 19 Oct 2022 08:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169980; bh=lngLkwhkCFJkeSEPKAQ6CC6D23gJ44NNGtDeFpeiMj4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fqHoEAJ0zo9zQzy9jp4RcGSe/qDMcJFKQ11wRO7Kj80fDcNX4Gf02ySR1IfWaZ6G4 /pWmegeYpbvJkHIrrIZZaX1FjsUNUc/3xFpl2C7CjieLE3x9vC/8B+mWTqDwRd0dT/ sv3+cYdSMjMINmIgaOflHnl2FA/mfOtB4gZdVLhM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Triplett , Lukas Czerner , Theodore Tso , Sasha Levin Subject: [PATCH 6.0 449/862] ext4: dont run ext4lazyinit for read-only filesystems Date: Wed, 19 Oct 2022 10:28:56 +0200 Message-Id: <20221019083309.812535519@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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-kernel@vger.kernel.org From: Josh Triplett [ Upstream commit 426d15ad11419066f7042ffa8fbf1b5c21a1ecbe ] 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 Reviewed-by: Lukas Czerner Link: https://lore.kernel.org/r/48b41da1498fcac3287e2e06b660680646c1c050.1659323972.git.josh@joshtriplett.org Signed-off-by: Theodore Ts'o Signed-off-by: Sasha Levin --- 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 323dbcfd285c..091db733834e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3962,9 +3962,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.35.1