From 17cdb7a2b108360f94424b0d2bc72d7e0742a6a5 Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 2 Dec 2024 19:55:51 -0500 Subject: [PATCH] Add missing parenthesis in VERIFYF() Without them the order of operations might get unexpected. Reviewed-by: Adam Moss Reviewed-by: Jorgen Lundman Reviewed-by: Rob Norris Signed-off-by: Alexander Motin Sponsored by: iXsystems, Inc. Closes #16826 --- include/os/freebsd/spl/sys/debug.h | 2 +- include/os/linux/spl/sys/debug.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/os/freebsd/spl/sys/debug.h b/include/os/freebsd/spl/sys/debug.h index 615f97351..fd22e6b00 100644 --- a/include/os/freebsd/spl/sys/debug.h +++ b/include/os/freebsd/spl/sys/debug.h @@ -105,7 +105,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line) __FILE__, __FUNCTION__, __LINE__)) #define VERIFYF(cond, str, ...) do { \ - if (unlikely(!cond)) \ + if (unlikely(!(cond))) \ spl_panic(__FILE__, __FUNCTION__, __LINE__, \ "VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\ } while (0) diff --git a/include/os/linux/spl/sys/debug.h b/include/os/linux/spl/sys/debug.h index 38cc57ae0..3459d6979 100644 --- a/include/os/linux/spl/sys/debug.h +++ b/include/os/linux/spl/sys/debug.h @@ -109,7 +109,7 @@ spl_assert(const char *buf, const char *file, const char *func, int line) __FILE__, __FUNCTION__, __LINE__)) #define VERIFYF(cond, str, ...) do { \ - if (unlikely(!cond)) \ + if (unlikely(!(cond))) \ spl_panic(__FILE__, __FUNCTION__, __LINE__, \ "VERIFY(" #cond ") failed " str "\n", __VA_ARGS__);\ } while (0)