The new snappy code reveals this old bug in btrfs, which happened to
work for LZO.

        # mkfs.btrfs /dev/loop2
        # mount /dev/loop2
        # umount /mnt
        # btrfsck /dev/loop2
        couldn't open because of unsupported option features (10).

The corresponding incompat flag was set, though we didn't mount with
snappy enabled.

Signed-off-by: Li Zefan <l...@cn.fujitsu.com>
---

This patch is for the snappy branch.

---
 fs/btrfs/disk-io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 5924163..27101e4 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2115,9 +2115,9 @@ struct btrfs_root *open_ctree(struct super_block *sb,
 
        features = btrfs_super_incompat_flags(disk_super);
        features |= BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF;
-       if (tree_root->fs_info->compress_type & BTRFS_COMPRESS_LZO)
+       if (tree_root->fs_info->compress_type == BTRFS_COMPRESS_LZO)
                features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO;
-       if (tree_root->fs_info->compress_type & BTRFS_COMPRESS_SNAPPY)
+       if (tree_root->fs_info->compress_type == BTRFS_COMPRESS_SNAPPY)
                features |= BTRFS_FEATURE_INCOMPAT_COMPRESS_SNAPPY;
        btrfs_set_super_incompat_flags(disk_super, features);
 
-- 
1.7.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to