From: Andreas Dilger Date: Thu, 4 Jan 2024 05:20:35 +0000 (-0700) Subject: LU-17394 libcfs: print cfs_fail_val when fail_loc hit X-Git-Tag: 2.15.61~96 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d36abfd08925855482583a9bbec95462bc5d1946;p=fs%2Flustre-release.git LU-17394 libcfs: print cfs_fail_val when fail_loc hit Add some more information to the console message when fail_loc is hit. Signed-off-by: Andreas Dilger Change-Id: I99fe4524f3764b068c96965c0b86bd4d7b341707 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/53585 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Reviewed-by: Alexander Boyko --- diff --git a/libcfs/include/libcfs/libcfs_fail.h b/libcfs/include/libcfs/libcfs_fail.h index d185770..472a7fb 100644 --- a/libcfs/include/libcfs/libcfs_fail.h +++ b/libcfs/include/libcfs/libcfs_fail.h @@ -107,12 +107,12 @@ static inline int cfs_fail_check_set(__u32 id, __u32 value, int set, int quiet) } /* - *If id hit cfs_fail_loc, return 1, otherwise return 0 + * If id hit cfs_fail_loc, return 1, otherwise return 0 */ #define CFS_FAIL_CHECK(id) \ - UNLIKELY_CHECK_SET(id, 0, CFS_FAIL_LOC_NOSET, 0) + UNLIKELY_CHECK_SET(id, cfs_fail_val, CFS_FAIL_LOC_NOSET, 0) #define CFS_FAIL_CHECK_QUIET(id) \ - UNLIKELY_CHECK_SET(id, 0, CFS_FAIL_LOC_NOSET, 1) + UNLIKELY_CHECK_SET(id, cfs_fail_val, CFS_FAIL_LOC_NOSET, 1) /* * If id hit cfs_fail_loc and cfs_fail_val == (-1 or value) return 1, @@ -154,10 +154,9 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) /* If id hit cfs_fail_loc, sleep for seconds or milliseconds */ #define CFS_FAIL_TIMEOUT(id, secs) \ - UNLIKELY_TIMEOUT_SET(id, 0, (secs) * 1000, CFS_FAIL_LOC_NOSET) - + UNLIKELY_TIMEOUT_SET(id, cfs_fail_val, (secs)*1000, CFS_FAIL_LOC_NOSET) #define CFS_FAIL_TIMEOUT_MS(id, ms) \ - UNLIKELY_TIMEOUT_SET(id, 0, ms, CFS_FAIL_LOC_NOSET) + UNLIKELY_TIMEOUT_SET(id, cfs_fail_val, ms, CFS_FAIL_LOC_NOSET) /* * If id hit cfs_fail_loc, cfs_fail_loc |= value and @@ -167,11 +166,10 @@ static inline int cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) UNLIKELY_TIMEOUT_SET(id, value, (secs) * 1000, CFS_FAIL_LOC_ORSET) #define CFS_FAIL_TIMEOUT_RESET(id, value, secs) \ - UNLIKELY_TIMEOUT_SET(id, value, secs * 1000, CFS_FAIL_LOC_RESET) + UNLIKELY_TIMEOUT_SET(id, value, (secs) * 1000, CFS_FAIL_LOC_RESET) #define CFS_FAIL_TIMEOUT_MS_ORSET(id, value, ms) \ UNLIKELY_TIMEOUT_SET(id, value, ms, CFS_FAIL_LOC_ORSET) - #define CFS_FAULT_CHECK(id) \ CFS_FAIL_CHECK(CFS_FAULT | (id))