Skip to contentSkip to conversation

nfs: do not export discarded symbols

PATCH Applied Arnd Bergmann 3 participants 4 messages Mar 11, 2015 – Apr 9, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs: do not export discarded symbols

The function nfs4_pnfs_v3_ds_connect_unload is exported so it can be used by other modules, but is also marked '__exit' and will be discarded when built into the kernel, as pointed out by this linker error:

nfs4_pnfs_v3_ds_connect_unload' referenced in section ___ksymtab_gpl+nfs4_pnfs_v3_ds_connect_unload' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o

This removes the __exit annotation to make it safe to call this function.

Fixes 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")
fs/nfs/pnfs_nfs.c +1 -1
index 54e36b38fb5f..8582dae5ae99 100644
@@ -561,7 +561,7 @@ static bool load_v3_ds_connect(void)
 	return(get_v3_ds_connect != NULL);
 }
 
-void __exit nfs4_pnfs_v3_ds_connect_unload(void)
+void nfs4_pnfs_v3_ds_connect_unload(void)
 {
 	if (get_v3_ds_connect) {
 		symbol_put(nfs3_set_ds_client);
#1 lore raw

Hi Arnd,

Quoted 8 lines · Arnd Bergmann

The function nfs4_pnfs_v3_ds_connect_unload is exported so it can be used by other modules, but is also marked '__exit' and will be discarded when built into the kernel, as pointed out by this linker error:

nfs4_pnfs_v3_ds_connect_unload' referenced in section ___ksymtab_gpl+nfs4_pnfs_v3_ds_connect_unload' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o

This removes the __exit annotation to make it safe to call this function.

Should be "do not discard exported symbols" in subject then?

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw
In reply to Arnd Bergmann
Quoted 18 lines · Arnd Bergmann

The function nfs4_pnfs_v3_ds_connect_unload is exported so it can be used by other modules, but is also marked '__exit' and will be discarded when built into the kernel, as pointed out by this linker error:

nfs4_pnfs_v3_ds_connect_unload' referenced in section ___ksymtab_gpl+nfs4_pnfs_v3_ds_connect_unload' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o

This removes the __exit annotation to make it safe to call this function.

Fixes 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")
fs/nfs/pnfs_nfs.c +0 -0
index 54e36b38fb5f..8582dae5ae99 100644

fs/nfs/pnfs_nfs.c static bool load_v3_ds_connect(void) · line 567

Quoted 8 lines
fs/nfs/pnfs_nfs.c +1 -1
@@ -561,7 +561,7 @@ static bool load_v3_ds_connect(void)
 	return(get_v3_ds_connect != NULL);
 }
 
-void __exit nfs4_pnfs_v3_ds_connect_unload(void)
+void nfs4_pnfs_v3_ds_connect_unload(void)
 {
 	if (get_v3_ds_connect) {
 		symbol_put(nfs3_set_ds_client);

Thanks! Applied...

Signature · 3 lines
Trond Myklebust
Linux NFS client maintainer, PrimaryData
trond.myklebust at primarydata.com
#3 lore raw
Quoted 21 lines · On Thursday 12 March 2015 11:58:38 Trond Myklebust wrote:
Quoted 20 lines · Arnd Bergmann

The function nfs4_pnfs_v3_ds_connect_unload is exported so it can be used by other modules, but is also marked '__exit' and will be discarded when built into the kernel, as pointed out by this linker error:

nfs4_pnfs_v3_ds_connect_unload' referenced in section ___ksymtab_gpl+nfs4_pnfs_v3_ds_connect_unload' of fs/built-in.o: defined in discarded section `.exit.text' of fs/built-in.o

This removes the __exit annotation to make it safe to call this function.

Fixes 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")
fs/nfs/pnfs_nfs.c +0 -0
index 54e36b38fb5f..8582dae5ae99 100644
@@ -561,7 +561,7 @@ static bool load_v3_ds_connect(void)
      return(get_v3_ds_connect != NULL);
 }
 
Quoted 9 lines

fs/nfs/pnfs_nfs.c static bool load_v3_ds_connect(void) · line 567

Quoted 6 lines
fs/nfs/pnfs_nfs.c +1 -1
-void __exit nfs4_pnfs_v3_ds_connect_unload(void)
+void nfs4_pnfs_v3_ds_connect_unload(void)
 {
      if (get_v3_ds_connect) {
              symbol_put(nfs3_set_ds_client);

Thanks! Applied...

I don't see the patch in linux-next, did something go wrong here?

Arnd