Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1259871pxa; Thu, 20 Aug 2020 07:00:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb/0WdEDUPuJV/83II0IpbNS4vxCzef8m+OFXFLJ3z6/8gEPR4xaBSBmLflmCCwECqUjcf X-Received: by 2002:a17:906:95cb:: with SMTP id n11mr3313473ejy.506.1597932033551; Thu, 20 Aug 2020 07:00:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597932033; cv=none; d=google.com; s=arc-20160816; b=p6KI2yRa+Yt2OVMe/3OjJtmXDKANxaQ7XzcWU3p275IakLxZlO1sV7Q84MIW4ca6j0 5BDpqICfubVa1nBWHJ5xcjzYvshcvO+8guDgcFtR0pZDd+SnYYU+I7jE1O/IzzHih+Af eMZA5XjyS//JtrV/I6Z3wJeSOb4rFcd3NQLIt/KaAy9dZPmu/HgC1aL57i9l50qyi+cr Ykb9iKaNUtPU6wM8nYKu6bXYffl3tdIxesDPx5skG27dpPnqliQa/NJ48kmDFXMh6/p1 QjnOpBnctbyNMr4lw3YdDGoxJ43pR3n+dtFrMbw05nY0LoFDZuhzwpeFSPZS18NCcAln ihjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nRogg+YWLN02CK2sM6kdI+DIDbo3CHg2lnUBVVFyDBA=; b=qGs4vrdzwBB2Z2ySksm1aUvRUDKBcslGWGPIQHYCExiahvGZt12MiYXJyp3KTVOGEu sKQzaLQ15YJ/1c1hiIh/2BZEKWja9Csg9VaQzdCAV0i1/Um6Ph4tbYq8ZjyhqVvQ25KT gdYaulZxGgdbaRU4fFJRV/QnCeK7IDKzvVer7Na2CKDP7VNVoc5P7rdIbosB0SkK5bsy KSrKkn2djugfQiQbTHO79wn7fjbsmNjOuMKsmxUZiOE6L3wIW6Iu0CqyPCn1XT6tNtvo b4k0FMKf7ZZmXai31D9c/uFabJmI+5kLSx11W6bUjvoN8nbO0EvsbSF1332+nVVk7b42 hVCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q9fGYYNj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b31si1329005edf.456.2020.08.20.07.00.08; Thu, 20 Aug 2020 07:00:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q9fGYYNj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731280AbgHTN66 (ORCPT + 99 others); Thu, 20 Aug 2020 09:58:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:33466 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727062AbgHTJZJ (ORCPT ); Thu, 20 Aug 2020 05:25:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2A91822CF6; Thu, 20 Aug 2020 09:25:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597915508; bh=kNgCBFBfSxz7ugVSsubOOTo6lfh4ohoZlx1eQ7qlYBI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q9fGYYNjwmjnGTY7df4M3URxXX6UbpaCYWMcVuKR0hwHuTlK3ZOuFPUglK66hie8k j66eFbe5REQ0pAmyLmapApju9LcGN8ErX8tKgbGOsoVFq5HXom2jk6kO4GRLvaeNyq jg+QQ1y4ySG2H54RCC1cK+QbCEcJJ1xPJdZg3PW8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Sandeen , Josef Bacik , David Sterba Subject: [PATCH 5.8 039/232] btrfs: make sure SB_I_VERSION doesnt get unset by remount Date: Thu, 20 Aug 2020 11:18:10 +0200 Message-Id: <20200820091614.669649341@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200820091612.692383444@linuxfoundation.org> References: <20200820091612.692383444@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Josef Bacik commit faa008899a4db21a2df99833cb4ff6fa67009a20 upstream. There's some inconsistency around SB_I_VERSION handling with mount and remount. Since we don't really want it to be off ever just work around this by making sure we don't get the flag cleared on remount. There's a tiny cpu cost of setting the bit, otherwise all changes to i_version also change some of the times (ctime/mtime) so the inode needs to be synced. We wouldn't save anything by disabling it. Reported-by: Eric Sandeen CC: stable@vger.kernel.org # 5.4+ Signed-off-by: Josef Bacik Reviewed-by: David Sterba [ add perf impact analysis ] Signed-off-by: David Sterba Signed-off-by: Greg Kroah-Hartman --- fs/btrfs/super.c | 6 ++++++ 1 file changed, 6 insertions(+) --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -1897,6 +1897,12 @@ static int btrfs_remount(struct super_bl set_bit(BTRFS_FS_OPEN, &fs_info->flags); } out: + /* + * We need to set SB_I_VERSION here otherwise it'll get cleared by VFS, + * since the absence of the flag means it can be toggled off by remount. + */ + *flags |= SB_I_VERSION; + wake_up_process(fs_info->transaction_kthread); btrfs_remount_cleanup(fs_info, old_opts); return 0;