Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2412566rwi; Tue, 11 Oct 2022 08:28:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6DzljMB1XF4JutXmEJfOOUDtEah7rhW1CiY0g2CMm6e7iBk+iWF/mjZVTxlkuQ5VisdpTh X-Received: by 2002:a17:902:e54e:b0:184:888:1803 with SMTP id n14-20020a170902e54e00b0018408881803mr1662156plf.71.1665502130231; Tue, 11 Oct 2022 08:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665502130; cv=none; d=google.com; s=arc-20160816; b=CW+JS+OuiWQ822JnrMOnCUjb2EDqlbsqXpJKydDK7FURgVsHnFK9h9UestdKv8TMe2 2sYKur+r/Nb6KqeWbRnosvxpUXRL3nhwlcKVUyr4s6lJM1fS7mrPpOUMqoHMWUkT5SSc Z1uc4WOANystuXF/iNK8XX0ntdZHCRE8hnnUXXTsjRL8SxV4NDLZibTuJD8AzRai1Kx1 j3XdQax1KRkWK7eayn3wCoIyJ3lNdztNJve2v8NhTxZyyeKvbepJMu2HSlxaUt4YUG5e Q0I8Xriw+zGhgs/qGYP3zCTxbY9M4DO+wdg5V9keJFgMP1xfUeY9T/Hd6wisIUu/BQbH GRCw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SzW6Jypqm69oNB2k7dil18Pm6vWbnCLxtkR+QsL47Ds=; b=SFWRj0nnr85/L20P/VE8MgsNv023/QmgW2BqwZmjVkuUmZTzc4EjKVJCwMmm39bBcL Xz5TEw16wk2rDoxZ+nFgLSLZaqoD+DYJxmpbdRop84Xur7ox++lf4f60aOamaVpU5KUc ns5Q4AnbUXlUEELdq06aD3hw6ojlRwZLhZI7BUI2fFjisIohcWC2c2c5VYupz6EUVmnd tmBx83YSU0OYctoK0UD37o8rCN3rAeP/BfP4CpdDgCQCnwX5d3Zop3Yxt0CA0129fr0L N4Q9r8agRFjWSUhoZwM6ZQ0LZsYo3ul1KoFfkgX3l1bF44VJVSqZch9KC+XEmkk9gV6f 2ATg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TStrIjKk; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j2-20020a634a42000000b0043a256f5b17si15348585pgl.555.2022.10.11.08.28.37; Tue, 11 Oct 2022 08:28:50 -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=@kernel.org header.s=k20201202 header.b=TStrIjKk; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230352AbiJKOx4 (ORCPT + 99 others); Tue, 11 Oct 2022 10:53:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230208AbiJKOwd (ORCPT ); Tue, 11 Oct 2022 10:52:33 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 433916B8F3; Tue, 11 Oct 2022 07:51: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 ams.source.kernel.org (Postfix) with ESMTPS id A6335B811F5; Tue, 11 Oct 2022 14:51:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8C219C433D6; Tue, 11 Oct 2022 14:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665499869; bh=m8AjujuI84mFQB5vrcRAbz/2Sxf94CEzaFq6piOQRPE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TStrIjKkgkbYGvskBkJzSJXN8TKYS7YggZhyfOh8mVocRq8rivTCEGqDYhqKZKoVt KftjaDcu7Vj6+G9nypEVHXwjttR3xf0LZWEwiLFx6Amb2Gx6/vKryJ3zwfXhIxZdnW QCuOtGlK6Z/26mtVEvNMPCJPHYVSmgRLKJRbmuTlTQlt/bjD5W8alaJOrNazhPAcDn jS6Z1RCJc5sfB0tRPDNL8tjFToQKK5T8fp3x9ZzvHP4KmmywEoH8cQplgyJQOPDuj2 7ai6khp9lWWujs+wapsfqz0XwInO4v1okiRraxgUTO71quiBp1bbRdQKU81gT+YKfY mpte3I4WwPBYA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: "Maciej S. Szmigiero" , David Sterba , Sasha Levin , clm@fb.com, josef@toxicpanda.com, linux-btrfs@vger.kernel.org Subject: [PATCH AUTOSEL 6.0 34/46] btrfs: don't print information about space cache or tree every remount Date: Tue, 11 Oct 2022 10:50:02 -0400 Message-Id: <20221011145015.1622882-34-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221011145015.1622882-1-sashal@kernel.org> References: <20221011145015.1622882-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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: "Maciej S. Szmigiero" [ Upstream commit dbecac26630014d336a8e5ea67096ff18210fb9c ] btrfs currently prints information about space cache or free space tree being in use on every remount, regardless whether such remount actually enabled or disabled one of these features. This is actually unnecessary since providing remount options changing the state of these features will explicitly print the appropriate notice. Let's instead print such unconditional information just on an initial mount to avoid filling the kernel log when, for example, laptop-mode-tools remount the fs on some events. Signed-off-by: Maciej S. Szmigiero Reviewed-by: David Sterba Signed-off-by: David Sterba Signed-off-by: Sasha Levin --- fs/btrfs/super.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index f89beac3c665..f1c6ca59299e 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -626,6 +626,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options, int saved_compress_level; bool saved_compress_force; int no_compress = 0; + const bool remounting = test_bit(BTRFS_FS_STATE_REMOUNTING, &info->fs_state); if (btrfs_fs_compat_ro(info, FREE_SPACE_TREE)) btrfs_set_opt(info->mount_opt, FREE_SPACE_TREE); @@ -1137,10 +1138,12 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options, } if (!ret) ret = btrfs_check_mountopts_zoned(info); - if (!ret && btrfs_test_opt(info, SPACE_CACHE)) - btrfs_info(info, "disk space caching is enabled"); - if (!ret && btrfs_test_opt(info, FREE_SPACE_TREE)) - btrfs_info(info, "using free space tree"); + if (!ret && !remounting) { + if (btrfs_test_opt(info, SPACE_CACHE)) + btrfs_info(info, "disk space caching is enabled"); + if (btrfs_test_opt(info, FREE_SPACE_TREE)) + btrfs_info(info, "using free space tree"); + } return ret; } -- 2.35.1