lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 6 Nov 2014 12:30:32 +0100
From:	Thierry Reding <thierry.reding@...il.com>
To:	Stephen Rothwell <sfr@...b.auug.org.au>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	linux-next@...r.kernel.org, linux-kernel@...r.kernel.org,
	Vladimir Davydov <vdavydov@...allels.com>
Subject: Re: linux-next: build failure after merge of the akpm tree

On Thu, Nov 06, 2014 at 12:24:00PM +0100, Thierry Reding wrote:
> On Thu, Nov 06, 2014 at 07:36:18PM +1100, Stephen Rothwell wrote:
> > Hi Andrew,
> > 
> > After merging the akpm tree, today's linux-next build (sparc defconfig)
> > failed like this:
> > 
> > mm/slab.c: In function 'slab_alloc':
> > mm/slab.c:3260:4: error: implicit declaration of function 'slab_free' [-Werror=implicit-function-declaration]
> >     slab_free(cachep, objp);
> >     ^
> > mm/slab.c: At top level:
> > mm/slab.c:3534:29: warning: conflicting types for 'slab_free'
> >  static __always_inline void slab_free(struct kmem_cache *cachep, void *objp)
> >                              ^
> > mm/slab.c:3534:29: error: static declaration of 'slab_free' follows non-static declaration
> > mm/slab.c:3260:4: note: previous implicit declaration of 'slab_free' was here
> >     slab_free(cachep, objp);
> >     ^
> > 
> > I am not sure what caused this, but it is something in the akpm-current
> > or akpm trees (possibly interacting with something else).
> 
> I fixed this using the attached patch.
> 
> Thierry

> From a9ec6cfacb892e044a5f76dce3b7fc9a3337d01a Mon Sep 17 00:00:00 2001
> From: Thierry Reding <treding@...dia.com>
> Date: Thu, 6 Nov 2014 11:59:23 +0100
> Subject: [PATCH] mm/slab: Always predeclare slab_free()
> 
> Commit 5da1c3c725ab ("slab: recharge slab pages to the allocating memory
> cgroup") added a predeclaration of the new slab_free() helper so that it
> can be used in slab_alloc_node() and slab_alloc(). However the prototype
> is added in an #ifdef CONFIG_NUMA protected section of code, which works
> fine for slab_alloc_node() but fails for slab_alloc().
> 
> Fixes the following build warnings and errors:
> 
> 	mm/slab.c: In function 'slab_alloc':
> 	mm/slab.c:3260:4: error: implicit declaration of function 'slab_free' [-Werror=implicit-function-declaration]
> 	    slab_free(cachep, objp);
> 	    ^
> 	mm/slab.c: At top level:
> 	mm/slab.c:3534:29: warning: conflicting types for 'slab_free'
> 	 static __always_inline void slab_free(struct kmem_cache *cachep, void *objp)
> 				     ^
> 	mm/slab.c:3534:29: error: static declaration of 'slab_free' follows non-static declaration
> 	mm/slab.c:3260:4: note: previous implicit declaration of 'slab_free' was here
> 	    slab_free(cachep, objp);
> 	    ^
> 
> Reported-by: Stephen Rothwell <sfr@...b.auug.org.au>
> Signed-off-by: Thierry Reding <treding@...dia.com>
> ---
>  mm/slab.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/slab.c b/mm/slab.c
> index 61b01c2ae1d9..00cd028404cb 100644
> --- a/mm/slab.c
> +++ b/mm/slab.c
> @@ -2961,6 +2961,8 @@ out:
>  	return objp;
>  }
>  
> +static __always_inline void slab_free(struct kmem_cache *cachep, void *objp);
> +
>  #ifdef CONFIG_NUMA
>  /*
>   * Try allocating on another node if PFA_SPREAD_SLAB is a mempolicy is set.
> @@ -3133,8 +3135,6 @@ done:
>  	return obj;
>  }
>  
> -static __always_inline void slab_free(struct kmem_cache *cachep, void *objp);
> -
>  static __always_inline void *
>  slab_alloc_node(struct kmem_cache *cachep, gfp_t flags, int nodeid,
>  		   unsigned long caller)

Attached is a follow-up cleanup patch that avoids the need for a pre-
declaration. Feel free to ignore if you prefer the predeclaration.

Thierry

View attachment "0001-mm-slab-Shuffle-code-around-to-avoid-a-predeclaratio.patch" of type "text/x-diff" (6600 bytes)

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