public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Hannes Reinecke <hare@suse.de>
Cc: James Bottomley <jbottomley@parallels.com>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] ch: add refcounting
Date: Thu, 10 Apr 2014 04:51:57 -0700	[thread overview]
Message-ID: <20140410115157.GA8564@infradead.org> (raw)
In-Reply-To: <1396938437-29616-1-git-send-email-hare@suse.de>

>  static int
>  ch_release(struct inode *inode, struct file *file)
>  {
>  	scsi_changer *ch = file->private_data;
>  
>  	scsi_device_put(ch->device);
> +	ch->device = NULL;
>  	file->private_data = NULL;
> +	kref_put(&ch->ref, ch_destroy);

Any reason you need to put the scsi_device here already?  Defering
this would give you much eaiser life time rules, and no need to
deal with a NULL ch->device ever.


  reply	other threads:[~2014-04-10 11:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-08  6:27 [PATCH] ch: add refcounting Hannes Reinecke
2014-04-10 11:51 ` Christoph Hellwig [this message]
2014-04-10 14:12   ` Hannes Reinecke
2014-04-25 13:17     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2017-08-15 14:28 Hannes Reinecke
2017-08-17  1:00 ` Martin K. Petersen

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=20140410115157.GA8564@infradead.org \
    --to=hch@infradead.org \
    --cc=hare@suse.de \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox