public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.5.45: NTFS unresolved symbol
@ 2002-11-01  3:31 Dieter Nützel
  2002-11-01 12:20 ` Pawel Kot
  0 siblings, 1 reply; 5+ messages in thread
From: Dieter Nützel @ 2002-11-01  3:31 UTC (permalink / raw)
  To: Anton Altaparmakov; +Cc: Linux Kernel List

depmod: *** Unresolved symbols in /lib/modules/2.5.45/kernel/fs/ntfs/ntfs.o
depmod:         page_states__per_cpu
/lib/modules/2.5.45/kernel/fs/ntfs/ntfs.o

x86 (Athlon)

-Dieter

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.45: NTFS unresolved symbol
  2002-11-01  3:31 2.5.45: NTFS unresolved symbol Dieter Nützel
@ 2002-11-01 12:20 ` Pawel Kot
  2002-11-01 19:48   ` Andrew Morton
  0 siblings, 1 reply; 5+ messages in thread
From: Pawel Kot @ 2002-11-01 12:20 UTC (permalink / raw)
  To: Dieter Nützel; +Cc: Anton Altaparmakov, Linux Kernel List

On Fri, 1 Nov 2002, Dieter [iso-8859-15] Nützel wrote:

> depmod: *** Unresolved symbols in /lib/modules/2.5.45/kernel/fs/ntfs/ntfs.o
> depmod:         page_states__per_cpu
> /lib/modules/2.5.45/kernel/fs/ntfs/ntfs.o

Hi, The following patch should fix it:
--- kernel/ksyms.c~	Fri Nov  1 13:16:51 2002
+++ kernel/ksyms.c	Fri Nov  1 13:16:51 2002
@@ -112,6 +112,7 @@
 EXPORT_SYMBOL(vunmap);
 EXPORT_SYMBOL(vmalloc_to_page);
 EXPORT_SYMBOL(remap_page_range);
+EXPORT_SYMBOL(page_states__per_cpu);
 #ifndef CONFIG_DISCONTIGMEM
 EXPORT_SYMBOL(contig_page_data);
 EXPORT_SYMBOL(mem_map);

pkot
-- 
mailto:pkot@linuxnews.pl :: mailto:pkot@slackware.pl
http://kt.linuxnews.pl/ :: Kernel Traffic po polsku


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.45: NTFS unresolved symbol
  2002-11-01 12:20 ` Pawel Kot
@ 2002-11-01 19:48   ` Andrew Morton
  2002-11-01 20:00     ` Sam Ravnborg
  2002-11-01 22:24     ` Rusty Russell
  0 siblings, 2 replies; 5+ messages in thread
From: Andrew Morton @ 2002-11-01 19:48 UTC (permalink / raw)
  To: Pawel Kot, Rusty Russell
  Cc: Dieter Nützel, Anton Altaparmakov, Linux Kernel List

Pawel Kot wrote:
> 
> On Fri, 1 Nov 2002, Dieter [iso-8859-15] Nützel wrote:
> 
> > depmod: *** Unresolved symbols in /lib/modules/2.5.45/kernel/fs/ntfs/ntfs.o
> > depmod:         page_states__per_cpu
> > /lib/modules/2.5.45/kernel/fs/ntfs/ntfs.o
> 
> Hi, The following patch should fix it:
> --- kernel/ksyms.c~     Fri Nov  1 13:16:51 2002
> +++ kernel/ksyms.c      Fri Nov  1 13:16:51 2002
> @@ -112,6 +112,7 @@
>  EXPORT_SYMBOL(vunmap);
>  EXPORT_SYMBOL(vmalloc_to_page);
>  EXPORT_SYMBOL(remap_page_range);
> +EXPORT_SYMBOL(page_states__per_cpu);
>  #ifndef CONFIG_DISCONTIGMEM
>  EXPORT_SYMBOL(contig_page_data);
>  EXPORT_SYMBOL(mem_map);

Oh gawd.  Here's what happened..

We have these magical symbols which describe the offset of
a member of the per-cpu storage, which need to be exposed
to modules.  So I added an EXPORT_PER_CPU_SYMBOL() helper:

#define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var##__per_cpu)
#define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var##__per_cpu)

Which works OK without module versioning.  But with module versioning,
genksyms goes looking through source files for "EXPORT_SYMBOL".  Which
isn't there.

So sigh.  Need to go back to the drawing board on that one.  In
the meantime, this should work?


--- 25/mm/page_alloc.c~genksyms-hurts	Fri Nov  1 11:47:42 2002
+++ 25-akpm/mm/page_alloc.c	Fri Nov  1 11:47:53 2002
@@ -650,7 +650,7 @@ unsigned int nr_free_highpages (void)
  * during and after execution of this function.
  */
 DEFINE_PER_CPU(struct page_state, page_states) = {0};
-EXPORT_PER_CPU_SYMBOL(page_states);
+EXPORT_SYMBOL(page_states__per_cpu);
 
 void __get_page_state(struct page_state *ret, int nr)
 {

.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.45: NTFS unresolved symbol
  2002-11-01 19:48   ` Andrew Morton
