]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
btrfs: fix backport of 2175bf57dc952 in 5.4.95
authorDavid Sterba <dsterba@suse.cz>
Mon, 22 Feb 2021 12:16:39 +0000 (13:16 +0100)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 24 Mar 2021 10:14:38 +0000 (11:14 +0100)
BugLink: https://bugs.launchpad.net/bugs/1918168
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
fs/btrfs/ctree.h

index cda5534d3d0e3b4a3c2373e2885c14fa9e69127a..7960359dbc70018cef1fbb96fb5f935ad0a8c4f1 100644 (file)
@@ -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 {