Skip to contentSkip to conversation

OCFS2: __init / __exit problem

PATCH In review Jan-Benedict Glaw 5 participants 6 messages Jan 7, 2006 – Jan 8, 2006 OCFS2

lore
Share & tools
lore
#0 lore raw

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

Signature · 4 lines
Jan-Benedict Glaw       [email protected]    . +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));
#1 lore raw

PATCH 1/1 OCFS2: __init / __exit problem

Quoted 9 lines · Jan-Benedict Glaw

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.

Quoted 1 line

MfG, JBG

cu
Adrian

<-- snip -->

Functions called by __init funtions mustn't be __exit.

Reported by Jan-Benedict Glaw <[email protected]>.

---

 fs/ocfs2/extent_map.c |    2 +-
 fs/ocfs2/uptodate.c   |    2 +-
 fs/ocfs2/uptodate.h   |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
fs/ocfs2/uptodate.h renamed from fs/ocfs2/uptodate.h.old +1 -1
@@ -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);
fs/ocfs2/uptodate.c renamed from fs/ocfs2/uptodate.c.old +1 -1
@@ -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);
fs/ocfs2/extent_map.c renamed from fs/ocfs2/extent_map.c.old +1 -1
@@ -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);
 }
#2 lore raw
Quoted 3 lines · Adrian Bunk

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
[email protected]

#3 lore raw
Quoted 6 lines · Mark Fasheh
Quoted 3 lines · Adrian Bunk

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...

Quoted 1 line
	--Mark

cu
Adrian

Signature · 4 lines
       "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
#4 lore raw
Quoted 4 lines

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)

#5 lore raw
Quoted 9 lines · On Sat, 07 Jan 2006 22:51:17 +0100 Arjan van de Ven wrote:
Quoted 4 lines

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