From: Brett Holman Date: Wed, 13 Oct 2021 03:11:25 +0000 (-0600) Subject: bcachefs: Add a valgrind memcheck hint X-Git-Tag: v6.7-rc1~201^2~1361 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=395576807555fa9ffb2ae038cae1fe2699f85b89;p=thirdparty%2Fkernel%2Flinux.git bcachefs: Add a valgrind memcheck hint Prevent false positives in bch2_varint_decode_fast() Signed-off-by: Brett Holman Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/varint.c b/fs/bcachefs/varint.c index e87da470c5812..5143b603bf67f 100644 --- a/fs/bcachefs/varint.c +++ b/fs/bcachefs/varint.c @@ -5,6 +5,10 @@ #include #include +#ifdef CONFIG_VALGRIND +#include +#endif + #include "varint.h" /** @@ -96,6 +100,9 @@ int bch2_varint_encode_fast(u8 *out, u64 v) */ int bch2_varint_decode_fast(const u8 *in, const u8 *end, u64 *out) { +#ifdef CONFIG_VALGRIND + VALGRIND_MAKE_MEM_DEFINED(in, 8); +#endif u64 v = get_unaligned_le64(in); unsigned bytes = ffz(*in) + 1;