@ 2002-11-01 20:00     ` Sam Ravnborg
  2002-11-01 22:24     ` Rusty Russell
  1 sibling, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2002-11-01 20:00 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Pawel Kot, Rusty Russell, Dieter Nützel, Anton Altaparmakov,
	Linux Kernel List

On Fri, Nov 01, 2002 at 11:48:48AM -0800, Andrew Morton wrote:
> We have these magical symbols which describe the offset of
> a member of the per-cpu storage, which need to be exposed
> to modules.  So I added an EXPORT_PER_CPU_SYMBOL() helper:
> 
> #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var##__per_cpu)
> #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var##__per_cpu)

I would expect the following to work:
#define EXPORT_SYMBOL_PER_CPU(var) EXPORT_SYMBOL(var##__per_cpu)
#define EXPORT_SYMBOL_PER_CPU_GPL(var) EXPORT_SYMBOL_GPL(var##__per_cpu)

In this case the magic "EXPORT_SYMBOL" is still present.

	Sam

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 2.5.45: NTFS unresolved symbol
  2002-11-01 19:48   ` Andrew Morton
  2002-11-01 20:00     ` Sam Ravnborg
@ 2002-11-01 22:24     ` Rusty Russell
  1 sibling, 0 replies; 5+ messages in thread
From: Rusty Russell @ 2002-11-01 22:24 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Pawel Kot, torvalds, Dieter Nützel, Anton Altaparmakov,
	Linux Kernel List

In message <3DC2DAA0.A46C5085@digeo.com> you write:
> > +EXPORT_SYMBOL(page_states__per_cpu);

> Which works OK without module versioning.  But with module versioning,
> genksyms goes looking through source files for "EXPORT_SYMBOL".  Which
> isn't there.

Proper fix below.  Linus please apply.

The source is run through CPP before hitting genksyms (which is why
the #define EXPORT_SYMBOL is under #ifndef __GENKSYMS__).  So in fact,
"EXPORT_SYMBOL( page_states__per_cpu) ;" gets to kenksyms.  But your
fix doesn't work either: genksyms can't handle the __typeof__ in the
definition it sees, and gives up.

Note, that this fix (almost certainly) breaks:
	DEFINE_PER_CPU(int[3], myvar);
	EXPORT_PER_CPU_SYMBOL(myvar);

But we'd need to teach genksyms about EXPORT_PER_CPU_SYMBOL or
__typeof__ for that[1]

Rusty.
[1] Proving the point about the separation of that from the kernel
    source being wrong.
--
  Anyone who quotes me in their sig is an idiot. -- Rusty Russell.

diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.45/include/asm-generic/percpu.h working-2.5.45-tmp/include/asm-generic/percpu.h
--- linux-2.5.45/include/asm-generic/percpu.h	2002-10-31 12:36:56.000000000 +1100
+++ working-2.5.45-tmp/include/asm-generic/percpu.h	2002-11-02 09:20:06.000000000 +1100
@@ -35,4 +35,10 @@ extern unsigned long __per_cpu_offset[NR
 #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(var##__per_cpu)
 #define EXPORT_PER_CPU_SYMBOL_GPL(var) EXPORT_SYMBOL_GPL(var##__per_cpu)
 
+/* Genksyms can't follow the percpu declaration.  Give it a fake one. */
+#ifdef __GENKSYMS__
+#undef DEFINE_PER_CPU
+#define DEFINE_PER_CPU(type, name) type name##__per_cpu
+#endif /*__GENKSYMS__*/
+
 #endif /* _ASM_GENERIC_PERCPU_H_ */

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-11-01 22:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-01  3:31 2.5.45: NTFS unresolved symbol Dieter Nützel
2002-11-01 12:20 ` Pawel Kot
2002-11-01 19:48   ` Andrew Morton
2002-11-01 20:00     ` Sam Ravnborg
2002-11-01 22:24     ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox