mirror of
https://github.com/kdave/btrfs-progs
synced 2025-01-22 21:43:35 +00:00
btrfs-progs: fix defrag -c option parsing
The refactoring f3a132fa1b
("btrfs-progs: factor out compression type
name parsing to common utils") caused a bug with parsing option -c with
defrag:
# btrfs fi defrag -v -czstd file
ERROR: unknown compression type: zstd
# btrfs fi defrag -v -clzo file
ERROR: unknown compression type: lzo
# btrfs fi defrag -v -czlib file
ERROR: unknown compression type: zlib
Fix it by properly checking the value representing unknown compression
algorithm.
Issue: #403
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
38f19d161c
commit
61e00694e7
@ -835,7 +835,7 @@ static int parse_compress_type_arg(char *s)
|
||||
int ret;
|
||||
|
||||
ret = parse_compress_type(s);
|
||||
if (ret) {
|
||||
if (ret < 0) {
|
||||
error("unknown compression type: %s", s);
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user