From patchwork Fri Jan 10 12:44:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amol Grover X-Patchwork-Id: 11327297 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 94D93138C for ; Fri, 10 Jan 2020 12:45:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65B9B2072E for ; Fri, 10 Jan 2020 12:45:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="vYN1KwOD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727912AbgAJMpA (ORCPT ); Fri, 10 Jan 2020 07:45:00 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:36301 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbgAJMpA (ORCPT ); Fri, 10 Jan 2020 07:45:00 -0500 Received: by mail-pf1-f195.google.com with SMTP id x184so1107860pfb.3; Fri, 10 Jan 2020 04:45:00 -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:mime-version :content-transfer-encoding; bh=zHdRnTZJjcN2zvUamZ1G4RdksTFXX4xdkIF3BaNA6s0=; b=vYN1KwODkuLwoJBLCz+Dts31AwF9BgZlEnoJjsl4ZuH5wuSA4lytftMrkJQ9Y1LVVn kOOZmOnYt8I+8te7xUnJ6aJkUj0LK0clSL5yTYOaJzSPqm6Urt8wWTx9OxOtSsFiE1D6 BpDp6ET4ApCD8FiK2JKLsWx0iZVNJ9zfIvn2C+JUhrp4Lc48lp+C2+s5lybjjn2F4Zv5 XigX4O22jYy9aAhFQQHCWMA9AicRg9qEBwbjuStCu51rPAv9jTo3qziLul6HCftfRSDL vJ34xmC1Kre5k8uefnmDLn+Mz/jYhLmzT3TpP2GgeQrDtht5YOS7d/6T5w2x8yPzq72A n6Wg== 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:mime-version :content-transfer-encoding; bh=zHdRnTZJjcN2zvUamZ1G4RdksTFXX4xdkIF3BaNA6s0=; b=DVuvO2fXLASH93TsghiYAc+EQRJURCgknDA2hsKw2X8Ri3Obg9xDyrBzHOuLKfG8+i i0i5ydrCewofNcDfQ/wx5CXMYQ83R4GInWmL51WPqQLVURKliseS7N1/lUxUsp7+Z+zW Oghpm+jCd59W+xZX5HHJheAmhuX/cxxSnWMGlstwNOQbwXjBOhfOm+8TywvImsKu3m8M jau0fZScNMMKMRgGr+RfT/REnz1OAaf5HHAcxdJK5AXr1a1oC9183VP8VL7y1x8EAZ7P wGV0V0VWvBSh9N2MlvKn7Jf//OPvdT5Nr8bfXdT99ZUzURa2IBBlWgOUsLPKtoIV6r+d zIbA== X-Gm-Message-State: APjAAAUMLz64uu++MZkfK7i59mzLt3drHs4zpciNcgh7/NMjjWyf2Lax g1AqyE/so3Zmv+5unAIPTYE= X-Google-Smtp-Source: APXvYqwsz2ALkDAVbByjWYV7EWu7XtAQh5kTGDka+88oUueTAZ6ddpkiHOT3dPiym7rxZysPhqqMuA== X-Received: by 2002:aa7:824d:: with SMTP id e13mr3848868pfn.247.1578660299863; Fri, 10 Jan 2020 04:44:59 -0800 (PST) Received: from localhost.localdomain ([103.211.17.220]) by smtp.googlemail.com with ESMTPSA id d3sm2764724pfn.113.2020.01.10.04.44.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 04:44:59 -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 1/3] drivers: target: target_core_device: Pass lockdep expression to RCU lists Date: Fri, 10 Jan 2020 18:14:03 +0530 Message-Id: <20200110124403.27882-1-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org nacl->lun_entry_hlist is traversed with hlist_for_each_entry_rcu outside an RCU read-side critical section but under the protection of nacl->lun_entry_mutex. Hence, add the corresponding lockdep expression to the list traversal primitive to silence false-positive lockdep warnings, and harden RCU lists. Add macro for the corresponding lockdep expression to make the code clean and concise. Signed-off-by: Amol Grover --- drivers/target/target_core_device.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 2d19f0e332b0..2d1277a83916 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -36,6 +36,9 @@ #include "target_core_pr.h" #include "target_core_ua.h" +#define lun_entry_mutex_held() \ + lockdep_is_held(&nacl->lun_entry_mutex) + static DEFINE_MUTEX(device_mutex); static LIST_HEAD(device_list); static DEFINE_IDR(devices_idr); @@ -247,9 +250,10 @@ void core_free_device_list_for_node( struct se_dev_entry *deve; mutex_lock(&nacl->lun_entry_mutex); - hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link) { + hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link, + lun_entry_mutex_held()) { struct se_lun *lun = rcu_dereference_check(deve->se_lun, - lockdep_is_held(&nacl->lun_entry_mutex)); + lun_entry_mutex_held()); core_disable_device_list_for_node(lun, deve, nacl, tpg); } mutex_unlock(&nacl->lun_entry_mutex); @@ -276,7 +280,8 @@ struct se_dev_entry *target_nacl_find_deve(struct se_node_acl *nacl, u64 mapped_ { struct se_dev_entry *deve; - hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link) + hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link, + rcu_read_lock_held() || lun_entry_mutex_held()) if (deve->mapped_lun == mapped_lun) return deve; @@ -339,7 +344,7 @@ int core_enable_device_list_for_node( orig = target_nacl_find_deve(nacl, mapped_lun); if (orig && orig->se_lun) { struct se_lun *orig_lun = rcu_dereference_check(orig->se_lun, - lockdep_is_held(&nacl->lun_entry_mutex)); + lun_entry_mutex_held()); if (orig_lun != lun) { pr_err("Existing orig->se_lun doesn't match new lun" @@ -460,9 +465,10 @@ void core_clear_lun_from_tpg(struct se_lun *lun, struct se_portal_group *tpg) list_for_each_entry(nacl, &tpg->acl_node_list, acl_list) { mutex_lock(&nacl->lun_entry_mutex); - hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link) { + hlist_for_each_entry_rcu(deve, &nacl->lun_entry_hlist, link, + lun_entry_mutex_held()) { struct se_lun *tmp_lun = rcu_dereference_check(deve->se_lun, - lockdep_is_held(&nacl->lun_entry_mutex)); + lun_entry_mutex_held()); if (lun != tmp_lun) continue; From patchwork Fri Jan 10 12:44:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amol Grover X-Patchwork-Id: 11327301 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03CB814B4 for ; Fri, 10 Jan 2020 12:45:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5C1E2072E for ; Fri, 10 Jan 2020 12:45:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="b5XsA7DT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727956AbgAJMpP (ORCPT ); Fri, 10 Jan 2020 07:45:15 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:39390 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727753AbgAJMpP (ORCPT ); Fri, 10 Jan 2020 07:45:15 -0500 Received: by mail-pl1-f195.google.com with SMTP id g6so827438plp.6; Fri, 10 Jan 2020 04:45:14 -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=XiQjNY1xMxvJGSxUkChVfHVoiKMHp1TNrNrHF4ZFhmk=; b=b5XsA7DThL8r6GGH8yPwhCzBc8/TOhXIH1LFctpB2xpxTiR2m72+DbZJ4RtRFyln2a R5kta/LHKYotlALlWC9m9aS4lpRaY4viIDvfvqGRFmqxLHQ0VTSriLeoZY6+dArcDqd+ 2PoXgtCFBShumyyuigvCh+HKK8Iq/Rj9X3HRq+lgU/PY3u+ulxf9UL+c0FH4QAtLMQVZ pPMkMYmcYk8nUKGWbibfOyJwXC84jGJtcztcbjlhVl2h3AzUUPirGRUux2xBRYn4uYnT /d66fzJAl+k/KVeQI0RZyWY1OvFTbbbqGUATb/IrsIfmnj8rVC8t0JJ76P4h7slQguPU aMdA== 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=XiQjNY1xMxvJGSxUkChVfHVoiKMHp1TNrNrHF4ZFhmk=; b=XjJCI87axMXXGn9D5TAAwT8DPoNFdXIvc8oH2pKUqMFPhF9AWTxbFoP394eIxrm5kA 2mzC4XV5cBFlN0uHpElqTzwV7mkmVy20V1LOD08kIhMO3nj0qki4GvFICbrS9ojGo/iJ I0BS4ej9DhxXpR2QRx7cLMvVZ9zsA0cSIgAy3IRhrgPmMQaHySSytXRmwBEPdPeLU1NX +Th+katQbhpKFlQ38+/JfsN2YnT59je22YUL49uQbrgKoyHsW78e1c/en1QAr5QT0eOC n02SGdYxcZFBXgS82RPdOiRdv+ccUplkuZXcsCkCCr8TmZueYfMff77jlQr3DaUPtOGO r4lw== X-Gm-Message-State: APjAAAUKrebU84e9zsK1JLMMgb/jp68gDxNZR/wFsmUTMhmf+MKKBHk2 IvIgugjQ5bDQn/gtkxX1LNs= X-Google-Smtp-Source: APXvYqxXTdVEHBTBnbbB8JYku5LMrEpUI+NVX8F4bBlQ/zEjWRWUV7IiVO3ufElg/4V2oMKi0xiB4g== X-Received: by 2002:a17:90a:3a86:: with SMTP id b6mr4553372pjc.96.1578660314074; Fri, 10 Jan 2020 04:45:14 -0800 (PST) Received: from localhost.localdomain ([103.211.17.220]) by smtp.googlemail.com with ESMTPSA id d3sm2764724pfn.113.2020.01.10.04.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 04:45:13 -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 2/3] drivers: target: target_core_tpg: Pass lockdep expression to RCU lists Date: Fri, 10 Jan 2020 18:14:05 +0530 Message-Id: <20200110124403.27882-2-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200110124403.27882-1-frextrite@gmail.com> References: <20200110124403.27882-1-frextrite@gmail.com> MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@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. Add macro for the corresponding lockdep expression to make the code clean and concise. Signed-off-by: Amol Grover --- drivers/target/target_core_tpg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index d24e0a3ba3ff..bc1c5dda81bf 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c @@ -30,6 +30,9 @@ #include "target_core_pr.h" #include "target_core_ua.h" +#define tpg_lun_mutex_held() \ + lockdep_is_held(&tpg->tpg_lun_mutex) + extern struct se_device *g_lun0_dev; /* __core_tpg_get_initiator_node_acl(): @@ -110,12 +113,12 @@ 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, + tpg_lun_mutex_held()) { if (lun_orig && lun != lun_orig) continue; - dev = rcu_dereference_check(lun->lun_se_dev, - lockdep_is_held(&tpg->tpg_lun_mutex)); + dev = rcu_dereference_check(lun->lun_se_dev, tpg_lun_mutex_held()); /* * By default in LIO-Target $FABRIC_MOD, * demo_mode_write_protect is ON, or READ_ONLY; From patchwork Fri Jan 10 12:44:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amol Grover X-Patchwork-Id: 11327305 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CE2CD138C for ; Fri, 10 Jan 2020 12:45:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AC2582072E for ; Fri, 10 Jan 2020 12:45:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MSGy+ABE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727753AbgAJMpW (ORCPT ); Fri, 10 Jan 2020 07:45:22 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46642 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728254AbgAJMpW (ORCPT ); Fri, 10 Jan 2020 07:45:22 -0500 Received: by mail-pf1-f195.google.com with SMTP id n9so1081001pff.13; Fri, 10 Jan 2020 04:45:21 -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=kIXyMxyHb52Dqb3xzKBUlHwhFwf+AsnzOx4pqWqWlWY=; b=MSGy+ABEyjJHqfkpma0mmsRX+Uc9gPbqiEVJYZR0c24iUoUTjVte/QICQT5sU9I4w+ DGzNNWyxHTi2QSD86mJ2nW26ainZZG+8VCaCx4ZiHMaESa44V7ievBtxPfIwbfG25vbd j9hUsK65W/rw4T3+4CmHr5BgpkmftWP91D/6S3Ce/cbwBO87Aq2oalpuPrPO8xw82aTw 5XzmUEf1IZfc8Rv3qgg1YsgfPCRPrUtLC4zB3zSvx2y55MgRKTE99hNgVGvkfejHi1JP pCGJv5MFK2eN14Gh7he9aieLiX78y2uCsJSzbyeDHIA1GYGUj/ZqRSj1K9Ex5zbz+/f/ d9Wg== 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=kIXyMxyHb52Dqb3xzKBUlHwhFwf+AsnzOx4pqWqWlWY=; b=Uxv9TxX41udFQi2WDmsACq4nR1xNiO0XLP+3wYSykuj2FbktIkxClYiaPoWV/tsSaC 65nu4HCRb8uNhN4RtQwQbTVV3IZuJwVNX3IK3aM5+tobn3yct3foZAqgknzzZfU8cQCZ Xs7b7+IgDGyEnHfwfVpeDfD+iSwGrasj4P7MJG1JdLir0X/mFA4e+xlZ3aFfKyJDBOHp OlyTKCs/nmnxIQJY3YXNnfHZM2EMpuYyaKrqylgl9fnm0kbGgmVMwE1JTCktNE121lO1 lzOdIIViaiE5ObrrpWbDthfDShdp+cwhSaZAlWiABKJp0jxmWkG90hLDYBspK6jbHNs8 9m+w== X-Gm-Message-State: APjAAAXUW89kDUDKEfttUvsIT3WOGK3SWd947O47hTOCoOS1gtzGpmEz b2ZsTARdU8YqVIByClS575A= X-Google-Smtp-Source: APXvYqxsIaCvT7AXhc5HwdvbwnGjpRwaKBcXZvcvLZoaWm6p426Edsi9yrJobhbKmJFqnsUmEQ66aw== X-Received: by 2002:a63:4d1b:: with SMTP id a27mr4092403pgb.352.1578660320827; Fri, 10 Jan 2020 04:45:20 -0800 (PST) Received: from localhost.localdomain ([103.211.17.220]) by smtp.googlemail.com with ESMTPSA id d3sm2764724pfn.113.2020.01.10.04.45.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 04:45:20 -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 3/3] drivers: target: tcm_fc: tfc_sess: Pass lockdep expression to RCU lists Date: Fri, 10 Jan 2020 18:14:06 +0530 Message-Id: <20200110124403.27882-3-frextrite@gmail.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200110124403.27882-1-frextrite@gmail.com> References: <20200110124403.27882-1-frextrite@gmail.com> MIME-Version: 1.0 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org head is traversed with hlist_for_each_entry_rcu outside an RCU read-side critical section but under the protection of ft_lport_lock. Hence, add the corresponding lockdep expression to the list traversal primitive to silence false-positive lockdep warnings, and harden RCU lists. Add macro for the corresponding lockdep expression to make the code clean and concise. Signed-off-by: Amol Grover --- drivers/target/tcm_fc/tfc_sess.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index 4fd6a1de947c..8e9598010fb9 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c @@ -32,6 +32,9 @@ (lport)->host->host_no, \ (lport)->port_id, ##args ) +#define ft_lport_lock_held() \ + lockdep_is_held(&ft_lport_lock) + static void ft_sess_delete_all(struct ft_tport *); /* @@ -45,7 +48,7 @@ static struct ft_tport *ft_tport_get(struct fc_lport *lport) int i; tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP], - lockdep_is_held(&ft_lport_lock)); + ft_lport_lock_held()); if (tport && tport->tpg) return tport; @@ -170,7 +173,7 @@ static struct ft_sess *ft_sess_get(struct fc_lport *lport, u32 port_id) } head = &tport->hash[ft_sess_hash(port_id)]; - hlist_for_each_entry_rcu(sess, head, hash) { + hlist_for_each_entry_rcu(sess, head, hash, ft_lport_lock_held()) { if (sess->port_id == port_id) { kref_get(&sess->kref); rcu_read_unlock(); @@ -215,7 +218,7 @@ static struct ft_sess *ft_sess_create(struct ft_tport *tport, u32 port_id, ft_format_wwn(&initiatorname[0], TRANSPORT_IQN_LEN, rdata->ids.port_name); head = &tport->hash[ft_sess_hash(port_id)]; - hlist_for_each_entry_rcu(sess, head, hash) + hlist_for_each_entry_rcu(sess, head, hash, ft_lport_lock_held()) if (sess->port_id == port_id) return sess; @@ -264,7 +267,7 @@ static struct ft_sess *ft_sess_delete(struct ft_tport *tport, u32 port_id) struct ft_sess *sess; head = &tport->hash[ft_sess_hash(port_id)]; - hlist_for_each_entry_rcu(sess, head, hash) { + hlist_for_each_entry_rcu(sess, head, hash, ft_lport_lock_held()) { if (sess->port_id == port_id) { ft_sess_unhash(sess); return sess; @@ -291,7 +294,7 @@ static void ft_sess_delete_all(struct ft_tport *tport) for (head = tport->hash; head < &tport->hash[FT_SESS_HASH_SIZE]; head++) { - hlist_for_each_entry_rcu(sess, head, hash) { + hlist_for_each_entry_rcu(sess, head, hash, ft_lport_lock_held()) { ft_sess_unhash(sess); ft_close_sess(sess); /* release from table */ } @@ -454,7 +457,7 @@ static void ft_prlo(struct fc_rport_priv *rdata) mutex_lock(&ft_lport_lock); tport = rcu_dereference_protected(rdata->local_port->prov[FC_TYPE_FCP], - lockdep_is_held(&ft_lport_lock)); + ft_lport_lock_held()); if (!tport) { mutex_unlock(&ft_lport_lock);