From patchwork Sat Oct 22 07:24:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7559 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1106038wrr; Sat, 22 Oct 2022 01:36:44 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4p4xLFgVJeuYIlHdBDVuhNb5l1mbu4JRJVmoP1YMVXhYi+yxoZ5tvGpLsTT724V9/KMzZK X-Received: by 2002:a05:6a00:1c82:b0:56b:1547:2068 with SMTP id y2-20020a056a001c8200b0056b15472068mr5762367pfw.55.1666427804608; Sat, 22 Oct 2022 01:36:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666427804; cv=none; d=google.com; s=arc-20160816; b=b2NL0c+RnnOSAWFy6vBznMH0r8NYUfLz+vRcvOnKEmra0gSoPSs91j/vVv06Gxdp6Z ww5OGTRgjPTyEeus89MXJuNHgz4fyDGiv9R1/tumpQ9en83AGr3gv6zLyhhigwtYsFDR ycs1MSP3GTP1MM5JjuEoch6jbcuujV12FwC0+3rQj5ym+YOt0pkG/hkX92mrP52psgzX v8X6xSGs+nmladX7KdpB30iV+1HW4hof4TwNggsWuYZFW3WFkdopJOp1/9PucpfcN335 +Vbabbt3Sqj/kT0WJWeitg9hmHFwhP8/JRAltBdI5Btvt1DyFdGgJ5NhojW6PBPg7CMb 8mAQ== 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=czCdAWdjZP1fMUidXkEEtHCrALz/g/OLJkcVi/g8ZG4=; b=yDloRNAN7J2Q1xDWZKADxGC0UFwgHEWaXL05bMJdr8LcncKkEwrKn7dCwBTw+/z0hp IaEsSDNF0UIRIk56l4djizuv3FG6tFMoL4+zKeBw/lNy1WBdYIJMV3EiNltmqEZ67Oz3 KWQsrNsZUhcZ72W6hBaBCrIjHzIyKxnHN5g0IxaAFNbeEoc3wdXxzIjqHD/oYfxdRsCe 6mmapaKvQ/NWS/G+3DSjuBgsiSoZDF3a5hW6EVgvUSSnoqtOxea/g5Z1cxmj3P5PO/fL vOHJy+hWIFS1bbgY/W0w2Q2ZdCbhyAL09VfbQmXz/DYaJHIhvhfIynVkFGtcY++MBpaR DJ4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CzcsI8av; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l135-20020a633e8d000000b00461c9ed73b3si27092697pga.216.2022.10.22.01.36.27; Sat, 22 Oct 2022 01:36:44 -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=CzcsI8av; 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 S233835AbiJVI00 (ORCPT + 99 others); Sat, 22 Oct 2022 04:26:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234117AbiJVIYs (ORCPT ); Sat, 22 Oct 2022 04:24:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6EA4F5D8AE; Sat, 22 Oct 2022 01:00:14 -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 dfw.source.kernel.org (Postfix) with ESMTPS id F104F60B4A; Sat, 22 Oct 2022 07:50:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 128F1C433D7; Sat, 22 Oct 2022 07:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425031; bh=L/44Vb6nN7qL+IsEuzLFOvfeDrQ8j949JtBFWbHdaDQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CzcsI8avuisrdwkN4UkgIikEyRXI3lCpFA/v+rM0LLRiTugd6VUppH7yqTGMCwlnZ CA1vgVa1E42Tz7gLZ7MS98IHZFUohLS8CUBaGWC9l/XONMy0FTiyStlGT4jlz7tKQM 1MWCu6Z79LqDw63gkrWLLOvKH8kxwClKpzuKyFLU= 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 5.19 367/717] ext4: dont run ext4lazyinit for read-only filesystems Date: Sat, 22 Oct 2022 09:24:06 +0200 Message-Id: <20221022072512.863837451@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376201384012592?= X-GMAIL-MSGID: =?utf-8?q?1747376201384012592?= 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 fd358e5f88ff..5cacd513d0df 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -3953,9 +3953,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);