diff options
Diffstat (limited to 'fs/btrfs/props.c')
-rw-r--r-- | fs/btrfs/props.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c index a9e2e66152ee..e0469816c678 100644 --- a/fs/btrfs/props.c +++ b/fs/btrfs/props.c | |||
@@ -257,11 +257,7 @@ static int prop_compression_validate(const char *value, size_t len) | |||
257 | if (!value) | 257 | if (!value) |
258 | return 0; | 258 | return 0; |
259 | 259 | ||
260 | if (!strncmp("lzo", value, 3)) | 260 | if (btrfs_compress_is_valid_type(value, len)) |
261 | return 0; | ||
262 | else if (!strncmp("zlib", value, 4)) | ||
263 | return 0; | ||
264 | else if (!strncmp("zstd", value, 4)) | ||
265 | return 0; | 261 | return 0; |
266 | 262 | ||
267 | return -EINVAL; | 263 | return -EINVAL; |
@@ -341,7 +337,7 @@ static int inherit_props(struct btrfs_trans_handle *trans, | |||
341 | for (i = 0; i < ARRAY_SIZE(prop_handlers); i++) { | 337 | for (i = 0; i < ARRAY_SIZE(prop_handlers); i++) { |
342 | const struct prop_handler *h = &prop_handlers[i]; | 338 | const struct prop_handler *h = &prop_handlers[i]; |
343 | const char *value; | 339 | const char *value; |
344 | u64 num_bytes; | 340 | u64 num_bytes = 0; |
345 | 341 | ||
346 | if (!h->inheritable) | 342 | if (!h->inheritable) |
347 | continue; | 343 | continue; |