Skip to contentSkip to conversation

SysFS 'module' params with CONFIG_MODULES=n

DISCUSSION Tom Rini 3 participants 3 messages Nov 11, 2005 – Nov 12, 2005

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

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.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#1 lore raw
Quoted 6 lines · Tom Rini

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
Quoted 6 lines

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

#2 lore raw
Quoted 13 lines · Greg KH
Quoted 11 lines · Tom Rini

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
Quoted 9 lines
Quoted 2 lines

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

I am not sure when it stopped working.

I recommend the attached patch to kernel/params.c All the work was done to setup the file and maintain the file handles but the access functions were zeroed out due to the #ifdef. Removing the #ifdef allows full access to all the parameters when CONFIG_MODULES=n.

signed off: Jason Wessel <[email protected]>

Thanks,
Jason.

kernel/params.c +0 -9
Index: linux-2.6.14/kernel/params.c
===================================================================
@@ -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,
 };