From 9db2f86060a8e54e80f99e3c3366832ce6a67d76 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 22 Oct 2023 11:33:02 -0400 Subject: bcachefs: Check for too-large encoded extents We don't yet repair (split) them, just check. Signed-off-by: Kent Overstreet --- fs/bcachefs/extents.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/bcachefs/extents.h') diff --git a/fs/bcachefs/extents.h b/fs/bcachefs/extents.h index acf78f55bdff..ef1b9f18719d 100644 --- a/fs/bcachefs/extents.h +++ b/fs/bcachefs/extents.h @@ -190,6 +190,11 @@ static inline bool crc_is_compressed(struct bch_extent_crc_unpacked crc) crc.compression_type != BCH_COMPRESSION_TYPE_incompressible); } +static inline bool crc_is_encoded(struct bch_extent_crc_unpacked crc) +{ + return crc.csum_type != BCH_CSUM_none || crc_is_compressed(crc); +} + /* bkey_ptrs: generically over any key type that has ptrs */ struct bkey_ptrs_c { -- cgit