All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: David Somayajulu <david.somayajulu@qlogic.com>
Cc: James.Smart@Emulex.Com, linux-scsi@vger.kernel.org,
	David Wagner <david.wagner@qlogic.com>
Subject: Re: [PATCH 1/2] scsi:netlink support in scsi and fc transports forhba specific messages
Date: Mon, 04 Aug 2008 02:18:39 -0500	[thread overview]
Message-ID: <4896AD4F.2080101@cs.wisc.edu> (raw)
In-Reply-To: <0BB3E5E7462EEA4295BC02D49691DC07015B4249@AVEXCH1.qlogic.org>

David Somayajulu wrote:
>> - Your recently added scsi_host_put() was very wrong. You never
>>   had a corresponding get().
> Oops. The version I was looking at for cross reference had a get() in
> scsi_host_lookup() and no corresponding put(). Looks like
> scsi_host_lookup() has changed at some point. (I think Mike Christie was
> under the same impression when he suggested this).

I think you guys are missing the get() from class_find_device or what 
versions are you guys looking at? I have this from scsi-misc from today:

         cdev = class_find_device(&shost_class, &hostnum, 
__scsi_host_match);
         if (cdev) {
                 shost = scsi_host_get(class_to_shost(cdev));
                 put_device(cdev);
         }

If class_find_device finds a device class_find_device does a get on it. +1

If class_find_device found a device (cdev is non null) 
scsi_host_lookup() does another get() on it if the host is not being 
deleted. +1 (total =2)

scsi_host_lookup will then release the get() done from 
class_find_device. -1 (total =1)

So if scsi_host_lookup returns with a host there will be a reference on 
the host that must be released when we are done with it.

      reply	other threads:[~2008-08-04  7:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30 21:53 [PATCH 1/2] scsi:netlink support in scsi and fc transports for hba specific messages David Somayajulu
2008-07-31  2:09 ` [PATCH 1/2] scsi:netlink support in scsi and fc transports for hbaspecific messages James.Smart
2008-07-31 18:58   ` David Somayajulu
2008-08-01  0:35     ` James.Smart
2008-08-01 18:03       ` David Somayajulu
2008-07-31 19:56 ` [PATCH 1/2] scsi:netlink support in scsi and fc transports for hba specific messages Mike Christie
2008-07-31  3:35   ` David Somayajulu
2008-08-02 18:09     ` [PATCH 1/2] scsi:netlink support in scsi and fc transports forhba " James.Smart
2008-08-03  6:16       ` David Somayajulu
2008-08-04  7:18         ` Mike Christie [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=4896AD4F.2080101@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Smart@Emulex.Com \
    --cc=david.somayajulu@qlogic.com \
    --cc=david.wagner@qlogic.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.