public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: fix backport of 2175bf57dc952 in 5.4.95
@ 2021-02-22 12:16 David Sterba
  2021-02-22 12:39 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: David Sterba @ 2021-02-22 12:16 UTC (permalink / raw)
  To: stable; +Cc: David Sterba, Wang Yugui, David Sterba

From: David Sterba <dsterba@suse.cz>

There's a mistake in backport of upstream commit 2175bf57dc95 ("btrfs:
fix possible free space tree corruption with online conversion") as
5.4.95 commit e1ae9aab8029.

The enum value BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED has been added to the
wrong enum set, colliding with value of BTRFS_FS_QUOTA_ENABLE. This
could cause problems during the tree conversion, where the quotas
wouldn't be set up properly but the related code executed anyway due to
the bit set.

Link: https://lore.kernel.org/linux-btrfs/20210219111741.95DD.409509F4@e16-tech.com
Reported-by: Wang Yugui <wangyugui@e16-tech.com>
CC: stable@vger.kernel.org # 5.4.95+
Signed-off-by: David Sterba <dsterba@suse.com>
---

This is same fix that went to 5.10.x, with refreshed diff so it applies
cleanly on 5.4.x and with updated references.

 fs/btrfs/ctree.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index cda5534d3d0e..7960359dbc70 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -136,9 +136,6 @@ enum {
 	BTRFS_FS_STATE_DEV_REPLACING,
 	/* The btrfs_fs_info created for self-tests */
 	BTRFS_FS_STATE_DUMMY_FS_INFO,
-
-	/* Indicate that we can't trust the free space tree for caching yet */
-	BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
 };
 
 #define BTRFS_BACKREF_REV_MAX		256
@@ -527,6 +524,9 @@ enum {
 	 * so we don't need to offload checksums to workqueues.
 	 */
 	BTRFS_FS_CSUM_IMPL_FAST,
+
+	/* Indicate that we can't trust the free space tree for caching yet */
+	BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED,
 };
 
 struct btrfs_fs_info {
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] btrfs: fix backport of 2175bf57dc952 in 5.4.95
  2021-02-22 12:16 [PATCH] btrfs: fix backport of 2175bf57dc952 in 5.4.95 David Sterba
@ 2021-02-22 12:39 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-02-22 12:39 UTC (permalink / raw)
  To: David Sterba; +Cc: stable, David Sterba, Wang Yugui

On Mon, Feb 22, 2021 at 01:16:39PM +0100, David Sterba wrote:
> From: David Sterba <dsterba@suse.cz>
> 
> There's a mistake in backport of upstream commit 2175bf57dc95 ("btrfs:
> fix possible free space tree corruption with online conversion") as
> 5.4.95 commit e1ae9aab8029.
> 
> The enum value BTRFS_FS_FREE_SPACE_TREE_UNTRUSTED has been added to the
> wrong enum set, colliding with value of BTRFS_FS_QUOTA_ENABLE. This
> could cause problems during the tree conversion, where the quotas
> wouldn't be set up properly but the related code executed anyway due to
> the bit set.
> 
> Link: https://lore.kernel.org/linux-btrfs/20210219111741.95DD.409509F4@e16-tech.com
> Reported-by: Wang Yugui <wangyugui@e16-tech.com>
> CC: stable@vger.kernel.org # 5.4.95+
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> 
> This is same fix that went to 5.10.x, with refreshed diff so it applies
> cleanly on 5.4.x and with updated references.

Now queued up, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-02-22 15:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-22 12:16 [PATCH] btrfs: fix backport of 2175bf57dc952 in 5.4.95 David Sterba
2021-02-22 12:39 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox