linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* OCFS2: __init / __exit problem
@ 2006-01-07 13:20 Jan-Benedict Glaw
  2006-01-07 19:07 ` [2.6 patch] " Adrian Bunk
  0 siblings, 1 reply; 6+ messages in thread
From: Jan-Benedict Glaw @ 2006-01-07 13:20 UTC (permalink / raw)
  To: mark.fasheh, kurt.hackel; +Cc: linux-kernel

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

Hi!

$ make ARCH=vax CROSS_COMPILE=vax-linux-uclibc- mopboot
:
  LD      .tmp_vmlinux1
`exit_ocfs2_uptodate_cache' referenced in section `.init.text' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o
`exit_ocfs2_extent_maps' referenced in section `.init.text' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o
make: *** [.tmp_vmlinux1] Error 1

This happens with CONFIG_MODULES=n because:

super.c:
~~~~~~~~
static int __init ocfs2_init(void)
{
:
leave:  
        if (status < 0) {
                ocfs2_free_mem_caches();
                exit_ocfs2_uptodate_cache();
                exit_ocfs2_extent_maps();
        }
:
}


uptodate.h:void __exit exit_ocfs2_uptodate_cache(void);
extent_map.c:void __exit exit_ocfs2_extent_maps(void)
extent_map.h:void exit_ocfs2_extent_maps(void);

So an __inint function references __exit functions (which are
discarded for non-modular builds) and the declaration of
exit_ocfs2_extent_maps() in extent_map.h is missing __exit.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

* [2.6 patch] OCFS2: __init / __exit problem
  2006-01-07 13:20 OCFS2: __init / __exit problem Jan-Benedict Glaw
@ 2006-01-07 19:07 ` Adrian Bunk
  2006-01-07 21:38   ` Mark Fasheh
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2006-01-07 19:07 UTC (permalink / raw)
  To: mark.fasheh, kurt.hackel, linux-kernel

On Sat, Jan 07, 2006 at 02:20:08PM +0100, Jan-Benedict Glaw wrote:
> Hi!
> 
> $ make ARCH=vax CROSS_COMPILE=vax-linux-uclibc- mopboot
> :
>   LD      .tmp_vmlinux1
> `exit_ocfs2_uptodate_cache' referenced in section `.init.text' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o
> `exit_ocfs2_extent_maps' referenced in section `.init.text' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o
> make: *** [.tmp_vmlinux1] Error 1
>...

Thanks for your report.

It's a real problem that due to the fact that these errors have become 
runtime errors on i386 in kernel 2.6, we do no longer have a big testing 
coverage for them.  :-(

Patch below.

> MfG, JBG

cu
Adrian


<--  snip  -->


Functions called by __init funtions mustn't be __exit.

Reported by Jan-Benedict Glaw <jbglaw@lug-owl.de>.


Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 fs/ocfs2/extent_map.c |    2 +-
 fs/ocfs2/uptodate.c   |    2 +-
 fs/ocfs2/uptodate.h   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--- linux-2.6.15-mm2-full/fs/ocfs2/uptodate.h.old	2006-01-07 19:45:11.000000000 +0100
+++ linux-2.6.15-mm2-full/fs/ocfs2/uptodate.h	2006-01-07 19:45:19.000000000 +0100
@@ -27,7 +27,7 @@
 #define OCFS2_UPTODATE_H
 
 int __init init_ocfs2_uptodate_cache(void);
-void __exit exit_ocfs2_uptodate_cache(void);
+void exit_ocfs2_uptodate_cache(void);
 
 void ocfs2_metadata_cache_init(struct inode *inode);
 void ocfs2_metadata_cache_purge(struct inode *inode);
--- linux-2.6.15-mm2-full/fs/ocfs2/uptodate.c.old	2006-01-07 19:45:35.000000000 +0100
+++ linux-2.6.15-mm2-full/fs/ocfs2/uptodate.c	2006-01-07 19:45:44.000000000 +0100
@@ -537,7 +537,7 @@
 	return 0;
 }
 
-void __exit exit_ocfs2_uptodate_cache(void)
+void exit_ocfs2_uptodate_cache(void)
 {
 	if (ocfs2_uptodate_cachep)
 		kmem_cache_destroy(ocfs2_uptodate_cachep);
--- linux-2.6.15-mm2-full/fs/ocfs2/extent_map.c.old	2006-01-07 19:46:08.000000000 +0100
+++ linux-2.6.15-mm2-full/fs/ocfs2/extent_map.c	2006-01-07 19:46:40.000000000 +0100
@@ -988,7 +988,7 @@
 	return 0;
 }
 
