This commit fixes the coverity issue introduced by the
previous commit of LU-17812. Below given is the coverity
report.
CID 440624 Integer handling issue constant_expression_result
The expression "ldlm_lock_to_ns(__ext->oe_dlmlock)->
ns_dump_stack_on_error && 1 /* D_ERROR & D_ERROR */" performs a
Boolean operation on a constant
Fixes:
70b9dc57a99d ("LU-17812 ldlm: stack trace log for LDLM error")
Signed-off-by: Rajeev Mishra <rajeevm@hpe.com>
Change-Id: I300831598c54f3f96719938253c7eaacb83f299f
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55926
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Petros Koutoupis <petros.koutoupis@hpe.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
*/
#ifdef LIBCFS_DEBUG
#define ldlm_lock_debug(msgdata, mask, cdls, lock, fmt, a...) do { \
- if (((mask) & D_CANTMASK) != 0 || \
+ if (((mask) & D_CANTMASK) != 0 || \
((libcfs_debug & (mask)) != 0 && \
(libcfs_subsystem_debug & DEBUG_SUBSYSTEM) != 0)) { \
_ldlm_lock_debug(lock, msgdata, fmt, ##a); \
- if (ldlm_lock_to_ns(lock)->ns_dump_stack_on_error && \
- (mask) & D_ERROR) \
+ if (unlikely(ldlm_lock_to_ns(lock)-> \
+ ns_dump_stack_on_error) && \
+ (mask) & D_ERROR) \
dump_stack(); \
} \
} while (0)
if (err != 0)
return -EINVAL;
- if (tmp != 0)
- ns->ns_dump_stack_on_error = 1;
- else
- ns->ns_dump_stack_on_error = 0;
+ ns->ns_dump_stack_on_error = tmp;
return count;
}
run_test 105f "Enqueue same range flocks"
test_105g() {
-
- (( $CLIENT_VERSION >= $(version_code 2.15.63.127) )) ||
+ (( $CLIENT_VERSION >= $(version_code 2.15.64.117) )) ||
skip "Need Client >= 2.15.63.127 for ldlm dump stack"
flock_is_enabled || skip_env "mount w/o flock enabled"