diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-04-11 14:19:02 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-04-11 14:19:02 -0700 |
| commit | 2d06b235815e6bd20395f3db9ada786a6f7a876e (patch) | |
| tree | 38dd49f6dabc62a8daa8c59243f148c955a7bc56 /fs/btrfs/props.c | |
| parent | 582549e3fbe137eb6ce9be591aca25c2222a36b4 (diff) | |
| parent | 272e5326c7837697882ce3162029ba893059b616 (diff) | |
| download | linux-2d06b235815e6bd20395f3db9ada786a6f7a876e.tar.gz linux-2d06b235815e6bd20395f3db9ada786a6f7a876e.tar.bz2 linux-2d06b235815e6bd20395f3db9ada786a6f7a876e.zip | |
Merge tag 'for-5.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
Pull btrfs fixes from David Sterba:
- fix parsing of compression algorithm when set as a inode property,
this could end up with eg. 'zst' or 'zli' in the value
- don't allow trim on a filesystem with unreplayed log, this could
cause data loss if there are pending updates to the block groups that
would not be subject to trim after replay
* tag 'for-5.1-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
btrfs: prop: fix vanished compression property after failed set
btrfs: prop: fix zstd compression parameter validation
Btrfs: do not allow trimming when a fs is mounted with the nologreplay option
Diffstat (limited to 'fs/btrfs/props.c')
| -rw-r--r-- | fs/btrfs/props.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/btrfs/props.c b/fs/btrfs/props.c index dc6140013ae8..61d22a56c0ba 100644 --- a/fs/btrfs/props.c +++ b/fs/btrfs/props.c @@ -366,11 +366,11 @@ int btrfs_subvol_inherit_props(struct btrfs_trans_handle *trans, static int prop_compression_validate(const char *value, size_t len) { - if (!strncmp("lzo", value, len)) + if (!strncmp("lzo", value, 3)) return 0; - else if (!strncmp("zlib", value, len)) + else if (!strncmp("zlib", value, 4)) return 0; - else if (!strncmp("zstd", value, len)) + else if (!strncmp("zstd", value, 4)) return 0; return -EINVAL; @@ -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 { |
