From: Hannes Reinecke <hare@suse.com>
To: Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
Ewan Milne <emilne@redhat.com>,
Bart van Assche <bart.vanassche@sandisk.com>,
James Bottomley <james.bottomley@hansenpartnership.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH][RESEND] scsi_sysfs: add 'is_bin_visible' callback
Date: Wed, 2 Mar 2016 17:34:48 +0800 [thread overview]
Message-ID: <56D6B3B8.8070109@suse.com> (raw)
In-Reply-To: <20160302091916.GE1308@lst.de>
On 03/02/2016 05:19 PM, Christoph Hellwig wrote:
> On Wed, Mar 02, 2016 at 03:33:14PM +0800, Hannes Reinecke wrote:
>>>> + rcu_read_lock();
>>>> + if (attr == &dev_attr_vpd_pg80 &&
>>>> + !rcu_dereference(sdev->vpd_pg80)) {
>>>> + rcu_read_unlock();
>>>> + return 0;
>>>> + }
>>>> + if (attr == &dev_attr_vpd_pg83 &&
>>>> + !rcu_dereference(sdev->vpd_pg83)) {
>>>> + rcu_read_unlock();
>>>> + return 0;
>>>> + }
>>>> + rcu_read_unlock();
>>>
>>> We are only checking the pointers for being non-zero. No need for the
>>> rcu_read_lock() or rcu_dereference() here.
>>>
>> Better to be same than sorry; some overly clever code analysis tool
>> might trip over it otherwise.
>
> It shouldn't. There is no dereference going on here.
>
Ok.
>>
>>> Otherwise this looks fine to me.
>>
>> Reviewed-by: ?
>
> Only without the cargo culted rcu magic.
>
Okay, will be resending it.
Cheers,
Hannes
prev parent reply other threads:[~2016-03-02 9:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-01 4:52 [PATCH][RESEND] scsi_sysfs: add 'is_bin_visible' callback Hannes Reinecke
2016-03-01 6:45 ` Seymour, Shane M
2016-03-01 9:08 ` Johannes Thumshirn
2016-03-01 13:04 ` Christoph Hellwig
2016-03-02 7:33 ` Hannes Reinecke
2016-03-02 9:19 ` Christoph Hellwig
2016-03-02 9:34 ` Hannes Reinecke [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=56D6B3B8.8070109@suse.com \
--to=hare@suse.com \
--cc=bart.vanassche@sandisk.com \
--cc=emilne@redhat.com \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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).