From: Amol Grover <frextrite@gmail.com>
To: Hannes Reinecke <hare@suse.de>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org,
"Paul E . McKenney" <paulmck@kernel.org>,
linux-kernel@vger.kernel.org,
Joel Fernandes <joel@joelfernandes.org>,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: [Linux-kernel-mentees] [PATCH 2/2] drivers: scsi: qedf: qedf_main: Pass lockdep expression to RCU lists
Date: Fri, 17 Jan 2020 21:01:24 +0530 [thread overview]
Message-ID: <20200117153123.2648-2-frextrite@gmail.com> (raw)
In-Reply-To: <20200117153123.2648-1-frextrite@gmail.com>
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
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: Amol Grover <frextrite@gmail.com>
To: Hannes Reinecke <hare@suse.de>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
Joel Fernandes <joel@joelfernandes.org>,
Madhuparna Bhowmik <madhuparnabhowmik04@gmail.com>,
"Paul E . McKenney" <paulmck@kernel.org>,
Amol Grover <frextrite@gmail.com>
Subject: [PATCH 2/2] drivers: scsi: qedf: qedf_main: Pass lockdep expression to RCU lists
Date: Fri, 17 Jan 2020 21:01:24 +0530 [thread overview]
Message-ID: <20200117153123.2648-2-frextrite@gmail.com> (raw)
In-Reply-To: <20200117153123.2648-1-frextrite@gmail.com>
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
next prev parent reply other threads:[~2020-01-17 15:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-17 15:31 [Linux-kernel-mentees] [PATCH 1/2] drivers: scsi: fcoe: fcoe_ctlr: Pass lockdep expression to RCU lists Amol Grover
2020-01-17 15:31 ` Amol Grover
2020-01-17 15:31 ` Amol Grover [this message]
2020-01-17 15:31 ` [PATCH 2/2] drivers: scsi: qedf: qedf_main: " Amol Grover
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200117153123.2648-2-frextrite@gmail.com \
--to=frextrite@gmail.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=joel@joelfernandes.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=paulmck@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.