From ded54580bdf18ba3a2b38e7910c54b1c53f007c6 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 16 Dec 2020 14:18:33 -0500 Subject: bcachefs: Check for duplicate device ptrs in bch2_bkey_ptrs_invalid() This is something we clearly should be checking for, but weren't - oops. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/util.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/bcachefs/util.h') diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index 7b7c638d8904..91aa8c0a0e09 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -750,4 +750,9 @@ u64 *bch2_acc_percpu_u64s(u64 __percpu *, unsigned); #define cmp_int(l, r) ((l > r) - (l < r)) +static inline int u8_cmp(u8 l, u8 r) +{ + return cmp_int(l, r); +} + #endif /* _BCACHEFS_UTIL_H */ -- cgit v1.2.3