From nobody Fri Dec 19 19:06:30 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 15684C04A95 for ; Sat, 22 Oct 2022 08:41:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234125AbiJVIlG (ORCPT ); Sat, 22 Oct 2022 04:41:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234553AbiJVIfu (ORCPT ); Sat, 22 Oct 2022 04:35:50 -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 075604D260; Sat, 22 Oct 2022 01:04:50 -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 4ACBF60ADF; Sat, 22 Oct 2022 08:04:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 46681C433D6; Sat, 22 Oct 2022 08:04:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425878; bh=4O5d+EgAI+grdQT/IsMomF8H66EeYR+P3dOvQGe44kc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pp7HeD1k3XnWleu6sWx/oQrb32agnj2l72dqUDPQNv8hpqMIq01ZEjH1kePP5SM3Z 2afNEXpHBwyfyspgV+SZemZvQAmswPFvwjRPNj+FkMvR2KTofQwqFoZcKNGKnW8Q// ikTYAV+oSAmK90HCXI+JNGxHVwAtzKxgGYaBdEmE= 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.19 645/717] btrfs: dont print information about space cache or tree every remount Date: Sat, 22 Oct 2022 09:28:44 +0200 Message-Id: <20221022072526.979757336@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 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 72923496490f..b2a5291e5e4b 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -625,6 +625,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); @@ -1136,10 +1137,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