mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mail-agent-noreply@emc.com
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Sebastien Buisson <sebastien.buisson@bull.net>,
	Peng Tao <tao.peng@emc.com>,
	Andreas Dilger <andreas.dilger@intel.com>
Subject: [PATCH 3/8] staging/lustre: fix 'data race condition' issues in at_reset()
Date: Wed, 24 Jul 2013 16:31:27 +0800	[thread overview]
Message-ID: <1374654692-13237-4-git-send-email-mail-agent-noreply@emc.com> (raw)
In-Reply-To: <1374654692-13237-3-git-send-email-mail-agent-noreply@emc.com>

From: Sebastien Buisson <sebastien.buisson@bull.net>

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/6569
Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
---
 .../staging/lustre/lustre/include/lustre_import.h  |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_import.h b/drivers/staging/lustre/lustre/include/lustre_import.h
index 3a5dd6a..67259eb 100644
--- a/drivers/staging/lustre/lustre/include/lustre_import.h
+++ b/drivers/staging/lustre/lustre/include/lustre_import.h
@@ -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));
-- 
1.7.1


  reply	other threads:[~2013-07-24  8:36 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-24  8:31 [PATCH 0/8] staging/lustre: Intel tree sync and two fixups mail-agent-noreply
2013-07-24  8:31 ` [PATCH 1/8] staging/lustre/lmv: support DNE with HSM mail-agent-noreply
2013-07-24  8:31   ` [PATCH 2/8] staging/lustre/llite: handle io init failure in ll_fault_io_init() mail-agent-noreply
2013-07-24  8:31     ` mail-agent-noreply [this message]
2013-07-24  8:31       ` [PATCH 4/8] staging/lustre/llite: fix 'data race condition' issues of lli_flags mail-agent-noreply
2013-07-24  8:31         ` [PATCH 5/8] staging/lustre/obdclass: add obd_target.h mail-agent-noreply
2013-07-24  8:31           ` [PATCH 6/8] staging/lustre: fix Kconfig bool defaults mail-agent-noreply
2013-07-24  8:31             ` [PATCH 7/8] staging/lustre/obdclass: use a dummy structure for lu_ref_link mail-agent-noreply
2013-07-24  8:31               ` [PATCH 8/8] staging/lustre: fix errno translate code on non-x86 mail-agent-noreply
2013-07-24 17:27                 ` Dilger, Andreas
2013-07-24 17:43                   ` Peng Tao
2013-07-24 15:17             ` [PATCH 6/8] staging/lustre: fix Kconfig bool defaults Greg Kroah-Hartman
2013-07-24 17:19               ` Peng Tao
2013-07-24 19:35             ` Sam Ravnborg
2013-07-25  2:36               ` Peng Tao
2013-07-24  9:56 ` [PATCH 0/8] staging/lustre: Intel tree sync and two fixups Peng Tao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374654692-13237-4-git-send-email-mail-agent-noreply@emc.com \
    --to=mail-agent-noreply@emc.com \
    --cc=andreas.dilger@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sebastien.buisson@bull.net \
    --cc=tao.peng@emc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®