From: Christoph Hellwig <hch@infradead.org>
To: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@infradead.org>,
James Bottomley <jbottomley@parallels.com>,
linux-scsi@vger.kernel.org
Subject: Re: [PATCH] ch: add refcounting
Date: Fri, 25 Apr 2014 06:17:24 -0700 [thread overview]
Message-ID: <20140425131724.GA6823@infradead.org> (raw)
In-Reply-To: <5346A6E9.9070801@suse.de>
On Thu, Apr 10, 2014 at 04:12:57PM +0200, Hannes Reinecke wrote:
> On 04/10/2014 01:51 PM, Christoph Hellwig wrote:
> >> 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.
> >
> Sure. But this would require a far more in-depth analysis of the
> lifetime of the ch object, and most likely a far more intrusive
> patch. You're welcome to do so :-)
>
> This patch is just a minimal fix; I didn't dare to change too much
> of the internals.
Oh well, let's go with your simpler version for now.
Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2014-04-25 13:17 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
2014-04-10 14:12 ` Hannes Reinecke
2014-04-25 13:17 ` Christoph Hellwig [this message]
-- 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=20140425131724.GA6823@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