return 0;
        }
 
-       if (!strncmp("lzo", value, len))
+       if (!strncmp("lzo", value, 3))
                type = BTRFS_COMPRESS_LZO;
-       else if (!strncmp("zlib", value, len))
+       else if (!strncmp("zlib", value, 4))
                type = BTRFS_COMPRESS_ZLIB;
        else
                return -EINVAL;
 
                                btrfs_test_opt(info, FORCE_COMPRESS);
                        if (token == Opt_compress ||
                            token == Opt_compress_force ||
-                           strcmp(args[0].from, "zlib") == 0) {
+                           strncmp(args[0].from, "zlib", 4) == 0) {
                                compress_type = "zlib";
                                info->compress_type = BTRFS_COMPRESS_ZLIB;
                                btrfs_set_opt(info->mount_opt, COMPRESS);
                                btrfs_clear_opt(info->mount_opt, NODATACOW);
                                btrfs_clear_opt(info->mount_opt, NODATASUM);
                                no_compress = 0;
-                       } else if (strcmp(args[0].from, "lzo") == 0) {
+                       } else if (strncmp(args[0].from, "lzo", 3) == 0) {
                                compress_type = "lzo";
                                info->compress_type = BTRFS_COMPRESS_LZO;
                                btrfs_set_opt(info->mount_opt, COMPRESS);