From: "Rustad, Mark D" <mark.d.rustad@intel.com>
To: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
Cc: Denis Efremov <yefremov.denis@gmail.com>,
"Paul E. McKenney" <paul.mckenney@linaro.org>,
Jesper Juhl <jj@chaosbits.net>,
"<target-devel@vger.kernel.org>" <target-devel@vger.kernel.org>,
"<linux-kernel@vger.kernel.org>" <linux-kernel@vger.kernel.org>,
"<ldv-project@ispras.ru>" <ldv-project@ispras.ru>,
"Patil, Kiran" <kiran.patil@intel.com>
Subject: Re: [PATCH] tcm_fc: rcu_deref outside rcu lock/unlock section
Date: Mon, 20 Aug 2012 16:39:14 +0000 [thread overview]
Message-ID: <B9B2747B-70B2-4E77-A3DA-C6970F1EE66E@intel.com> (raw)
In-Reply-To: <1345329331.25161.367.camel@haakon2.linux-iscsi.org>
On Aug 18, 2012, at 3:35 PM, Nicholas A. Bellinger wrote:
> On Sat, 2012-08-18 at 16:10 +0400, Denis Efremov wrote:
>> Use rcu_dereference_protected in order to prevent lockdep
>> complaint. Sequel of the patch 863555be
>>
>> Found by Linux Driver Verification project (linuxtesting.org).
>>
>> Signed-off-by: Denis Efremov <yefremov.denis@gmail.com>
>> ---
>> drivers/target/tcm_fc/tfc_sess.c | 4 +++-
>> 1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c
>> index 87901fa..3c9e5b5 100644
>> --- a/drivers/target/tcm_fc/tfc_sess.c
>> +++ b/drivers/target/tcm_fc/tfc_sess.c
>> @@ -456,7 +456,9 @@ static void ft_prlo(struct fc_rport_priv *rdata)
>> struct ft_tport *tport;
>>
>> mutex_lock(&ft_lport_lock);
>> - tport = rcu_dereference(rdata->local_port->prov[FC_TYPE_FCP]);
>> + tport = rcu_dereference_protected(rdata->local_port->prov[FC_TYPE_FCP],
>> + lockdep_is_held(&ft_lport_lock));
>> +
>> if (!tport) {
>> mutex_unlock(&ft_lport_lock);
>> return;
>
> This looks OK to silence lockdep. CC'ing MDR + Kiran for good measure
> here, and will move from target-pending queue -> master with their ACK.
>
> Thanks Dennis!
>
> --nab
Ack. In fact I wonder why I didn't encounter it myself.
--
Mark Rustad, LAN Access Division, Intel Corporation
prev parent reply other threads:[~2012-08-20 16:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-18 12:10 [PATCH] tcm_fc: rcu_deref outside rcu lock/unlock section Denis Efremov
2012-08-18 22:35 ` Nicholas A. Bellinger
2012-08-20 16:39 ` Rustad, Mark D [this message]
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=B9B2747B-70B2-4E77-A3DA-C6970F1EE66E@intel.com \
--to=mark.d.rustad@intel.com \
--cc=jj@chaosbits.net \
--cc=kiran.patil@intel.com \
--cc=ldv-project@ispras.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=paul.mckenney@linaro.org \
--cc=target-devel@vger.kernel.org \
--cc=yefremov.denis@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).