lkml.org 
[lkml]   [2020]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2 RESEND] scsi: qedf: qedf_main: Pass lockdep expression to RCU lists
lport->disc.rports is traversed using list_for_each_entry_rcu
outside an RCU read-side critical section but under the protection
of lport->disc.disc_mutex.

Hence, add corresponding lockdep expression to silence false-positive
lockdep warnings, and harden RCU lists.

Signed-off-by: Amol Grover <frextrite@gmail.com>
---
drivers/scsi/qedf/qedf_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
index 604856e72cfb..17eab7f8cf05 100644
--- a/drivers/scsi/qedf/qedf_main.c
+++ b/drivers/scsi/qedf/qedf_main.c
@@ -420,7 +420,8 @@ static void qedf_link_recovery(struct work_struct *work)
* ADISC since the rport is in state ready.
*/
mutex_lock(&lport->disc.disc_mutex);
- list_for_each_entry_rcu(rdata, &lport->disc.rports, peers) {
+ list_for_each_entry_rcu(rdata, &lport->disc.rports, peers,
+ lockdep_is_held(&lport->disc.disc_mutex)) {
if (kref_get_unless_zero(&rdata->kref)) {
fc_rport_login(rdata);
kref_put(&rdata->kref, fc_rport_destroy);
--
2.24.1
\
 
 \ /
  Last update: 2020-02-12 08:26    [W:0.033 / U:0.732 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site