Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp324014yba; Sat, 20 Apr 2019 03:25:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzri25Lrohq+EHoN0y2pdMyCX86Jp13LZBz14/8jVSAvw3AdS6UbA2KfgNAwesE8p9rzY0C X-Received: by 2002:a17:902:e48c:: with SMTP id cj12mr8650948plb.93.1555755955454; Sat, 20 Apr 2019 03:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555755955; cv=none; d=google.com; s=arc-20160816; b=tZskYaN30WBJtMFg5mI/sKWkAV4R9DlYoFgpP/Zyl1r5jV2pFdk/4jEyeH0tMySCPw 0iqotULySyDxongx5xR9sy0T74octLO7fwSj/b0Q/tLtgZcBf6utf7IiDeZrNbqP57sA mNT6QZRzkTufP1F8Hp/wVyyGU50al10dM5wMe2ieWOBje1cSjf7kWxn+mBdAElnWIpu7 L4fXixcYhWerdurte0c52EBo0oeJXX2LIHcIVkPwP6qIe3R1cx92MEPCXSYexlx32BzI 3qoUifmd/HDzl1V89CD/M68h6v6mi/FsYTP5lP4APXFO+jaekT6bKW/iIVyvXhsMZlZP QJyw== 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=E+sLm9uehRiGlzT+W/+y7Z+7JdEqg9tMPYCh/w6fgas=; b=VxRmnntsXVQBv6sLm0OB1Zv+igASNaKZ4N1RD7U9Jm6JCNKKsDUyROpdNfKvZMlfBS Y0neZybIRGcGicF/tWExeBM7IGts/bjqys33KVjyZ3MFUvp0J7wu6V5NQw88Tb2vsi0P 1c5ENt4ttzc7EGZPvsVT4vS2J3gM8D59wYrCpgnPDasMbuOGnhwpOtwMnP8J/xZLjjxg Y24owF3EWgPBs/3EAlcO15Zt4M0ILw/o/N0ihYYvouYkVng6uQYr+eATCf4+rBdipPpQ qQiXWQj7Fhvho2FVd60UmY6I9yIFoFE/0/V2F451hnM4rKDWmg2wUyNO+hcw22I2f1lJ NgVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zytor.com header.s=2019041745 header.b=Xs0iuGSt; 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 143si6912821pga.118.2019.04.20.03.25.38; Sat, 20 Apr 2019 03:25:55 -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=Xs0iuGSt; 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 S1726651AbfDTKYm (ORCPT + 99 others); Sat, 20 Apr 2019 06:24:42 -0400 Received: from terminus.zytor.com ([198.137.202.136]:44823 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725920AbfDTKYl (ORCPT ); Sat, 20 Apr 2019 06:24:41 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id x3KAJIcO684200 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 20 Apr 2019 03:19:18 -0700 DKIM-Filter: OpenDKIM Filter v2.11.0 terminus.zytor.com x3KAJIcO684200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zytor.com; s=2019041745; t=1555755558; bh=E+sLm9uehRiGlzT+W/+y7Z+7JdEqg9tMPYCh/w6fgas=; h=Date:From:Cc:Reply-To:In-Reply-To:References:To:Subject:From; b=Xs0iuGStg/dROYjoMJkdRR4xqGDA8RuNrrNI5c+X1AKw9kfoF8niHcBp+6S+niXcd HaupjVSxhhqyXTDvZD7HXzs0gKh9TnoEFq78aZfweBJRQ7706TdGsTKvugdgP9Nntc rwVSEt4GVDo9w5EtvSf7e4vlwLFb5WWQvwzkGN+E+oGz8qTCUWUFw7rICeemHYzu0b md/fMWMkQuw4ej2cABni4iZRjl14RvjUgMK5QsU/f065jSMXujyTY1n1WfI9rPupF5 DFzX/p4LVcBQEHUqzHRTQ98zi1djNsWeELrQrC5zPtSARxowj2UuXxGesBnfQ7dDry bYSOeXNV++4oA== Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id x3KAJEwk684195; Sat, 20 Apr 2019 03:19:14 -0700 Date: Sat, 20 Apr 2019 03:19:14 -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: tony.luck@intel.com, linux-kernel@vger.kernel.org, hpa@zytor.com, chao.wang@ucloud.cn, tglx@linutronix.de, bp@suse.de, mingo@kernel.org, linux-edac@vger.kernel.org Reply-To: bp@suse.de, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com, linux-edac@vger.kernel.org, chao.wang@ucloud.cn, linux-kernel@vger.kernel.org, tony.luck@intel.com 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: 06e0fe2d8e9178bda874a75083bc13647fbf983f 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: 06e0fe2d8e9178bda874a75083bc13647fbf983f Gitweb: https://git.kernel.org/tip/06e0fe2d8e9178bda874a75083bc13647fbf983f Author: WANG Chao AuthorDate: Thu, 18 Apr 2019 03:41:14 +0000 Committer: Borislav Petkov CommitDate: Sat, 20 Apr 2019 12:13:13 +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));