From: Andy Whitcroft <apw@shadowen.org>
To: Kay Sievers <kay.sievers@vrfy.org>
Cc: Greg KH <greg@kroah.com>,
Mariusz Kozlowski <m.kozlowski@tuxland.pl>,
Andrew Morton <akpm@osdl.org>,
linux-kernel@vger.kernel.org
Subject: Re: 2.6.19-rc6-mm2
Date: Wed, 29 Nov 2006 22:54:10 +0000 [thread overview]
Message-ID: <456E0F92.2010200@shadowen.org> (raw)
In-Reply-To: <1164791161.3613.106.camel@pim.off.vrfy.org>
Kay Sievers wrote:
> On Tue, 2006-11-28 at 14:30 -0800, Greg KH wrote:
>> On Tue, Nov 28, 2006 at 12:35:43PM +0100, Mariusz Kozlowski wrote:
>>> Hello,
>>>
>>> When CONFIG_MODULE_UNLOAD is not set then this happens:
>>>
>>> CC kernel/module.o
>>> kernel/module.c:852: error: `initstate' undeclared here (not in a function)
>>> kernel/module.c:852: error: initializer element is not constant
>>> kernel/module.c:852: error: (near initialization for `modinfo_attrs[2]')
>>> make[1]: *** [kernel/module.o] Error 1
>>> make: *** [kernel] Error 2
>>>
>>> Reference to 'initstate' should stay under #ifdef CONFIG_MODULE_UNLOAD
>>> as its definition I guess.
>>>
>>> Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
>>>
>>> --- linux-2.6.19-rc6-mm2-a/kernel/module.c 2006-11-28 12:17:09.000000000 +0100
>>> +++ linux-2.6.19-rc6-mm2-b/kernel/module.c 2006-11-28 12:05:01.000000000 +0100
>>> @@ -849,8 +849,8 @@ static inline void module_unload_init(st
>>> static struct module_attribute *modinfo_attrs[] = {
>>> &modinfo_version,
>>> &modinfo_srcversion,
>>> - &initstate,
>>> #ifdef CONFIG_MODULE_UNLOAD
>>> + &initstate,
>>> &refcnt,
>>> #endif
>> Kay, is this correct? I think we still need this information exported
>> to userspace, even if we can't unload modules, right?
>
> Yes, instead we should move the attribute out of the ifdef, so
> it will be there, even when modules can't be unloaded.
>
> Thanks,
> Kay
You here say move the attribute, but the patch here just adds it. Is
this right?? Looking at whats there before this patch it appears to
duplicate the code from inside the #ifdef, so we have two copies when
CONFIG_MODULE_UNLOAD is defined.
>
> ------------------------------------------------------------------------
>
> diff --git a/kernel/module.c b/kernel/module.c
> index f016656..0648f5d 100644
> --- a/kernel/module.c
> +++ b/kernel/module.c
> @@ -811,9 +811,34 @@ static inline void module_unload_init(st
> }
> #endif /* CONFIG_MODULE_UNLOAD */
>
> +static ssize_t show_initstate(struct module_attribute *mattr,
> + struct module *mod, char *buffer)
> +{
> + const char *state = "unknown";
> +
> + switch (mod->state) {
> + case MODULE_STATE_LIVE:
> + state = "live";
> + break;
> + case MODULE_STATE_COMING:
> + state = "coming";
> + break;
> + case MODULE_STATE_GOING:
> + state = "going";
> + break;
> + }
> + return sprintf(buffer, "%s\n", state);
> +}
> +
> +static struct module_attribute initstate = {
> + .attr = { .name = "initstate", .mode = 0444, .owner = THIS_MODULE },
> + .show = show_initstate,
> +};
> +
> static struct module_attribute *modinfo_attrs[] = {
> &modinfo_version,
> &modinfo_srcversion,
> + &initstate,
> #ifdef CONFIG_MODULE_UNLOAD
> &refcnt,
> #endif
-apw
next prev parent reply other threads:[~2006-11-29 22:54 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-11-28 10:02 2.6.19-rc6-mm2 Andrew Morton
2006-11-28 10:08 ` 2.6.19-rc6-mm2 Akinobu Mita
2006-11-28 11:35 ` 2.6.19-rc6-mm2 Mariusz Kozlowski
2006-11-28 11:41 ` 2.6.19-rc6-mm2 Mariusz Kozlowski
2006-11-28 22:30 ` 2.6.19-rc6-mm2 Greg KH
2006-11-29 9:06 ` 2.6.19-rc6-mm2 Kay Sievers
2006-11-29 22:54 ` Andy Whitcroft [this message]
2006-11-29 23:09 ` 2.6.19-rc6-mm2 Kay Sievers
2006-11-28 21:22 ` 2.6.19-rc6-mm2 Miles Lane
2006-11-28 21:59 ` 2.6.19-rc6-mm2 Vivek Goyal
2006-11-29 0:24 ` 2.6.19-rc6-mm2 Thomas Tuttle
2006-11-29 0:53 ` 2.6.19-rc6-mm2 Andrew Morton
2006-11-29 5:17 ` 2.6.19-rc6-mm2 Avi Kivity
2006-11-29 14:10 ` 2.6.19-rc6-mm2 Avi Kivity
2006-12-03 8:46 ` 2.6.19-rc6-mm2 Avi Kivity
2006-11-29 0:58 ` 2.6.19-rc6-mm2 Andrew Morton
2006-11-29 1:08 ` 2.6.19-rc6-mm2 Jean Tourrilhes
2006-11-29 0:59 ` 2.6.19-rc6-mm2 Jiri Kosina
2006-12-05 1:33 ` 2.6.19-rc6-mm2 Neil Brown
2006-12-05 4:07 ` 2.6.19-rc6-mm2 Neil Brown
2006-12-05 7:48 ` 2.6.19-rc6-mm2 Jiri Kosina
2006-12-05 22:13 ` 2.6.19-rc6-mm2 Jiri Kosina
2006-12-08 1:31 ` 2.6.19-rc6-mm2 Neil Brown
2006-12-08 12:35 ` 2.6.19-rc6-mm2 Jiri Kosina
2006-11-29 10:04 ` [-mm patch] #if 0 fs/gfs2/acl.c:gfs2_check_acl() Adrian Bunk
2006-11-29 10:14 ` Steven Whitehouse
2006-11-29 12:42 ` [PATCH] compile fix on x86 without X86_LOCAL_APIC (was 2.6.19-rc6-mm2) Jiri Kosina
2006-11-29 20:57 ` Andrew Morton
2006-11-29 19:54 ` 2.6.19-rc6-mm2: uli526x only works after reload Rafael J. Wysocki
2006-11-29 20:08 ` Rafael J. Wysocki
2006-11-29 21:30 ` Andrew Morton
2006-11-29 21:31 ` Rafael J. Wysocki
2006-11-29 23:08 ` Rafael J. Wysocki
2006-11-29 23:26 ` Andrew Morton
2006-11-30 1:04 ` Rafael J. Wysocki
2006-11-30 2:18 ` Andrew Morton
2006-12-01 1:20 ` Greg KH
2006-12-02 0:07 ` Rafael J. Wysocki
2006-11-30 20:21 ` Rafael J. Wysocki
2006-11-30 21:12 ` Andrew Morton
2006-11-30 21:32 ` Rafael J. Wysocki
2006-12-01 1:08 ` Rafael J. Wysocki
2006-12-01 1:27 ` Greg KH
2006-12-04 23:13 ` Greg KH
2006-11-30 3:42 ` 2.6.19-rc6-mm2 Ed Tomlinson
2006-11-30 4:10 ` 2.6.19-rc6-mm2 Randy Dunlap
2006-11-30 13:03 ` 2.6.19-rc6-mm2 Ed Tomlinson
2006-12-02 0:33 ` 2.6.19-rc6-mm2 Ed Tomlinson
2006-12-02 0:32 ` 2.6.19-rc6-mm2 Andrew Morton
2006-12-02 3:19 ` 2.6.19-rc6-mm2 Ed Tomlinson
2006-12-02 4:09 ` 2.6.19-rc6-mm2 Akinobu Mita
2006-12-02 22:29 ` 2.6.19-rc6-mm2 Ed Tomlinson
2006-12-02 12:17 ` [-mm patch] arch/frv/kernel/futex.c must #include <linux/uaccess.h> Adrian Bunk
2006-12-04 11:20 ` David Howells
2006-12-02 17:54 ` [-mm patch] fix include/asm-xtensa/unistd.h compilation Adrian Bunk
2006-12-03 7:49 ` [-mm patch] drivers/net/netxen/: possible cleanups Adrian Bunk
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=456E0F92.2010200@shadowen.org \
--to=apw@shadowen.org \
--cc=akpm@osdl.org \
--cc=greg@kroah.com \
--cc=kay.sievers@vrfy.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.kozlowski@tuxland.pl \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox