diff options
author | Brett Holman <bholman.devel@gmail.com> | 2021-10-12 21:11:25 -0600 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:13 -0400 |
commit | 395576807555fa9ffb2ae038cae1fe2699f85b89 (patch) | |
tree | e8c04bbec28dda1aa125305d3f0e57dbd4a2d425 /fs/bcachefs/varint.c | |
parent | e8bde78a178798a414289f2ad5c1f015d8d53139 (diff) | |
download | lwn-395576807555fa9ffb2ae038cae1fe2699f85b89.tar.gz lwn-395576807555fa9ffb2ae038cae1fe2699f85b89.zip |
bcachefs: Add a valgrind memcheck hint
Prevent false positives in bch2_varint_decode_fast()
Signed-off-by: Brett Holman <bholman.devel@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/varint.c')
-rw-r--r-- | fs/bcachefs/varint.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/bcachefs/varint.c b/fs/bcachefs/varint.c index e87da470c581..5143b603bf67 100644 --- a/fs/bcachefs/varint.c +++ b/fs/bcachefs/varint.c @@ -5,6 +5,10 @@ #include <linux/string.h> #include <asm/unaligned.h> +#ifdef CONFIG_VALGRIND +#include <valgrind/memcheck.h> +#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; |