2005-11-11 15:32:21

by Tom Rini

[permalink] [raw]
Subject: SysFS 'module' params with CONFIG_MODULES=n

On 2.6.14, and probably newer, a system where CONFIG_MODULES=n
/sys/module/foo/parameters/param fails:

# cat /sys/module/tcp_bic/parameters/low_window
cat: /sys/module/tcp_bic/parameters/low_window: Permission denied

But just changing MODULES to y:

# cat /sys/module/tcp_bic/parameters/low_window
14

Is this intentional or fixable? Just an observation right now, thanks.

--
Tom Rini
http://gate.crashing.org/~trini/


2005-11-12 04:48:13

by Greg KH

[permalink] [raw]
Subject: Re: SysFS 'module' params with CONFIG_MODULES=n

On Fri, Nov 11, 2005 at 08:32:20AM -0700, Tom Rini wrote:
> On 2.6.14, and probably newer, a system where CONFIG_MODULES=n
> /sys/module/foo/parameters/param fails:
>
> # cat /sys/module/tcp_bic/parameters/low_window
> cat: /sys/module/tcp_bic/parameters/low_window: Permission denied
>
> But just changing MODULES to y:
>
> # cat /sys/module/tcp_bic/parameters/low_window
> 14
>
> Is this intentional or fixable? Just an observation right now, thanks.

Not intentional at all. Did this work before 2.6.14?

thanks,

greg k-h

2005-11-12 19:50:17

by Jason Wessel

[permalink] [raw]
Subject: Re: SysFS 'module' params with CONFIG_MODULES=n

Index: linux-2.6.14/kernel/params.c
===================================================================
--- linux-2.6.14.orig/kernel/params.c 2005-11-11 08:40:03.456317256 -0800
+++ linux-2.6.14/kernel/params.c 2005-11-12 11:43:00.439765632 -0800
@@ -618,8 +618,6 @@ static void __init param_sysfs_builtin(v


/* module-related sysfs stuff */
-#ifdef CONFIG_MODULES
-
#define to_module_attr(n) container_of(n, struct module_attribute, attr);
#define to_module_kobject(n) container_of(n, struct module_kobject, kobj);

@@ -676,13 +674,6 @@ static struct sysfs_ops module_sysfs_ops
.store = module_attr_store,
};

-#else
-static struct sysfs_ops module_sysfs_ops = {
- .show = NULL,
- .store = NULL,
-};
-#endif
-
static struct kobj_type module_ktype = {
.sysfs_ops = &module_sysfs_ops,
};


Attachments:
params_sysfs.patch (802.00 B)