linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>,
	"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, Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH][RESEND] scsi_sysfs: add 'is_bin_visible' callback
Date: Wed, 2 Mar 2016 10:19:16 +0100	[thread overview]
Message-ID: <20160302091916.GE1308@lst.de> (raw)
In-Reply-To: <56D6973A.4070901@suse.de>

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.

> 
> > Otherwise this looks fine to me.
> 
> Reviewed-by: ?

Only without the cargo culted rcu magic.

  reply	other threads:[~2016-03-02  9:19 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 [this message]
2016-03-02  9:34       ` Hannes Reinecke

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=20160302091916.GE1308@lst.de \
    --to=hch@lst.de \
    --cc=bart.vanassche@sandisk.com \
    --cc=emilne@redhat.com \
    --cc=hare@suse.com \
    --cc=hare@suse.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).