btrfs: prop: fix zstd compression parameter validation
[sfrench/cifs-2.6.git] / fs / btrfs / props.c
index dc6140013ae8194739a8aa6a387f12c35794bdf9..fd19f3078566755ffe540ee209ff6b9a3b531bc1 100644 (file)
@@ -396,7 +396,7 @@ static int prop_compression_apply(struct inode *inode,
                btrfs_set_fs_incompat(fs_info, COMPRESS_LZO);
        } else if (!strncmp("zlib", value, 4)) {
                type = BTRFS_COMPRESS_ZLIB;
-       } else if (!strncmp("zstd", value, len)) {
+       } else if (!strncmp("zstd", value, 4)) {
                type = BTRFS_COMPRESS_ZSTD;
                btrfs_set_fs_incompat(fs_info, COMPRESS_ZSTD);
        } else {