2010-07-29 05:14:36

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH 0/6] Remove owner field from sysfs attribute structure

The following comment is found in include/linux/sysfs.h:

/* FIXME
* The *owner field is no longer used.
* x86 tree has been cleaned up. The owner
* attribute is still left for other arches.
*/

As it turns out, the *owner field is (again?) initialized in several modules,
suggesting that such initialization may be creeping back into the code.

This patch set removes the above comment, the *owner field, and each instance
in the code where it was found to be initialized.

Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
and sparc defconfig builds.


2010-07-29 05:13:59

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH 3/6] leds: Remove owner field from attribute initialization in bd2802 driver

Signed-off-by: Guenter Roeck <[email protected]>
---
drivers/leds/leds-bd2802.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/drivers/leds/leds-bd2802.c b/drivers/leds/leds-bd2802.c
index 5dcdf9d..19dc4b6 100644
--- a/drivers/leds/leds-bd2802.c
+++ b/drivers/leds/leds-bd2802.c
@@ -351,7 +351,7 @@ static ssize_t bd2802_store_reg##reg_addr(struct device *dev, \
return count; \
} \
static struct device_attribute bd2802_reg##reg_addr##_attr = { \
- .attr = {.name = reg_name, .mode = 0644, .owner = THIS_MODULE}, \
+ .attr = {.name = reg_name, .mode = 0644}, \
.store = bd2802_store_reg##reg_addr, \
};

@@ -482,7 +482,6 @@ static struct device_attribute bd2802_adv_conf_attr = {
.attr = {
.name = "advanced_configuration",
.mode = 0644,
- .owner = THIS_MODULE
},
.show = bd2802_show_adv_conf,
.store = bd2802_store_adv_conf,
@@ -519,7 +518,6 @@ static struct device_attribute bd2802_##attr_name##_attr = { \
.attr = { \
.name = name_str, \
.mode = 0644, \
- .owner = THIS_MODULE \
}, \
.show = bd2802_show_##attr_name, \
.store = bd2802_store_##attr_name, \
--
1.7.0.87.g0901d

2010-07-29 05:14:32

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH 5/6] powerpc/pci: Remove owner field from attribute initialization in PCI bridge init

Signed-off-by: Guenter Roeck <[email protected]>
---
arch/powerpc/sysdev/mv64x60_pci.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index 198f288..77bb3f4 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -73,7 +73,6 @@ static struct bin_attribute mv64x60_hs_reg_attr = { /* Hotswap register */
.attr = {
.name = "hs_reg",
.mode = S_IRUGO | S_IWUSR,
- .owner = THIS_MODULE,
},
.size = MV64X60_VAL_LEN_MAX,
.read = mv64x60_hs_reg_read,
--
1.7.0.87.g0901d

2010-07-29 05:14:28

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH 2/6] scsi: Remove owner field from attribute initialization in ARCMSR driver

