public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: James Bottomley <James.Bottomley@suse.de>
Cc: Mike Christie <michaelc@cs.wisc.edu>, linux-scsi@vger.kernel.org
Subject: Re: [PATCH] scsi_transport_fc: Initialize sysfs attributes with sysfs_attr_init
Date: Mon, 22 Mar 2010 11:13:09 +0100	[thread overview]
Message-ID: <20100322101308.GA6953@schmichrtp.mainz.de.ibm.com> (raw)
In-Reply-To: <1269107052.4353.241.camel@mulgrave.site>

On Sat, Mar 20, 2010 at 12:44:12PM -0500, James Bottomley wrote:
> On Tue, 2010-03-16 at 13:49 -0700, James Bottomley wrote:
> > On Tue, 2010-03-16 at 15:48 -0500, Mike Christie wrote:
> > > On 03/16/2010 05:14 AM, Christof Schmitt wrote:
> > > > With the new lockdep tracking in sysfs, sysfs_attr_init has to be used
> > > > for initializing all non-static sysfs attributes. Otherwise, lockdep
> > > > will warn about the missing initialization with:
> > > >
> > > > Mar 15 09:19:49 t6345029 kernel: BUG: key 000000002f5ae350 not in .data!
> > > > Mar 15 09:19:49 t6345029 kernel: BUG: key 000000002f5ae388 not in .data!
> > > > Mar 15 09:19:49 t6345029 kernel: BUG: key 000000002f5ae3c0 not in .data!
> > > > Mar 15 09:19:49 t6345029 kernel: BUG: key 000000002f5ae3f8 not in .data!
> > > >
> > > 
> > > I think iscsi needs this too, but I am not see this error message. I 
> > > just tried iscsi and fc/lpfc with linus's tree and did not see those 
> > > errors for either. What .config settings do I need for this? I have:
> > 
> > It's a lot worse than that ... every transport class plus some of the
> > core attributes will need this.
> 
> Actually, it looks like we can fix all the transport classes at one go
> in the attribute container code rather than doing this per-attribute.
> 
> Can someone who sees the problem check this out?
> 
> Thanks,
> 
> James
> 
> ---
> 
> diff --git a/drivers/base/attribute_container.c b/drivers/base/attribute_container.c
> index b9cda05..8fc200b 100644
> --- a/drivers/base/attribute_container.c
> +++ b/drivers/base/attribute_container.c
> @@ -328,6 +328,7 @@ attribute_container_add_attrs(struct device *classdev)
>  		return sysfs_create_group(&classdev->kobj, cont->grp);
> 
>  	for (i = 0; attrs[i]; i++) {
> +		sysfs_attr_init(&attrs[i]->attr);
>  		error = device_create_file(classdev, attrs[i]);
>  		if (error)
>  			return error;
> 

I just tested it with the zfcp driver and this approach works for me.
However, this would put all transport attributes in the same class for
the lock dependency tracker. For the fc_host and fc_remote_port
attributes exported for zfcp, this is no problem. I don't know if this
would be a problem for drivers using the vport_create and vport_delete
attributes.

Christof

  reply	other threads:[~2010-03-22 10:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 10:14 [PATCH] scsi_transport_fc: Initialize sysfs attributes with sysfs_attr_init Christof Schmitt
2010-03-16 20:48 ` Mike Christie
2010-03-16 20:49   ` James Bottomley
2010-03-17 13:20     ` Christof Schmitt
2010-03-20 17:44     ` James Bottomley
2010-03-22 10:13       ` Christof Schmitt [this message]
2010-03-22 19:16       ` Alex.Iannicelli

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=20100322101308.GA6953@schmichrtp.mainz.de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Bottomley@suse.de \
    --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