Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp594099ybl; Tue, 7 Jan 2020 11:32:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzSWiXSADPG6t62qpURXKIHxBsa/xa/r00t5GMivU/VVoSnu9Vle/zGlLHGoNDyCCmnVrAa X-Received: by 2002:aca:110a:: with SMTP id 10mr13119oir.130.1578425566451; Tue, 07 Jan 2020 11:32:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578425566; cv=none; d=google.com; s=arc-20160816; b=NuAfBinK2U0gwKAC55d8NfMWq/ZknXbVgBG7iAvgz0gcKAN6qgDL1oX8iv3fURqUSx YpuW4h5c5QOn9sqyIlOfXPzViW5fLS6DHtfyqAJbIjRkx9JEUzgLyQLqE6O1v1+A6elh P8XgSLKz4iOCLLLM4y1qh1fx09+Az4Wv5rneKuA6JnyE69zxVxGiUO2y3eChf3FkxIxn PpdH4SYID6hMCLePeRff31U9OPKFKCLNoe4wy97ZLbDzIsuO+6y1JKuhz3jN3PACETWc i6imGx5EJM04jgb2MvboiRBAM7RAdMnii6zDT3bx4sr6tJU5s6MFnBo2Hl/Y5x/+c9CP gJzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=3ST/dj3po+BlNeYM5PMnB4Z+srpzBM2wonPJAfu44pg=; b=u6i4fcEyUVovGSi3a+uRfHGZUcGAk45NfCUVtG3SA2mlZP8OrU79vMsFCrd/+z/2Ck OhMCOGW7Y8wDy9B4NRyry2jbEjE2oAZ+HxHj+LWgktSroBtBQ6VwUD6cEpl1y82tnj3U SEZbPFwkrx5D+ptYdqqlqrJjffqdK5gQGcBzcvT4JISOMgeJx/ur78bvzAphHuDM7UG+ IhuxwGQD9gtgfc7Gi1kKmxbkyksIbLCode/YYJhQvtzPOahn3nGpEqAzTdk/8uCFno+b EwC77VUnGd9sgL/d6YdjqAS3CoESt9eIoK0gK0340+DwTQvytjK9xZlhLXEHoxvilJi0 eprw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ayegAG88; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si458839oie.196.2020.01.07.11.32.33; Tue, 07 Jan 2020 11:32:46 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=ayegAG88; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728824AbgAGTb3 (ORCPT + 99 others); Tue, 7 Jan 2020 14:31:29 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:32783 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728307AbgAGTb2 (ORCPT ); Tue, 7 Jan 2020 14:31:28 -0500 Received: by mail-pg1-f194.google.com with SMTP id 6so356397pgk.0; Tue, 07 Jan 2020 11:31:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3ST/dj3po+BlNeYM5PMnB4Z+srpzBM2wonPJAfu44pg=; b=ayegAG88ic4ZMzTrQ5veoMKLjpAiwBmaJgBtFHY14G+/hkJWblccaas0os4TVCGKU0 JGskHw2/EF9g9oqgXWRZsQu4bwEUv/mzKh0vtW8N5JbfoEpH5mc0iHPYBSMiPx+kQ2Ii UuR8zZmrVymnRwa0240MOFfMrmIM7RKUC65YyifibGP5k6UoAFQFrFilwcrjFwwEBxtx G+FprGREsEVGy+JsYmWUJV4/xv8NtSNKW/yHeoQktpOY5C/saZF2HMvWjOEQKzWmNd40 +W24LHsjIQZ/DDnBiyXvFxhjBBjSMsYlbxPM5KLkvs/s/edJ/HDUCfqpw616E4/D+1Rq 114g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3ST/dj3po+BlNeYM5PMnB4Z+srpzBM2wonPJAfu44pg=; b=eiM8jxS1sZV0LGCHkUP0NhJ7At+2L6Z3TgBUjjey4wYO4LdbkiDDmyk7hkhV9uER38 Qot/y4vJf1HiMSzh+J67JvD5UJ4R5Y629lm1vY+3FOhqGCM2YeuuAolIlzsTedwGMCNs DL5eY4d2/e2LiETM/4Y5X917ui4smL/kEqYGPTz5lzbcDVdfOYdjxkpK4LauICbHVlT0 zrbp1ZKOWiQ84EAv6DgmgpkCWJNNmfNDRlXCia+6dbcyNFoINePcu0kT9P82x/EhsPPE RzQVS1X2tQvRD1Dh1Vqw644Sgc9jaZ4wxAM7wcIf6jxiuaN+gOcGXojSge10yaktmivX 1nWw== X-Gm-Message-State: APjAAAUhRv5MsMqVHymJmE2+t39jQFYNTxSgsnC2t/4uENrGPc82i/hG 445rNiPe4j44pzgOMnJHNDk= X-Received: by 2002:a62:1548:: with SMTP id 69mr837034pfv.239.1578425487834; Tue, 07 Jan 2020 11:31:27 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee3:fd53:8500:6ea8:4ef2:c9be]) by smtp.gmail.com with ESMTPSA id b4sm365817pfd.18.2020.01.07.11.31.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jan 2020 11:31:26 -0800 (PST) From: madhuparnabhowmik04@gmail.com To: dennis.dalessandro@intel.com, mike.marciniszyn@intel.com, dledford@redhat.com, paulmck@kernel.org Cc: rcu@vger.kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Madhuparna Bhowmik Subject: [PATCH 3/3] infiniband: sw: rdmavt: mcast.c: Use built-in RCU list checking Date: Wed, 8 Jan 2020 01:01:19 +0530 Message-Id: <20200107193119.22915-1-madhuparnabhowmik04@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Madhuparna Bhowmik Use built-in RCU and lock-checking for list_for_each_entry_rcu() by passing the cond argument. Signed-off-by: Madhuparna Bhowmik --- drivers/infiniband/sw/rdmavt/mcast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/rdmavt/mcast.c b/drivers/infiniband/sw/rdmavt/mcast.c index dd11c6fcd060..983cf6d06dfc 100644 --- a/drivers/infiniband/sw/rdmavt/mcast.c +++ b/drivers/infiniband/sw/rdmavt/mcast.c @@ -224,7 +224,8 @@ static int rvt_mcast_add(struct rvt_dev_info *rdi, struct rvt_ibport *ibp, } /* Search the QP list to see if this is already there. */ - list_for_each_entry_rcu(p, &tmcast->qp_list, list) { + list_for_each_entry_rcu(p, &tmcast->qp_list, list, + lock_is_held(&(ibp->lock).dep_map)) { if (p->qp == mqp->qp) { ret = ESRCH; goto bail; -- 2.17.1