diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index e91a941848001e107318e7cd19c7e14b448ef763..5db0110698fd1d8a54fd9f2f64ebeec54ca7a272 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -284,6 +284,9 @@ static inline int obd_fail_check(__u32 id) _ret_; \ }) +#define OBD_FAIL_CHECK_QUIET(id) \ + (unlikely(obd_fail_loc) ? obd_fail_check(id) : 0) + /* deprecated - just use OBD_FAIL_CHECK */ #define OBD_FAIL_CHECK_ONCE OBD_FAIL_CHECK @@ -352,7 +355,7 @@ do { \ extern atomic_t libcfs_kmemory; #ifdef RANDOM_FAIL_ALLOC -#define HAS_FAIL_ALLOC_FLAG OBD_FAIL_CHECK(OBD_FAIL_GENERAL_ALLOC) +#define HAS_FAIL_ALLOC_FLAG OBD_FAIL_CHECK_QUIET(OBD_FAIL_GENERAL_ALLOC) #else #define HAS_FAIL_ALLOC_FLAG 0 #endif diff --git a/lustre/lvfs/lvfs_lib.c b/lustre/lvfs/lvfs_lib.c index 9a185c825e32c48c558d4d3c3e6390bf15cc161f..55e4e6f8600e13005693461f3caa25a54ba70287 100644 --- a/lustre/lvfs/lvfs_lib.c +++ b/lustre/lvfs/lvfs_lib.c @@ -36,7 +36,8 @@ int obd_alloc_fail(const void *ptr, const char *name, const char *type, if (ptr == NULL || (ll_rand() & OBD_ALLOC_FAIL_MASK) < obd_alloc_fail_rate) { CERROR("%s%salloc of %s (%u bytes) failed at %s:%d\n", - ptr ? "force " :"", type, name, size, file, line); + ptr ? "force " :"", type, name, (unsigned int)size, file, + line); CERROR("%d total bytes allocated by Lustre, %d by Portals\n", atomic_read(&obd_memory), atomic_read(&libcfs_kmemory)); return 1;