projects
/
linux-2.6-block.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
btrfs: correctly validate compression type
[linux-2.6-block.git]
/
fs
/
btrfs
/
props.c
diff --git
a/fs/btrfs/props.c
b/fs/btrfs/props.c
index a9e2e66152eef7d701eb483cb43f5df56fe8c610..af109c0ba72075f6561a50132f1046a5d22d5c68 100644
(file)
--- 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)
if (!value)
return 0;
- if (!strncmp("lzo", value, 3))
- return 0;
- else if (!strncmp("zlib", value, 4))
- return 0;
- else if (!strncmp("zstd", value, 4))
+ if (btrfs_compress_is_valid_type(value, len))
return 0;
return -EINVAL;