diff options
Diffstat (limited to 'fs/bcachefs/inode.c')
-rw-r--r-- | fs/bcachefs/inode.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c index bb3f443d8381..a3921c397ea2 100644 --- a/fs/bcachefs/inode.c +++ b/fs/bcachefs/inode.c @@ -6,6 +6,7 @@ #include "bkey_methods.h" #include "btree_update.h" #include "buckets.h" +#include "compress.h" #include "error.h" #include "extents.h" #include "extent_update.h" @@ -422,9 +423,10 @@ static int __bch2_inode_invalid(struct bkey_s_c k, struct printbuf *err) return -BCH_ERR_invalid_bkey; } - if (unpacked.bi_compression >= BCH_COMPRESSION_OPT_NR + 1) { - prt_printf(err, "invalid data checksum type (%u >= %u)", - unpacked.bi_compression, BCH_COMPRESSION_OPT_NR + 1); + if (unpacked.bi_compression && + !bch2_compression_opt_valid(unpacked.bi_compression - 1)) { + prt_printf(err, "invalid compression opt %u", + unpacked.bi_compression - 1); return -BCH_ERR_invalid_bkey; } |