diff mbox

nfs: do not export discarded symbols

Message ID 3173686.FPJdK9jLbA@wuerfel (mailing list archive)
State New, archived
Headers show

Commit Message

Arnd Bergmann March 11, 2015, 1:37 p.m. UTC
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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")


--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Baruch Siach March 11, 2015, 2:52 p.m. UTC | #1
Hi Arnd,

On Wed, Mar 11, 2015 at 02:37:25PM +0100, Arnd Bergmann wrote:
> 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
Trond Myklebust March 12, 2015, 3:58 p.m. UTC | #2
On Wed, 2015-03-11 at 14:37 +0100, Arnd Bergmann wrote:
> 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.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")
> 
> diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c
> index 54e36b38fb5f..8582dae5ae99 100644
> --- a/fs/nfs/pnfs_nfs.c
> +++ b/fs/nfs/pnfs_nfs.c
> @@ -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...
Arnd Bergmann April 9, 2015, 9:33 a.m. UTC | #3
On Thursday 12 March 2015 11:58:38 Trond Myklebust wrote:
> On Wed, 2015-03-11 at 14:37 +0100, Arnd Bergmann wrote:
> > 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.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Fixes: 5f01d9539496 ("nfs41: create NFSv3 DS connection if specified")
> > 
> > diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c
> > index 54e36b38fb5f..8582dae5ae99 100644
> > --- a/fs/nfs/pnfs_nfs.c
> > +++ b/fs/nfs/pnfs_nfs.c
> > @@ -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...
> 

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

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c
index 54e36b38fb5f..8582dae5ae99 100644
--- a/fs/nfs/pnfs_nfs.c
+++ b/fs/nfs/pnfs_nfs.c
@@ -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);