From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Greg KH <gregkh@suse.de>, linux-scsi <linux-scsi@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Mike Christie <michaelc@cs.wisc.edu>,
Christoph Hellwig <hch@lst.de>, Hannes Reinecke <hare@suse.de>,
James Bottomley <James.Bottomley@suse.de>,
Jens Axboe <axboe@kernel.dk>, Boaz Harrosh <bharrosh@panasas.com>
Subject: Re: [RFC 22/22] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module
Date: Sun, 05 Sep 2010 23:01:01 -0700 [thread overview]
Message-ID: <1283752861.556.200.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <20100906053845.GG17212@core.coreip.homeip.net>
On Sun, 2010-09-05 at 22:38 -0700, Dmitry Torokhov wrote:
> On Sun, Sep 05, 2010 at 10:21:20PM -0700, Nicholas A. Bellinger wrote:
> > On Sun, 2010-09-05 at 22:17 -0700, Greg KH wrote:
> > > On Sun, Sep 05, 2010 at 10:08:16PM -0700, Dmitry Torokhov wrote:
> > > > On Sun, Sep 05, 2010 at 02:51:19PM -0700, Nicholas A. Bellinger wrote:
> > > > > On Sun, 2010-09-05 at 13:30 -0700, Dmitry Torokhov wrote:
> > > > > > On Mon, Aug 30, 2010 at 02:23:23AM -0700, Nicholas A. Bellinger wrote:
> > > > > > > +
> > > > > > > +static void tcm_loop_primary_release(struct device *dev)
> > > > > > > +{
> > > > > > > + return;
> > > > > > > +}
> > > > > > > +
> > > > > > > +static struct device tcm_loop_primary = {
> > > > > > > + .init_name = "tcm_loop_0",
> > > > > > > + .release = tcm_loop_primary_release,
> > > > > > > +};
> > > > > > > +
> > > > > >
> > > > > > No, you can not have statically allocated devices and dummy release
> > > > > > functions.
> > > > > >
> > > > >
> > > > > Last time I checked this is still what mainline
> > > > > drivers/scsi/scsi_debug.c is doing for struct device pseudo_primary:
> > > > >
> > > > > static void pseudo_0_release(struct device *dev)
> > > > > {
> > > > > if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts)
> > > > > printk(KERN_INFO "scsi_debug: pseudo_0_release() called\n");
> > > > > }
> > > > >
> > > > > static struct device pseudo_primary = {
> > > > > .init_name = "pseudo_0",
> > > > > .release = pseudo_0_release,
> > > > > };
> > > > >
> > > > > so for these type of things in TCM_Loop I tend to follow what scsi_debug does,
> > > > > so I don't exactly see a issue here atm. Anybody else have comments..?
> > > >
> > > > The kobject embedded in the device structure is refcounted and it's
> > > > lifetime may be different from lifetime of your module. If somebody
> > > > happen to hold reference to the driver while your module is being
> > > > unloaded bad things will happen.
> > > >
> > > > I am sure Greg has something on this topic ready for cut-and-paste.
> > >
> > > Documentation/kobject.txt :)
> >
> > I still don't get it..? Does this mean that scsi_debug and TCM_Loop are
> > currently broken wrt to this item or not..?
> >
>
> Yes they are broken.
Hi Dmitry and Greg,
Would you mind giving a bit more specific idea as to what a patch to fix
this issue would involve for an emulated struct device usage..? I would
be happy to generate patches for scsi_debug and TCM_loop to resolve this
issue, but I need a bit more information what I should be looking at.
Thanks,
--nab
next prev parent reply other threads:[~2010-09-06 6:05 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-30 9:23 [RFC 22/22] tcm_loop: Add multi-fabric Linux/SCSI LLD fabric module Nicholas A. Bellinger
2010-09-05 20:30 ` Dmitry Torokhov
2010-09-05 21:51 ` Nicholas A. Bellinger
2010-09-06 5:08 ` Dmitry Torokhov
2010-09-06 5:17 ` Greg KH
2010-09-06 5:21 ` Nicholas A. Bellinger
2010-09-06 5:38 ` Dmitry Torokhov
2010-09-06 6:01 ` Nicholas A. Bellinger [this message]
2010-09-06 6:26 ` Dmitry Torokhov
2010-09-06 14:48 ` Richard Sharpe
2010-09-06 15:06 ` Richard Sharpe
2010-09-06 19:44 ` Dmitry Torokhov
2010-09-06 20:34 ` Greg KH
2010-09-06 7:01 ` Dmitry Torokhov
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=1283752861.556.200.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=James.Bottomley@suse.de \
--cc=axboe@kernel.dk \
--cc=bharrosh@panasas.com \
--cc=dmitry.torokhov@gmail.com \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=gregkh@suse.de \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=michaelc@cs.wisc.edu \
/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).