提交 f84d3d47 编写于 作者: S Sebastien Buisson 提交者: Greg Kroah-Hartman

staging/lustre: fix 'data race condition' issues in at_reset()

Fix 'data race condition' defects found by Coverity version
6.5.0:
Data race condition (MISSING_LOCK)
Accessing variable without holding lock. Elsewhere,
this variable is accessed with lock held.

at_reset() needs to take at->at_lock before modifying its members.

Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2744
Lustre-change: http://review.whamcloud.com/6569Signed-off-by: NSebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: NBob Glossman <bob.glossman@intel.com>
Reviewed-by: NKeith Mannthey <keith.mannthey@intel.com>
Reviewed-by: NOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: NPeng Tao <tao.peng@emc.com>
Signed-off-by: NAndreas Dilger <andreas.dilger@intel.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 8a48df70
......@@ -336,9 +336,11 @@ static inline unsigned int at_timeout2est(unsigned int val)
}
static inline void at_reset(struct adaptive_timeout *at, int val) {
spin_lock(&at->at_lock);
at->at_current = val;
at->at_worst_ever = val;
at->at_worst_time = cfs_time_current_sec();
spin_unlock(&at->at_lock);
}
static inline void at_init(struct adaptive_timeout *at, int val, int flags) {
memset(at, 0, sizeof(*at));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册