|
@@ -507,9 +507,18 @@ int btrfs_parse_options(struct btrfs_fs_info *info, char *options,
|
|
token == Opt_compress_force ||
|
|
token == Opt_compress_force ||
|
|
strncmp(args[0].from, "zlib", 4) == 0) {
|
|
strncmp(args[0].from, "zlib", 4) == 0) {
|
|
compress_type = "zlib";
|
|
compress_type = "zlib";
|
|
|
|
+
|
|
info->compress_type = BTRFS_COMPRESS_ZLIB;
|
|
info->compress_type = BTRFS_COMPRESS_ZLIB;
|
|
- info->compress_level =
|
|
|
|
- btrfs_compress_str2level(args[0].from);
|
|
|
|
|
|
+ info->compress_level = BTRFS_ZLIB_DEFAULT_LEVEL;
|
|
|
|
+ /*
|
|
|
|
+ * args[0] contains uninitialized data since
|
|
|
|
+ * for these tokens we don't expect any
|
|
|
|
+ * parameter.
|
|
|
|
+ */
|
|
|
|
+ if (token != Opt_compress &&
|
|
|
|
+ token != Opt_compress_force)
|
|
|
|
+ info->compress_level =
|
|
|
|
+ btrfs_compress_str2level(args[0].from);
|
|
btrfs_set_opt(info->mount_opt, COMPRESS);
|
|
btrfs_set_opt(info->mount_opt, COMPRESS);
|
|
btrfs_clear_opt(info->mount_opt, NODATACOW);
|
|
btrfs_clear_opt(info->mount_opt, NODATACOW);
|
|
btrfs_clear_opt(info->mount_opt, NODATASUM);
|
|
btrfs_clear_opt(info->mount_opt, NODATASUM);
|