From patchwork Wed Oct 19 08:34:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 5059 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp248120wrs; Wed, 19 Oct 2022 03:42:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7NErlmGA4N4SgAFbyPuF9HxmuGx0PCiv+2bu1FmIXVmaFVnilF/TbH0U08w0LC56EAVRVl X-Received: by 2002:a17:902:e552:b0:179:e795:71c5 with SMTP id n18-20020a170902e55200b00179e79571c5mr7692425plf.57.1666176165142; Wed, 19 Oct 2022 03:42:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666176165; cv=none; d=google.com; s=arc-20160816; b=VhCw63zXyEM2Kn9fM6T4lXsPkV4Ix/SHdhENzeu9kOWz8aUBEedbtRrPShxbLCXcj2 fIBiG0uKz8DEIs6KdhDuY1Jioa38iazQE3dRIW0ZdWKULJ2JRVB+G3C0TNIdd7LTBlG8 poCrvmFov7p3uKqtvDPIokL95pwFkt7NSStcrtIqjDnPK/SX9JNrOT0ZLG3fflcMt1rR oUgXaKq/Enq6wb3fbnkjqhLfRyQexJXlfZ4SvEDKGJ2DfoMSk5lEOdOUa8yb+1YwTnSo LjHJoLZ0e6MTzpjupNVTKgckyKEb19Jw/fAcatfW/uJ/GeBPWHZMiILP03zdobUV9IMp qLjw== 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=0EvDEygCLuUZCrTrNgMNgx9cFo26WxKwScboay1NNeo=; b=Y4g4DsVCwu6Z4QLcAf/QR/FiYYtle7/GKxEme2CeX78itfa6Om6yPfhKI/ibqAamdp Rb9RRJw7a6iwWG/rhEft/10XGi3F5ksfgzBj6tpm/BvG5KuIvvra7VNuEqZ9hG/GgsOI sIkHaHIT3XMWKC4mMCRxRFVoEhEDUAzoUUQu/wCj3ZiC/nPuqtZ/+jCVo8Vq7V41RueQ lr1TYwx+x6S0ZDCxC9dwj6QqvQznHIMlASqDZi6iOSE6269F3jImcYrjSLNRlTgFmffe POqPGAkOJ2sk7fkR3GvQlXU0v+cmrQ1iCiI20kugMIWn1ZK7z1sHMK+FSspNKdRYhfQ4 p81Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TUy8aRCy; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a170902f70700b001841134e3b1si18233485plo.160.2022.10.19.03.42.31; Wed, 19 Oct 2022 03:42:45 -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=TUy8aRCy; 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 S232453AbiJSKmC (ORCPT + 99 others); Wed, 19 Oct 2022 06:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232075AbiJSKlI (ORCPT ); Wed, 19 Oct 2022 06:41:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE509B857; Wed, 19 Oct 2022 03:19:31 -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 165C9B824CF; Wed, 19 Oct 2022 09:14:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DAE6C433D6; Wed, 19 Oct 2022 09:14:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170871; bh=9rEkCfPGF7aTg6XEIPGPG0g/5ewXXcWrs+BmJMl5KNE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TUy8aRCyWwgGZsaFO+dIqZK3VxXyDzDdZu9E8uTSRg2teFs87X45fnFcwc5B9CwN3 Mi9lGAerIl4zyWoiZ4QAP5cml+H+Icw0KNG+/uqsGH9DLIUrHQU7HiHzH61PT0bsYj C/J4RqFdhL0Ya1XvIke89k7OrifWuYnJCjAHqUDE= 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 6.0 786/862] btrfs: dont print information about space cache or tree every remount Date: Wed, 19 Oct 2022 10:34:33 +0200 Message-Id: <20221019083324.642593394@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.4 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747112338299446417?= X-GMAIL-MSGID: =?utf-8?q?1747112338299446417?= 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 6eeb3402b4a2..ad3ce9700eaf 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; }