Stephen Rothwell | 6 Aug 2012 05:43
Picon
Picon

linux-next: build failure after merge of the akpm tree

Hi Andrew,

After merging the akpm tree, today's linux-next build (x86_64
allmodconfig) failed like this:

fs/gfs2/rgrp.c: In function 'gfs2_rs_alloc':
fs/gfs2/rgrp.c:456:2: error: implicit declaration of function 'rb_init_node' [-Werror=implicit-function-declaration]

Caused by commit 5599fe1ab023 ("rbtree: empty nodes have no color") from
the akpm tree interacting with commit cde7c325077b ("GFS2: Add structure
to contain rgrp, bitmap, offset tuple") from the gfs2 tree.

I have applied the following merge fix patch (which is probably not
sufficient).

From: Stephen Rothwell <sfr <at> canb.auug.org.au>
Date: Mon, 6 Aug 2012 13:35:11 +1000
Subject: [PATCH] rbtree/gfs2: remove call to rb_init_node

Signed-off-by: Stephen Rothwell <sfr <at> canb.auug.org.au>
---
 fs/gfs2/rgrp.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index 06476b3..6fb3a57 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
 <at>  <at>  -453,8 +453,6  <at>  <at>  int gfs2_rs_alloc(struct gfs2_inode *ip)
 	if (!res)
(Continue reading)

Michel Lespinasse | 6 Aug 2012 07:01
Picon
Favicon

Re: linux-next: build failure after merge of the akpm tree

On Sun, Aug 5, 2012 at 8:43 PM, Stephen Rothwell <sfr <at> canb.auug.org.au> wrote:
> Caused by commit 5599fe1ab023 ("rbtree: empty nodes have no color") from
> the akpm tree interacting with commit cde7c325077b ("GFS2: Add structure
> to contain rgrp, bitmap, offset tuple") from the gfs2 tree.
>
> I have applied the following merge fix patch (which is probably not
> sufficient).

You are right that this is insufficient - gfs2 is using
RB_EMPTY_NODE() to check for nodes not being inserted on any rbtree,
so it must use RB_CLEAR_NODE() for initialization.

Will attach a patch as a reply to this.

I am surprised how fast these rb_init_node() calls are spreading.
Should I send Linus a patch removing that function so he could include
it in v3.6 and avoid having to deal with all these new uses ?

--

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.
Michel Lespinasse | 6 Aug 2012 07:04
Picon
Favicon

Re: linux-next: build failure after merge of the akpm tree

gfs2 calls RB_EMPTY_NODE() to check if nodes are not on an rbtree.
The corresponding initialization function is RB_CLEAR_NODE().
rb_init_node() was never clearly defined and is going away.

Signed-off-by: Michel Lespinasse <walken <at> google.com>
---
 fs/gfs2/rgrp.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
index eaa4188..675e7cc 100644
--- a/fs/gfs2/rgrp.c
+++ b/fs/gfs2/rgrp.c
 <at>  <at>  -487,7 +487,7  <at>  <at>  int gfs2_rs_alloc(struct gfs2_inode *ip)
 	if (!res)
 		error = -ENOMEM;

-	rb_init_node(&res->rs_node);
+	RB_CLEAR_NODE(&res->rs_node);

 	down_write(&ip->i_rw_mutex);
 	if (ip->i_res)
 <at>  <at>  -520,7 +520,7  <at>  <at>  static void __rs_deltree(struct gfs2_inode *ip, struct gfs2_blkreserv *rs)
 	rgd = rs->rs_rbm.rgd;
 	trace_gfs2_rs(ip, rs, TRACE_RS_TREEDEL);
 	rb_erase(&rs->rs_node, &rgd->rd_rstree);
-	rb_init_node(&rs->rs_node);
+	RB_CLEAR_NODE(&rs->rs_node);
 	BUG_ON(!rgd->rd_rs_cnt);
 	rgd->rd_rs_cnt--;
(Continue reading)

Steven Whitehouse | 6 Aug 2012 11:46
Picon
Favicon

Re: linux-next: build failure after merge of the akpm tree

Hi,

Thanks for the patch - I'd not realised that I'd used the wrong function
there... it is fixed now in the GFS2 -nmw tree,

Steve.

On Sun, 2012-08-05 at 22:04 -0700, Michel Lespinasse wrote:
> gfs2 calls RB_EMPTY_NODE() to check if nodes are not on an rbtree.
> The corresponding initialization function is RB_CLEAR_NODE().
> rb_init_node() was never clearly defined and is going away.
> 
> Signed-off-by: Michel Lespinasse <walken <at> google.com>
> ---
>  fs/gfs2/rgrp.c |    5 ++---
>  1 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c
> index eaa4188..675e7cc 100644
> --- a/fs/gfs2/rgrp.c
> +++ b/fs/gfs2/rgrp.c
>  <at>  <at>  -487,7 +487,7  <at>  <at>  int gfs2_rs_alloc(struct gfs2_inode *ip)
>  	if (!res)
>  		error = -ENOMEM;
>  
> -	rb_init_node(&res->rs_node);
> +	RB_CLEAR_NODE(&res->rs_node);
>  
>  	down_write(&ip->i_rw_mutex);
>  	if (ip->i_res)
(Continue reading)


Gmane