Btrfs: fix incompat flags setting
PATCH 1/1 Btrfs: fix incompat flags setting
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 <[email protected]>
---
This patch is for the snappy branch.
--- fs/btrfs/disk-io.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/disk-io.c +2 -2
@@ -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);
Signature · 1 line
1.7.3.1