-void __exit exit_ocfs2_extent_maps(void)
+void exit_ocfs2_extent_maps(void)
 {
 	kmem_cache_destroy(ocfs2_em_ent_cachep);
 }


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

* Re: [2.6 patch] OCFS2: __init / __exit problem
  2006-01-07 19:07 ` [2.6 patch] " Adrian Bunk
@ 2006-01-07 21:38   ` Mark Fasheh
  2006-01-07 21:49     ` Adrian Bunk
  0 siblings, 1 reply; 6+ messages in thread
From: Mark Fasheh @ 2006-01-07 21:38 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: kurt.hackel, linux-kernel

On Sat, Jan 07, 2006 at 08:07:02PM +0100, Adrian Bunk wrote:
> It's a real problem that due to the fact that these errors have become 
> runtime errors on i386 in kernel 2.6, we do no longer have a big testing 
> coverage for them.  :-(
Indeed. Those function declarations have been in there for a while,
without any issue until now. Thanks for the patch Adrian.
	--Mark

--
Mark Fasheh
Senior Software Developer, Oracle
mark.fasheh@oracle.com


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

* Re: [2.6 patch] OCFS2: __init / __exit problem
  2006-01-07 21:38   ` Mark Fasheh
@ 2006-01-07 21:49     ` Adrian Bunk
  2006-01-07 21:51       ` Arjan van de Ven
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2006-01-07 21:49 UTC (permalink / raw)
  To: Mark Fasheh; +Cc: kurt.hackel, linux-kernel

On Sat, Jan 07, 2006 at 01:38:21PM -0800, Mark Fasheh wrote:
> On Sat, Jan 07, 2006 at 08:07:02PM +0100, Adrian Bunk wrote:
> > It's a real problem that due to the fact that these errors have become 
> > runtime errors on i386 in kernel 2.6, we do no longer have a big testing 
> > coverage for them.  :-(
> Indeed. Those function declarations have been in there for a while,
> without any issue until now. Thanks for the patch Adrian.

The runtime error on architectures like i386 occurs in the error path of 
ocfs2_init().

This is the common problem that such error paths are only used once 
every dozen years and therefore get no real testing coverage...

> 	--Mark

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


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

* Re: [2.6 patch] OCFS2: __init / __exit problem
  2006-01-07 21:49     ` Adrian Bunk
@ 2006-01-07 21:51       ` Arjan van de Ven
  2006-01-08  0:23         ` Randy.Dunlap
  0 siblings, 1 reply; 6+ messages in thread
From: Arjan van de Ven @ 2006-01-07 21:51 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Mark Fasheh, kurt.hackel, linux-kernel


> 
> This is the common problem that such error paths are only used once 
> every dozen years and therefore get no real testing coverage...


Rusty presented some brilliant tool for this at OLS this year... I bet
that could be used for filesystems as well (Rusty uses it for netfilter
testing)


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

* Re: [2.6 patch] OCFS2: __init / __exit problem
  2006-01-07 21:51       ` Arjan van de Ven
@ 2006-01-08  0:23         ` Randy.Dunlap
  0 siblings, 0 replies; 6+ messages in thread
From: Randy.Dunlap @ 2006-01-08  0:23 UTC (permalink / raw)
  To: Arjan van de Ven; +Cc: bunk, mark.fasheh, kurt.hackel, linux-kernel

On Sat, 07 Jan 2006 22:51:17 +0100 Arjan van de Ven wrote:

> 
> > 
> > This is the common problem that such error paths are only used once 
> > every dozen years and therefore get no real testing coverage...
> 
> 
> Rusty presented some brilliant tool for this at OLS this year... I bet
> that could be used for filesystems as well (Rusty uses it for netfilter
> testing)

this year?

New drivers/filesystems should get treatment such as:

1.  build cleanly, no compile/link warnings
2.  check with sparse, eliminate its warnings
3.  use 'make checkstack buildcheck namespacecheck'
    and fix their problems

similar to what I recently did on the Areca/arcmsr driver
and on libata-acpi additions.

---
~Randy

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

end of thread, other threads:[~2006-01-08  0:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-07 13:20 OCFS2: __init / __exit problem Jan-Benedict Glaw
2006-01-07 19:07 ` [2.6 patch] " Adrian Bunk
2006-01-07 21:38   ` Mark Fasheh
2006-01-07 21:49     ` Adrian Bunk
2006-01-07 21:51       ` Arjan van de Ven
2006-01-08  0:23         ` Randy.Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).