Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3920809rwi; Sat, 22 Oct 2022 02:14:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM51Zt+22loIcQDUV1dQJeXvFyfDMAKmpylHW+E1WFGSinuedwilXbe7Ac0pXTK6brXKXf6t X-Received: by 2002:a62:cf81:0:b0:566:e88d:5006 with SMTP id b123-20020a62cf81000000b00566e88d5006mr23475990pfg.86.1666430049250; Sat, 22 Oct 2022 02:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666430049; cv=none; d=google.com; s=arc-20160816; b=nxmCQhSMssAsAEAM3995/oWZlfbP/6n3pkuzB0P79vfXrxJDfzmyY0wm+Rjd1EBOKd dtxKP7LVEfrBkXVhcUpoW7sSeDXhcQIxAV6a2BEqkM9qD+dWX/6roMXAj5yvlO7V8qrL Cc0HOsc6Cma4/0H+P5Qf5an1Jkgz/cTSd77bJpxLgARRnAWoFhrZ8ZZ6RK73zJi9aRj1 Iyd6nwsf7zSMQb449irAPnRBNKbhtxT3FfpojeAdMol/ECVybkDnWIS0HPR9yZZb/SFJ nq5EU40UtyHS2AqeWmkq8SyiZmDyy2fM//HsoWK/MDNBKpsK3o+NMZ22x80PH6Gphnn/ HEhg== 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=8/5WGQOgUtJF04iD3l19K1Z/hBtmCUYVubVnCh/OhSs=; b=mBlFtELyttg2iGS2ycHzZaqQh0KvnOsXJ8b7txJMr+gH4a4CDQDFGPYZpNpd9L2z/Y n0H4x9q9lV00EfIeVSTTZGT4nRxye9vybQXGztWuFMRzh+p1ydK2hUe3x4aN0MGrdi9/ xoUcN4xUVeuenJXgggvuiNS+Nco4qbLBC4K4QN2wTMYb0qGWNJugohedfAEKjm5BeNI2 fn8dREjZrUlxGTPBnn/PqfdYJ5u1RmIkGTR65nbsC0GdYt2gBNPPpTloRGQ8xC2O0nkm V/ZbOZu3cgklAcssEteNSCBFOfUyLbca599c/n+bPaTgL8wMAafsQowlQntRv5Y4Wuge D4OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pp7HeD1k; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t26-20020a63535a000000b0045ce0eba52esi30004146pgl.114.2022.10.22.02.13.56; Sat, 22 Oct 2022 02:14:09 -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=pp7HeD1k; 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 S234420AbiJVIlE (ORCPT + 99 others); Sat, 22 Oct 2022 04:41:04 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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, 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); @@ -1136,10 +1137,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