Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7184393rwi; Mon, 24 Oct 2022 10:54:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YQU5CzymduQ6jpHnISaa3MQH5sLYB29aGsZBCCvc1G58CnrIAHSCcLDL0XXd4gwOtUmGX X-Received: by 2002:a05:6402:33c4:b0:448:e63e:4f40 with SMTP id a4-20020a05640233c400b00448e63e4f40mr31536371edc.203.1666634076746; Mon, 24 Oct 2022 10:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666634076; cv=none; d=google.com; s=arc-20160816; b=IjE2s9uNty0J4Z4RrsOJpP63/2Lr1/eswQbKB20dKYoGy2NTpP5DO5F00Rtmprrcsq SHcpChzvqNM2cGhjvojYzKkrQ/wbvI/0EVJMk/Cqm3FFC18jtd5Jbw1v+82vOzUZvgx+ gpcYbD/LW/SrRf70E7Civ8u1eN8jXsefrZrO87GdknkNdknRoiLQzxs7lrvKgsadHB/4 jNRO77YJrACCp6aYMeBUTFc287YusEcVBMjnJ1dTCisoR6Luy/11cSUW57LXO/1Rg/Qm pg7QWi/SQd7HLbPJ2YB9SFtBlgk6jVNH1c1GKMNaFfkHgXAfb4pBfEJZX7ws4KpW1Bqp 6TGw== 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=YRX9CywQfYHtDiEOf04ybrQLD4a+mJqKAkFeiQF9nik=; b=E6V2c1sEXlP6KAHNeyPn1bFdxkv2ATBsS+CfuPvnohfZlfeRxxSDHGi2oJ3KoPwomk YjyPygHP1Hvx72q2K1tz2JsZoba4mKicFfMRJ0sqel4eMwJPr0cZ6BJbq92lhppL08wC 7LhXcaH15T6awsCh7suPufcNBFeQXgLEPF1wk3dErFXUrZ4rGvUoe74Ox//BETzX1XWl beMO7SiWd5V8tZk4RWFfIfl7fLvvUelNpZlMqWgGwK9xcjTiOMQYgwfIQn7FvCwaNELn exXfR0d9alRxxxCihUmOX0hA92F1xf+FUccTRVrHRpkrUBkjVoV3/Fgq8C7Hh/mwK37N PMbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=l5DoLStj; 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 gn33-20020a1709070d2100b0078e15c30a6csi370389ejc.559.2022.10.24.10.54.11; Mon, 24 Oct 2022 10:54:36 -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=l5DoLStj; 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 S233205AbiJXRmY (ORCPT + 99 others); Mon, 24 Oct 2022 13:42:24 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 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 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, 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); @@ -1065,10 +1066,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