From nobody Fri Dec 19 16:01:23 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 243E3C38A2D for ; Mon, 24 Oct 2022 17:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234003AbiJXRm0 (ORCPT ); Mon, 24 Oct 2022 13:42:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232386AbiJXRmD (ORCPT ); Mon, 24 Oct 2022 13:42:03 -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 5A7EB15730; Mon, 24 Oct 2022 09:16:53 -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 3024661342; Mon, 24 Oct 2022 12:53:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 42CB7C433B5; Mon, 24 Oct 2022 12:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666616027; bh=rF0Z1n8ZahFsnQetr8NOszhwHON8zApjpn+DDXx+PWs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l5DoLStjH5KMoK48kF5G7DsG8Ud1nFUVF5kCt2qbjHns3gy2GVo/yTuiQ7snh/1y8 xouShGVKkf2D5hlPKi+abWLL81qbhK2b+cD2VkPNBdq760ACw0l4F4Io0/Em1ziPgL qaizo1BQ6qn0Xi4r6Nh2Wq9sRwY+ZB+9vqSS/FHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Maciej S. Szmigiero" , David Sterba , Sasha Levin Subject: [PATCH 5.15 474/530] btrfs: dont print information about space cache or tree every remount Date: Mon, 24 Oct 2022 13:33:38 +0200 Message-Id: <20221024113106.498269353@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 969bf0724fdf..442fcd1b14a6 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -574,6 +574,7 @@ int btrfs_parse_options(struct btrfs_fs_info *info, cha= r *options, int saved_compress_level; bool saved_compress_force; int no_compress =3D 0; + const bool remounting =3D test_bit(BTRFS_FS_STATE_REMOUNTING, &info->fs_s= tate); =20 if (btrfs_fs_compat_ro(info, FREE_SPACE_TREE)) btrfs_set_opt(info->mount_opt, FREE_SPACE_TREE); @@ -1065,10 +1066,12 @@ int btrfs_parse_options(struct btrfs_fs_info *info,= char *options, } if (!ret) ret =3D 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; } =20 --=20 2.35.1