Signed-off-by: Guenter Roeck <[email protected]>
---
drivers/scsi/arcmsr/arcmsr_attr.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/arcmsr/arcmsr_attr.c b/drivers/scsi/arcmsr/arcmsr_attr.c
index 07fdfe5..a4e04c5 100644
--- a/drivers/scsi/arcmsr/arcmsr_attr.c
+++ b/drivers/scsi/arcmsr/arcmsr_attr.c
@@ -192,7 +192,6 @@ static struct bin_attribute arcmsr_sysfs_message_read_attr = {
.attr = {
.name = "mu_read",
.mode = S_IRUSR ,
- .owner = THIS_MODULE,
},
.size = 1032,
.read = arcmsr_sysfs_iop_message_read,
@@ -202,7 +201,6 @@ static struct bin_attribute arcmsr_sysfs_message_write_attr = {
.attr = {
.name = "mu_write",
.mode = S_IWUSR,
- .owner = THIS_MODULE,
},
.size = 1032,
.write = arcmsr_sysfs_iop_message_write,
@@ -212,7 +210,6 @@ static struct bin_attribute arcmsr_sysfs_message_clear_attr = {
.attr = {
.name = "mu_clear",
.mode = S_IWUSR,
- .owner = THIS_MODULE,
},
.size = 1,
.write = arcmsr_sysfs_iop_message_clear,
--
1.7.0.87.g0901d

2010-07-29 05:13:55

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH 6/6] Remove owner field from sysfs struct attribute

Signed-off-by: Guenter Roeck <[email protected]>
---
include/linux/sysfs.h | 6 ------
1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index f2694eb..880fa1a 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -22,14 +22,8 @@ struct kobject;
struct module;
enum kobj_ns_type;

-/* FIXME
- * The *owner field is no longer used.
- * x86 tree has been cleaned up. The owner
- * attribute is still left for other arches.
- */
struct attribute {
const char *name;
- struct module *owner;
mode_t mode;
#ifdef CONFIG_DEBUG_LOCK_ALLOC
struct lock_class_key *key;
--
1.7.0.87.g0901d

2010-07-29 05:14:40

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH 1/6] scsi: Remove owner field from attribute initialization in LPFC driver

Signed-off-by: Guenter Roeck <[email protected]>
---
drivers/scsi/lpfc/lpfc_attr.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index bf33b31..8f89edf 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -2720,7 +2720,6 @@ static struct bin_attribute sysfs_drvr_stat_data_attr = {
.attr = {
.name = "lpfc_drvr_stat_data",
.mode = S_IRUSR,
- .owner = THIS_MODULE,
},
.size = LPFC_MAX_TARGET * MAX_STAT_DATA_SIZE_PER_TARGET,
.read = sysfs_drvr_stat_data_read,
--
1.7.0.87.g0901d

2010-07-29 05:18:32

by Guenter Roeck

[permalink] [raw]
Subject: [PATCH 4/6] regulator: Remove owner field from attribute initialization in regulator core driver

Signed-off-by: Guenter Roeck <[email protected]>
---
drivers/regulator/core.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 2248087..422a709 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1025,7 +1025,6 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,
if (regulator->dev_attr.attr.name == NULL)
goto attr_name_err;

- regulator->dev_attr.attr.owner = THIS_MODULE;
regulator->dev_attr.attr.mode = 0444;
regulator->dev_attr.show = device_requested_uA_show;
err = device_create_file(dev, &regulator->dev_attr);
--
1.7.0.87.g0901d

2010-07-29 06:16:37

by Eric Biederman

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Wed, Jul 28, 2010 at 10:09 PM, Guenter Roeck
<[email protected]> wrote:
> The following comment is found in include/linux/sysfs.h:
>
> ? /* FIXME
> ? ?* The *owner field is no longer used.
> ? ?* x86 tree has been cleaned up. The owner
> ? ?* attribute is still left for other arches.
> ? ?*/
>
> As it turns out, the *owner field is (again?) initialized in several modules,
> suggesting that such initialization may be creeping back into the code.
>
> This patch set removes the above comment, the *owner field, and each instance
> in the code where it was found to be initialized.
>
> Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> and sparc defconfig builds.

This seems reasonable to me. Can we get this in linux-next?

Eric

2010-07-29 17:15:45

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 4/6] regulator: Remove owner field from attribute initialization in regulator core driver

On Wed, Jul 28, 2010 at 10:09:24PM -0700, Guenter Roeck wrote:
> Signed-off-by: Guenter Roeck <[email protected]>

Acked-by: Mark Brown <[email protected]>

2010-07-30 08:46:44

by Tejun Heo

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> The following comment is found in include/linux/sysfs.h:
>
> /* FIXME
> * The *owner field is no longer used.
> * x86 tree has been cleaned up. The owner
> * attribute is still left for other arches.
> */
>
> As it turns out, the *owner field is (again?) initialized in several modules,
> suggesting that such initialization may be creeping back into the code.
>
> This patch set removes the above comment, the *owner field, and each instance
> in the code where it was found to be initialized.
>
> Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> and sparc defconfig builds.

Yeah, the change is way overdue. Maybe we should have just removed
them back then.

Acked-by: Tejun Heo <[email protected]>

Thanks.

--
tejun

2010-07-30 10:56:27

by Benjamin Herrenschmidt

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > The following comment is found in include/linux/sysfs.h:
> >
> > /* FIXME
> > * The *owner field is no longer used.
> > * x86 tree has been cleaned up. The owner
> > * attribute is still left for other arches.
> > */
> >
> > As it turns out, the *owner field is (again?) initialized in several modules,
> > suggesting that such initialization may be creeping back into the code.
> >
> > This patch set removes the above comment, the *owner field, and each instance
> > in the code where it was found to be initialized.
> >
> > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > and sparc defconfig builds.
>
> Yeah, the change is way overdue. Maybe we should have just removed
> them back then.

I'm happy with the powerpc related patches as long as we all agree that
needs to go. Do you need me to put some of this in powerpc.git or are
you carrying them all to Linus ?

Cheers,
Ben.

> Acked-by: Tejun Heo <[email protected]>
>
> Thanks.
>

2010-07-30 14:41:53

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Fri, Jul 30, 2010 at 08:28:10PM +1000, Benjamin Herrenschmidt wrote:
> On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> > On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > > The following comment is found in include/linux/sysfs.h:
> > >
> > > /* FIXME
> > > * The *owner field is no longer used.
> > > * x86 tree has been cleaned up. The owner
> > > * attribute is still left for other arches.
> > > */
> > >
> > > As it turns out, the *owner field is (again?) initialized in several modules,
> > > suggesting that such initialization may be creeping back into the code.
> > >
> > > This patch set removes the above comment, the *owner field, and each instance
> > > in the code where it was found to be initialized.
> > >
> > > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > > and sparc defconfig builds.
> >
> > Yeah, the change is way overdue. Maybe we should have just removed
> > them back then.
>
> I'm happy with the powerpc related patches as long as we all agree that
> needs to go. Do you need me to put some of this in powerpc.git or are
> you carrying them all to Linus ?

I can carry them all in my driver-core tree if you don't object.

thanks,

greg k-h

2010-08-02 16:50:06

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Fri, 2010-07-30 at 10:36 -0400, Greg KH wrote:
> On Fri, Jul 30, 2010 at 08:28:10PM +1000, Benjamin Herrenschmidt wrote:
> > On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> > > On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > > > The following comment is found in include/linux/sysfs.h:
> > > >
> > > > /* FIXME
> > > > * The *owner field is no longer used.
> > > > * x86 tree has been cleaned up. The owner
> > > > * attribute is still left for other arches.
> > > > */
> > > >
> > > > As it turns out, the *owner field is (again?) initialized in several modules,
> > > > suggesting that such initialization may be creeping back into the code.
> > > >
> > > > This patch set removes the above comment, the *owner field, and each instance
> > > > in the code where it was found to be initialized.
> > > >
> > > > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > > > and sparc defconfig builds.
> > >
> > > Yeah, the change is way overdue. Maybe we should have just removed
> > > them back then.
> >
> > I'm happy with the powerpc related patches as long as we all agree that
> > needs to go. Do you need me to put some of this in powerpc.git or are
> > you carrying them all to Linus ?
>
> I can carry them all in my driver-core tree if you don't object.
>
Any final verdict ?

Not that it is my decision to make, but I think it would be better to
have it all in one tree. Otherwise the timing for the last patch would
get a bit complicated.

Thanks,
Guenter

2010-08-02 17:13:02

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Mon, Aug 02, 2010 at 09:15:24AM -0700, Guenter Roeck wrote:
> On Fri, 2010-07-30 at 10:36 -0400, Greg KH wrote:
> > On Fri, Jul 30, 2010 at 08:28:10PM +1000, Benjamin Herrenschmidt wrote:
> > > On Fri, 2010-07-30 at 10:45 +0200, Tejun Heo wrote:
> > > > On 07/29/2010 07:09 AM, Guenter Roeck wrote:
> > > > > The following comment is found in include/linux/sysfs.h:
> > > > >
> > > > > /* FIXME
> > > > > * The *owner field is no longer used.
> > > > > * x86 tree has been cleaned up. The owner
> > > > > * attribute is still left for other arches.
> > > > > */
> > > > >
> > > > > As it turns out, the *owner field is (again?) initialized in several modules,
> > > > > suggesting that such initialization may be creeping back into the code.
> > > > >
> > > > > This patch set removes the above comment, the *owner field, and each instance
> > > > > in the code where it was found to be initialized.
> > > > >
> > > > > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > > > > and sparc defconfig builds.
> > > >
> > > > Yeah, the change is way overdue. Maybe we should have just removed
> > > > them back then.
> > >
> > > I'm happy with the powerpc related patches as long as we all agree that
> > > needs to go. Do you need me to put some of this in powerpc.git or are
> > > you carrying them all to Linus ?
> >
> > I can carry them all in my driver-core tree if you don't object.
> >
> Any final verdict ?
>
> Not that it is my decision to make, but I think it would be better to
> have it all in one tree. Otherwise the timing for the last patch would
> get a bit complicated.

I'll take it.

thanks,

greg k-h

2010-08-02 23:32:12

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Wed, Jul 28, 2010 at 11:16:35PM -0700, Eric Biederman wrote:
> On Wed, Jul 28, 2010 at 10:09 PM, Guenter Roeck
> <[email protected]> wrote:
> > The following comment is found in include/linux/sysfs.h:
> >
> > ? /* FIXME
> > ? ?* The *owner field is no longer used.
> > ? ?* x86 tree has been cleaned up. The owner
> > ? ?* attribute is still left for other arches.
> > ? ?*/
> >
> > As it turns out, the *owner field is (again?) initialized in several modules,
> > suggesting that such initialization may be creeping back into the code.
> >
> > This patch set removes the above comment, the *owner field, and each instance
> > in the code where it was found to be initialized.
> >
> > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > and sparc defconfig builds.
>
> This seems reasonable to me. Can we get this in linux-next?

It will show up in linux-next tomorrow.

thanks,

greg k-h

2010-08-10 13:44:26

by Jean Delvare

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Mon, 2 Aug 2010 16:31:28 -0700, Greg KH wrote:
> On Wed, Jul 28, 2010 at 11:16:35PM -0700, Eric Biederman wrote:
> > On Wed, Jul 28, 2010 at 10:09 PM, Guenter Roeck
> > <[email protected]> wrote:
> > > The following comment is found in include/linux/sysfs.h:
> > >
> > >   /* FIXME
> > >    * The *owner field is no longer used.
> > >    * x86 tree has been cleaned up. The owner
> > >    * attribute is still left for other arches.
> > >    */
> > >
> > > As it turns out, the *owner field is (again?) initialized in several modules,
> > > suggesting that such initialization may be creeping back into the code.
> > >
> > > This patch set removes the above comment, the *owner field, and each instance
> > > in the code where it was found to be initialized.
> > >
> > > Compiled with x86 allmodconfig as well as with all alpha, arm, mips, powerpc,
> > > and sparc defconfig builds.
> >
> > This seems reasonable to me. Can we get this in linux-next?
>
> It will show up in linux-next tomorrow.

Related bug?

https://bugzilla.kernel.org/show_bug.cgi?id=16544

--
Jean Delvare

2010-08-10 15:17:53

by Stephen Rothwell

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

Hi Jean,

On Tue, 10 Aug 2010 15:43:37 +0200 Jean Delvare <[email protected]> wrote:
>
> Related bug?
>
> https://bugzilla.kernel.org/show_bug.cgi?id=16544

Yep, fixed in linux-next today - hopefully the fix is on its way to Linus.

--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (338.00 B)
(No filename) (490.00 B)
Download all attachments

2010-08-10 15:20:12

by Stephen Rothwell

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

Hi Jean,

On Wed, 11 Aug 2010 01:17:33 +1000 Stephen Rothwell <[email protected]> wrote:
>
> On Tue, 10 Aug 2010 15:43:37 +0200 Jean Delvare <[email protected]> wrote:
> >
> > Related bug?
> >
> > https://bugzilla.kernel.org/show_bug.cgi?id=16544
>
> Yep, fixed in linux-next today - hopefully the fix is on its way to Linus.

Sorry, more info:

Fixed by commit 690e85a3957291f4cfe0cac22d97994ec7e5ee45 ("olpc_battery:
Fix build failure caused by sysfs changes") from the battery tree.
--
Cheers,
Stephen Rothwell [email protected]
http://www.canb.auug.org.au/~sfr/


Attachments:
(No filename) (595.00 B)
(No filename) (490.00 B)
Download all attachments

2010-08-10 16:47:16

by Guenter Roeck

[permalink] [raw]
Subject: Re: [PATCH 0/6] Remove owner field from sysfs attribute structure

On Tue, 2010-08-10 at 11:20 -0400, Stephen Rothwell wrote:
> Hi Jean,
>
> On Wed, 11 Aug 2010 01:17:33 +1000 Stephen Rothwell <[email protected]> wrote:
> >
> > On Tue, 10 Aug 2010 15:43:37 +0200 Jean Delvare <[email protected]> wrote:
> > >
> > > Related bug?
> > >
> > > https://bugzilla.kernel.org/show_bug.cgi?id=16544
> >
> > Yep, fixed in linux-next today - hopefully the fix is on its way to Linus.
>
> Sorry, more info:
>
> Fixed by commit 690e85a3957291f4cfe0cac22d97994ec7e5ee45 ("olpc_battery:
> Fix build failure caused by sysfs changes") from the battery tree.

Excellent. Guess the patch I sent out earlier today to fix the problem
wasn't needed then.

Guenter