Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3837693rwa; Tue, 23 Aug 2022 11:00:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR5mwEFD7/2BZHYJlTOUDZTrWotwcHDsuqHVx4Sj1LcS0C9Hy1bw+IoAuILJ4R9dFbDh/U+G X-Received: by 2002:a05:6402:540c:b0:434:d965:f8a with SMTP id ev12-20020a056402540c00b00434d9650f8amr4650202edb.30.1661277616300; Tue, 23 Aug 2022 11:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661277616; cv=none; d=google.com; s=arc-20160816; b=SnsXKbdfTQQLd0LNU3Wb7fj3i8TlsTw/t2I7XeKvbaje6JNvcLO/oRET8s0QbGCFTG Ae72/6bdaw8xUNO+40Ln7qpsBxQAhed1nqCBquTn3OxNi9tMhRGRfY8K4xcisfhmn7us /JwzxTNMSsZTNspA0/ljTdU8eeUkIZM0JxeqVXPzc5ixInYG/S3hRU6Ade/CRsBEtkOQ JoBkSAuCx9TS5AFddJIxdeI6gaBA5+PSlKpVI/DBF96UdOfu3P6zw8CIu4G7cm8V3kzR vwqQqpKC9Go/xwZZOoL1XWkxZzcqXARkF8toWcPWJPniD8AAA3k3KBkl6CEUsH0EUq0c x3fw== 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 :message-id:date:subject:cc:to:from; bh=XGhtTgNF6Ja7TI0wyTG7UpXSVANgbc0xdna3c8AP7X4=; b=cDx+eI/bHstAnR9cBXzHEbBc7SfgRGQv3DG3m5S/3YtwwQdwkMji9MlNTPiV08Asy0 ujomMaQ31GmEh2ZEaLqxKFxqCLgE8q43kLmYsWi3FOpSdKF6LmIu7D7lyVM03IbPWsFP y3bTYyei2wObfSSskzmW4FUfjOurkktwZ/JLWkHDaVM2ez9y0qv7DtfNbD128L1SVdf/ QYQJGPDfcEtgVCa7giyGaTvNDNc7aI8vqyDcVcGlWQoV1xLfUzn3VwzM3Bbd/hqW1jKN jzZCAiPkIC7muCZ0+AbvRhWXbNRxIaNffB2EPvvznHMICSrIiXzBMsYrCknW+luiD4uS PIFA== ARC-Authentication-Results: i=1; mx.google.com; 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 nc21-20020a1709071c1500b0073d68cb42f0si295565ejc.717.2022.08.23.10.59.49; Tue, 23 Aug 2022 11:00:16 -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; 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 S229949AbiHWRlE (ORCPT + 99 others); Tue, 23 Aug 2022 13:41:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbiHWRkC (ORCPT ); Tue, 23 Aug 2022 13:40:02 -0400 Received: from vps-vb.mhejs.net (vps-vb.mhejs.net [37.28.154.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03C58870B1 for ; Tue, 23 Aug 2022 08:28:32 -0700 (PDT) Received: from MUA by vps-vb.mhejs.net with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oQVpK-0002EO-De; Tue, 23 Aug 2022 17:28:26 +0200 From: "Maciej S. Szmigiero" To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] btrfs: don't print information about space cache or tree every remount Date: Tue, 23 Aug 2022 17:28:20 +0200 Message-Id: X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 From: "Maciej S. Szmigiero" 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 --- 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 2535f96612856..16fdfaad103da 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; + 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; }