From patchwork Sat Oct 22 07:28:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7653 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1107930wrr; Sat, 22 Oct 2022 01:42:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6kF7LQLzwTQbyea2CXGWI9OYF9K80iHt1ZhHE/3WtePBLxmMAnBW/FtSLWyRlFbBhrwl3J X-Received: by 2002:a05:6402:2146:b0:458:15d7:b99a with SMTP id bq6-20020a056402214600b0045815d7b99amr21437404edb.24.1666428153007; Sat, 22 Oct 2022 01:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428153; cv=none; d=google.com; s=arc-20160816; b=aHJye7n0oAk5XG/uQGKRsjClfSXqCZVRsyps3u62vbNgZ6nlR8QqX1VbfE0teMFWGr +SKCGj6613QLnC8sn0vCLxqekNHpIKpCbq30ap50Lfq7FPjjF1HD4mNQSpQww1+92SeB TAeDQW3KG3DMniiB6IEyiMBW/qE+AzfY/4T6lmHogI0aYnkcn2KuTEUVIT4DGAqbCQxs bReI0H+BZX7yNWFgqgthmFCoi0tHlfsAtGxXZ5MsNKjXWoHYo9OTSWzbhAb8UiGU/jeQ qnfWMvhnvPId2nuTx3tl/iwdU2gijOGShu9Z+0aM2T/7+GTOFhZEJvZiw6IY3+YEGt+M lheQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd35-20020a17090796a300b0078df86528d3si24857189ejc.99.2022.10.22.01.42.08; Sat, 22 Oct 2022 01:42:32 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376567009152160?= X-GMAIL-MSGID: =?utf-8?q?1747376567009152160?= 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; }