Whamcloud - gitweb
LU-13358 libcfs: add timeout to cfs_race() to fix race 61/43161/25
authorAlex Zhuravlev <bzzz@whamcloud.com>
Tue, 30 Mar 2021 05:57:14 +0000 (08:57 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 20 Nov 2021 06:24:53 +0000 (06:24 +0000)
commit2d2d381f35ee004319a20f5d2d8e70d13480d6c7
treeea0ce36368bc163e73f9918fcfc708c0342268bb
parente6c7fcdaf40b130c39af2e3ee8b108c6e31a8ca8
LU-13358 libcfs: add timeout to cfs_race() to fix race

there is no guarantee for the branches in cfs_race() to be executed
in strict order, thus it's possible that the second branch (with
cfs_race_state=1) is executed before the first branch and then another
thread executing the first branch gets stuck.

this construction is used for testing only and as a
workaround it's enough to timeout.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: Ie1cc0accedb3e1a198d4b17d1ab00ce298c560f2
Reviewed-on: https://review.whamcloud.com/43161
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Neil Brown <neilb@suse.de>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/include/libcfs/libcfs_fail.h