All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Greg KH <gregkh@suse.de>
Cc: Tom Rini <trini@kernel.crashing.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: SysFS 'module' params with CONFIG_MODULES=n
Date: Sat, 12 Nov 2005 13:49:58 -0600	[thread overview]
Message-ID: <43764766.6010009@windriver.com> (raw)
In-Reply-To: <20051112043320.GA27472@suse.de>

[-- Attachment #1: Type: text/plain, Size: 967 bytes --]

Greg KH wrote:
> 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
>   
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 <jason.wessel@windriver.com>

Thanks,
Jason.





[-- Attachment #2: params_sysfs.patch --]
[-- Type: text/plain, Size: 802 bytes --]

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,
 };

      reply	other threads:[~2005-11-12 19:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-11 15:32 SysFS 'module' params with CONFIG_MODULES=n Tom Rini
2005-11-12  4:33 ` Greg KH
2005-11-12 19:49   ` Jason Wessel [this message]

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=43764766.6010009@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=trini@kernel.crashing.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.