Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp325770yba; Sat, 20 Apr 2019 03:28:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQNCtb7kQ4aGNwxX85VQlwjNc3CaPt3S+NEmpLYD/r+hTelGccmaIsyaA9ivnCdXuKIUh0 X-Received: by 2002:a17:902:76c5:: with SMTP id j5mr7855836plt.337.1555756109660; Sat, 20 Apr 2019 03:28:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555756109; cv=none; d=google.com; s=arc-20160816; b=owdlMwPTzA/DkgJk/m/wKocOdcCRO4cCxmA1smFj0CmhXbmiBOt1sD8bTaLq9b8BQZ KrHxHEC+aA7arDvFWzr9bTNLsYwfwhPIAzYy6hm6fOO1d4Jy9zUah9/by5g6hwewjCUX +eS+Mwsg5k6EUx+Fr7je7XGyCkRkeNrYhSClwat04jXf0Ek6XV4gKq9hf2XCnVK0uVqF Enw5esZQy+cumJCHGWJBLVBEmdGl4YfcmrfXC/jAT0pEyIgln/wxNWpBoOEzfB3ldwDf WJLpawy3NII7xWrLt6BJQLYwiJtmk1fFYZ++7a7tkuGLa6HYtD1h5T4GT4AMzdU5WyEt HGlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:dkim-signature:dkim-filter; bh=uDgvLofMZlbsAdT4mzJGmcMQunBDeqaTtSvXsT1dPiU=; b=Am5zZ/Pyk2rwar92TyKR7pEvBfHrLI3YiaggITy3MOVDUU2O+8xkil8WBf+kx2eyr5 Vo94lRcutgAmn9NkLkRenHs3uZPhks6sHX0i0Tro1KB6G2vSaMeA1T5RNfvowbj14Sb6 3c8wPiUu8MwfZS8pHsmGnw2jqSNAGj3vMibzm7dqoCx4/fIW6rOGayWQ1N2TCDVBqieP 5+3xPJVyg2IEalE9yUrU5o0A4S2h+lTTGprqFrvaZXjuqZLpha6A2SaWCcmNwY65GbdT p4bZHd5FaSmLj5n+ZkotdOEhRrBrezTBil/E6b8E5jKokRAnL7i6jWdZ/39hrcbuq/RG GyPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=WQnhJ0rQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i9si6300543pgq.23.2019.04.20.03.28.14; Sat, 20 Apr 2019 03:28:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=WQnhJ0rQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zytor.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727685AbfDTK1W (ORCPT + 99 others); Sat, 20 Apr 2019 06:27:22 -0400 Received: from terminus.zytor.com ([198.137.202.136]:57935 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfDTK1V (ORCPT ); Sat, 20 Apr 2019 06:27:21 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3KAM4ht685109 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 20 Apr 2019 03:22:04 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x3KAM4ht685109 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1555755725; bh=uDgvLofMZlbsAdT4mzJGmcMQunBDeqaTtSvXsT1dPiU=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=WQnhJ0rQVAz37oh3qsp51p8WWIN4l6+XECONzOUumFQO2VC9XIvgkLzk0MwY55HJL 2pEAih/4RzSDT+AW1zjYxcZHdc3UyYWoNE8i/ypD7/pTvpBTfpTe/R/vnC6U4vCQLC zY0GS9BX6v/kIX0FZug1IkwlXzrVm2Zm8GvbGVR3ReYaUTRObMd3BA5xfeg6+nms2A h6ynJtHnC3gTE7ovl+KpywrdhyLVrXDfg7C6G0aOk5/92Db6ZUW+Oeu7vmCsL5Bx4R d9REY2tmrhMV2vEYPzjueRVGka2hdRdXR0/HygwhIzm27e7BRcsG16UG3aOEKhVgyJ 2xQkYHkCuoTeQ== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3KAM3ds685106; Sat, 20 Apr 2019 03:22:03 -0700 Date: Sat, 20 Apr 2019 03:22:03 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for WANG Chao Message-ID: Cc: tglx@linutronix.de, mingo@kernel.org, tony.luck@intel.com, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, chao.wang@ucloud.cn, hpa@zytor.com, bp@suse.de Reply-To: tony.luck@intel.com, linux-edac@vger.kernel.org, chao.wang@ucloud.cn, bp@suse.de, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org In-Reply-To: <20190418034115.75954-2-chao.wang@ucloud.cn> References: <20190418034115.75954-2-chao.wang@ucloud.cn> To: linux-tip-commits@vger.kernel.org Subject: [tip:ras/core] RAS/CEC: Increment cec_entered under the mutex lock Git-Commit-ID: 09cbd2197e9291d6a3d3f42873f06ca1f388c1a4 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_24_48,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, DKIM_VALID_EF autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 09cbd2197e9291d6a3d3f42873f06ca1f388c1a4 Gitweb: https://git.kernel.org/tip/09cbd2197e9291d6a3d3f42873f06ca1f388c1a4 Author: WANG Chao AuthorDate: Thu, 18 Apr 2019 03:41:14 +0000 Committer: Borislav Petkov CommitDate: Sat, 20 Apr 2019 12:16:52 +0200 RAS/CEC: Increment cec_entered under the mutex lock Modify ->cec_entered in the critical section of the mutex. Signed-off-by: WANG Chao Signed-off-by: Borislav Petkov Cc: Tony Luck Cc: linux-edac Link: https://lkml.kernel.org/r/20190418034115.75954-2-chao.wang@ucloud.cn --- drivers/ras/cec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ras/cec.c b/drivers/ras/cec.c index 2d9ec378a8bc..88e4f3ff0cb8 100644 --- a/drivers/ras/cec.c +++ b/drivers/ras/cec.c @@ -286,10 +286,10 @@ int cec_add_elem(u64 pfn) if (!ce_arr.array || ce_arr.disabled) return -ENODEV; - ca->ces_entered++; - mutex_lock(&ce_mutex); + ca->ces_entered++; + if (ca->n == MAX_ELEMS) WARN_ON(!del_lru_elem_unlocked(ca));