Skip to contentSkip to conversation

scsi: Add lockdep annotations to SAS sysfs attributes.

PATCH In review David Miller 2 participants 3 messages Apr 11, 2010 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 scsi: Add lockdep annotations to SAS sysfs attributes.

They are allocated dynamically, and thus need sysfs_attr_init() treatment.

drivers/scsi/scsi_transport_sas.c +4 -2
index 927e99c..f9c61b9 100644
@@ -1679,15 +1679,17 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
  */
 
 #define SETUP_TEMPLATE(attrb, field, perm, test)			\
-	i->private_##attrb[count] = dev_attr_##field;		\
+	i->private_##attrb[count] = dev_attr_##field;			\
 	i->private_##attrb[count].attr.mode = perm;			\
+	sysfs_attr_init(&i->private_##attrb[count].attr);		\
 	i->attrb[count] = &i->private_##attrb[count];			\
 	if (test)							\
 		count++
 
 #define SETUP_TEMPLATE_RW(attrb, field, perm, test, ro_test, ro_perm)	\
-	i->private_##attrb[count] = dev_attr_##field;		\
+	i->private_##attrb[count] = dev_attr_##field;			\
 	i->private_##attrb[count].attr.mode = perm;			\
+	sysfs_attr_init(&i->private_##attrb[count].attr);		\
 	if (ro_test) {							\
 		i->private_##attrb[count].attr.mode = ro_perm;		\
 		i->private_##attrb[count].store = NULL;			\
#1 lore raw
Quoted 2 lines · David Miller

They are allocated dynamically, and thus need sysfs_attr_init() treatment.

This should all be taken care of by

commit ebd09ec93c90c8ec571d7e166832fb1fc705bf5e

Author: James Bottomley <[email protected]>
Date:   Sat Mar 20 12:44:12 2010 -0500

[SCSI] attirbute_container: Initialize sysfs attributes with
sysfs_attr_init

I can't check the FC class, but I have checked the SAS one, and I don't see any more lockdep warn ons ... unless there's one I'm not seeing because of the options I've compiled with?

James

#2 lore raw

From: James Bottomley <[email protected]>
Date: Sun, 11 Apr 2010 07:35:12 -0500

Quoted 9 lines · David Miller
Quoted 2 lines

They are allocated dynamically, and thus need sysfs_attr_init() treatment.

This should all be taken care of by

commit ebd09ec93c90c8ec571d7e166832fb1fc705bf5e

Author: James Bottomley <[email protected]>
Date:   Sat Mar 20 12:44:12 2010 -0500

Thanks, that should take care of it, my sparc-2.6 tree hadn't sync'd with Linus's tree in a while. :-)