Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9055695ybl; Fri, 17 Jan 2020 05:42:12 -0800 (PST) X-Google-Smtp-Source: APXvYqzdeqGEvmZJ9r+rI+kzNRfr+8pzjEjmCL2l4mCIGJeP3otB1hFDwaJukhq+x/SxYqIP2xb4 X-Received: by 2002:a05:6830:1385:: with SMTP id d5mr6294753otq.61.1579268532491; Fri, 17 Jan 2020 05:42:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579268532; cv=none; d=google.com; s=arc-20160816; b=f6QSgTfEuqucdpDAJWhLSfYtrD2KIbuZN4fMnMq3G1UOdzCLPEacNgr9c+SpntSHi0 RrLAT1QCRulp/DEmuX2VNTT7ffBRMjVVCpouGyqTklXI4EA1CKjWvsSkykMppYXLLfYt m0Mr+SPtqzzAF0dFCn3AA5HaEE/r1zlYBtVaEAs9KNL7OSGivub/JwyYfaf/t0q6GMBx 33xtOEUlj2xR1cxlH0PFjQKjrhl2B8TAuRCF/SelUIs9TB0J0g87vcehz1Fj+THptn69 6FwSOeG00P/I5/+ZUKxClXeDV29i7zRewBPMUmR/TiBaVKYiNw+ifM2SoaQ4ipGIYcnp 9oNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=zXrfRGNxYaptzdQKW3ruvzzoYeLM85KhG9IY8/I3S9U=; b=xKjJ03dhgM45dJYCXSQA8r4tCPdj0gaqWsasaZRnKIu8lcPjZBj+ULh4q457lkchP3 jSg4hkxzxDVNjgqBBd7NnPAjiOcQJ3PjIbdpPCP8UZm38pxMEcYEQsWJQvYXuCsM5GSW zT3PLYz/AIuWbDTo0LpjljEU6iaIHby+SV1NZ+69wASW7VWzVkfA2yJ1wpnsY3X1GKKC Eni6hHfAnFbXMQHowCQ0Qli5K/B9oV7wmZIbfKjRgsKVX/0l1vx/tmpjgDhB5NWcN4vZ 32h3+gNYQ+UbuJ6OQCJ+e1yJHIEXAc4jVMjefUqZ2HmGFQgpxmUhEqz7FiKU7vFrHIeX g5nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rfGNejPU; 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 g26si15144370otn.180.2020.01.17.05.42.00; Fri, 17 Jan 2020 05:42:12 -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=rfGNejPU; 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 S1727766AbgAQNkm (ORCPT + 99 others); Fri, 17 Jan 2020 08:40:42 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:52866 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726936AbgAQNkm (ORCPT ); Fri, 17 Jan 2020 08:40:42 -0500 Received: by mail-pj1-f65.google.com with SMTP id a6so3198284pjh.2; Fri, 17 Jan 2020 05:40:42 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=zXrfRGNxYaptzdQKW3ruvzzoYeLM85KhG9IY8/I3S9U=; b=rfGNejPUGagicxyRLxw219tfyG1rWkQUrCufiG/ctiahenXe6veGihg1afmK6k7fRD HjqzJaOuJ0cZ6hKv3Q5dvTsOriNgi8CIf/dgIVfu4BhSVCc2HZ9V60/zQsrrgSkcmz45 GcHb1sAPN64xCEuHl7nh+/9hTJb96sQSxucahqnXOpNARYiyaLf1D3CqGoS9WEPEVkET 41z4H4Oyb2K3667qt8ZT9nZ57LL0FO7wz0DeeIqHFKrOEyAlD9B2Grv1xe/2VgS9Eh0P 97smQtjSUd8uig9i+qSUvCEs6W8DyR8J9ssHB1sy8crxrcxJbrntR6P7NpYBVeKUJGqn cruw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=zXrfRGNxYaptzdQKW3ruvzzoYeLM85KhG9IY8/I3S9U=; b=fdVuEuHX4Qum4YnYjXpzyiKqMPxxWB2U7tw0l4D2Ool/diLc8WJi8I38NwbbYoqEOE TC6vQ2Hh+wd8saFEYAkbutqUQ6yT1v5TIpm/gi2aMgTYk7PCK92g6fQkbNiHzcfnXR/p KVrRF4qe1TtSL2hFg491ISADkZw+i7vEy/IMSHz1qrZrjpQdJUXcQD0OKBbmwd8oWgqE EPaLdQ1gz07IuCmvKg8NJMlZTaVlIue/yGYN+dbbUgF1LqzawGZtui2a+2rl9HMuYJLv zAAYw5wzwc7lCT/eyV1ZHSDuwwUfThpIR5wBeDjyEJOxRL5IVgYvx1t6yJc1PYup3VE+ leIw== X-Gm-Message-State: APjAAAXCNeJOstHAIZzxYRy9Gm/Pf5AEx2QZ3ftz1jEg78DoUQ5W4koQ tsbFCExVwMf3QX5J7UJKCZo= X-Received: by 2002:a17:902:d915:: with SMTP id c21mr38236848plz.295.1579268441647; Fri, 17 Jan 2020 05:40:41 -0800 (PST) Received: from localhost.localdomain ([103.211.17.168]) by smtp.googlemail.com with ESMTPSA id s18sm29522422pfh.179.2020.01.17.05.40.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 05:40:41 -0800 (PST) From: Amol Grover To: "Martin K. Petersen" Cc: linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" , Amol Grover Subject: [PATCH v3 2/3] drivers: target: target_core_tpg: Pass lockdep expression to RCU lists Date: Fri, 17 Jan 2020 19:08:55 +0530 Message-Id: <20200117133854.32550-2-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200117133854.32550-1-frextrite@gmail.com> References: <20200117133854.32550-1-frextrite@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org tpg->tpg_lun_hlist is traversed with hlist_for_each_entry_rcu outside an RCU read-side critical section but under the protection of tpg->tpg_lun_mutex. Hence, add the corresponding lockdep expression to the list traversal primitive to silence false-positive lockdep warnings, and harden RCU lists. Signed-off-by: Amol Grover --- drivers/target/target_core_tpg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index d24e0a3ba3ff..7aa0240a7948 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -110,7 +110,8 @@ void core_tpg_add_node_to_devs( struct se_device *dev; mutex_lock(&tpg->tpg_lun_mutex); - hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link) { + hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link, + lockdep_is_held(&tpg->tpg_lun_mutex)) { if (lun_orig && lun != lun_orig) continue; -- 2.24.1