Skip to contentSkip to conversation

linux-next: build failure after merge of the mm-nonmm-unstable tree

DISCUSSION Stephen Rothwell 4 participants 5 messages Nov 16, 2025 – Nov 20, 2025

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

Hi all,

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

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:209:42

    |
209 |                 next: unsafe { bindings::rb_first(&self.root) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:224:42

    |
224 |                 next: unsafe { bindings::rb_first(from_mut(&mut self.root)) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:249:42

    |
249 |         let current = unsafe { bindings::rb_first(root) };
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_last in crate bindings

     --> rust/kernel/rbtree.rs:264:42
      |
264   |         let current = unsafe { bindings::rb_last(root) };
      |                                          ^^^^^^^ help: a function with a similar name exists: `sg_last`
      |
     ::: rust/bindings/bindings_generated.rs:90155:5
      |
90155 |     pub fn sg_last(s: *mut scatterlist, arg1: ffi::c_uint) -> *mut scatterlist;
      |     --------------------------------------------------------------------------- similarly named function `sg_last` defined here

error: aborting due to 4 previous errors

For more information about this error, try rustc --explain E0425.

Caused by commit

84aa8c5fc414 ("rbtree: inline rb_first()")

I have reverted that commit and the following one for today.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

Hi all,

Quoted 35 lines · On Mon, 17 Nov 2025 10:23:10 +1100 Stephen Rothwell <[email protected]>…

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

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:209:42

    |
209 |                 next: unsafe { bindings::rb_first(&self.root) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:224:42

    |
224 |                 next: unsafe { bindings::rb_first(from_mut(&mut self.root)) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:249:42

    |
249 |         let current = unsafe { bindings::rb_first(root) };
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_last in crate bindings

     --> rust/kernel/rbtree.rs:264:42  
      |
264   |         let current = unsafe { bindings::rb_last(root) };
      |                                          ^^^^^^^ help: a function with a similar name exists: `sg_last`
      |
     ::: rust/bindings/bindings_generated.rs:90155:5
      |
90155 |     pub fn sg_last(s: *mut scatterlist, arg1: ffi::c_uint) -> *mut scatterlist;
      |     --------------------------------------------------------------------------- similarly named function `sg_last` defined here

error: aborting due to 4 previous errors

Quoted 7 lines

For more information about this error, try rustc --explain E0425.

Caused by commit

84aa8c5fc414 ("rbtree: inline rb_first()")

I have reverted that commit and the following one for today.

I am still reverting those commits.

Signature · 2 lines
Cheers,
Stephen Rothwell
maintainer
#2 lore raw
Quoted 40 lines · On Thu, 20 Nov 2025 10:14:40 +1100 Stephen Rothwell <[email protected]>…

Hi all,

Quoted 37 lines · On Mon, 17 Nov 2025 10:23:10 +1100 Stephen Rothwell <[email protected]>…

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

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:209:42

    |
209 |                 next: unsafe { bindings::rb_first(&self.root) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:224:42

    |
224 |                 next: unsafe { bindings::rb_first(from_mut(&mut self.root)) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:249:42

    |
249 |         let current = unsafe { bindings::rb_first(root) };
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_last in crate bindings

     --> rust/kernel/rbtree.rs:264:42  
      |
264   |         let current = unsafe { bindings::rb_last(root) };
      |                                          ^^^^^^^ help: a function with a similar name exists: `sg_last`
      |
     ::: rust/bindings/bindings_generated.rs:90155:5
      |
90155 |     pub fn sg_last(s: *mut scatterlist, arg1: ffi::c_uint) -> *mut scatterlist;
      |     --------------------------------------------------------------------------- similarly named function `sg_last` defined here

error: aborting due to 4 previous errors

For more information about this error, try rustc --explain E0425.

Quoted 7 lines
Quoted 5 lines

Caused by commit

84aa8c5fc414 ("rbtree: inline rb_first()")

I have reverted that commit and the following one for today.

I am still reverting those commits.

Thanks, I'll disable them for now.

Alice, can you please help us with a fix? Simple patch follows:

include/linux/rbtree.h renamed from include/linux/rbtree.h~rbtree-inline-rb_first +15 -1
@@ -43,7 +43,21 @@ extern void rb_erase(struct rb_node *, s
 /* Find logical next and previous nodes in a tree */
 extern struct rb_node *rb_next(const struct rb_node *);
 extern struct rb_node *rb_prev(const struct rb_node *);
-extern struct rb_node *rb_first(const struct rb_root *);
+
+/*
+ * This function returns the first node (in sort order) of the tree.
+ */
+static inline struct rb_node *rb_first(const struct rb_root *root)
+{
+	struct rb_node	*n;
+
+	n = root->rb_node;
+	if (!n)
+		return NULL;
+	while (n->rb_left)
+		n = n->rb_left;
+	return n;
+}
 extern struct rb_node *rb_last(const struct rb_root *);
 
 /* Postorder iteration - always visit the parent after its children */
lib/rbtree.c renamed from lib/rbtree.c~rbtree-inline-rb_first +0 -16
@@ -460,22 +460,6 @@ void __rb_insert_augmented(struct rb_nod
 }
 EXPORT_SYMBOL(__rb_insert_augmented);
 
-/*
- * This function returns the first node (in sort order) of the tree.
- */
-struct rb_node *rb_first(const struct rb_root *root)
-{
-	struct rb_node	*n;
-
-	n = root->rb_node;
-	if (!n)
-		return NULL;
-	while (n->rb_left)
-		n = n->rb_left;
-	return n;
-}
-EXPORT_SYMBOL(rb_first);
-
 struct rb_node *rb_last(const struct rb_root *root)
 {
 	struct rb_node	*n;

_

maintainer
#3 lore raw
Quoted 4 lines · On Wed, 19 Nov 2025 15:48:24 -0800 Andrew Morton <[email protected]>…

Thanks, I'll disable them for now.

Alice, can you please help us with a fix? Simple patch follows:

Something like this should work (I would suggest adding each helper into the right commit that performs each move to the header):

rust/helpers/rbtree.c +10 -0
index 6d404b84a9b5..2a0eabbb4160 100644
@@ -7,3 +7,13 @@ void rust_helper_rb_link_node(struct rb_node *node, struct rb_node *parent,
 {
        rb_link_node(node, parent, rb_link);
 }
+
+struct rb_node *rust_helper_rb_first(const struct rb_root *root)
+{
+       return rb_first(root);
+}
+
+struct rb_node *rust_helper_rb_last(const struct rb_root *root)
+{
+       return rb_last(root);
+}

Cheers,
Miguel

reviewer
#4 lore raw
In reply to Andrew Morton
Quoted 46 lines · Andrew Morton
Quoted 44 lines · On Thu, 20 Nov 2025 10:14:40 +1100 Stephen Rothwell <[email protected]>…

Hi all,

Quoted 41 lines · On Mon, 17 Nov 2025 10:23:10 +1100 Stephen Rothwell <[email protected]>…

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

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:209:42

    |
209 |                 next: unsafe { bindings::rb_first(&self.root) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:224:42

    |
224 |                 next: unsafe { bindings::rb_first(from_mut(&mut self.root)) },
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_first in crate bindings
--> rust/kernel/rbtree.rs:249:42

    |
249 |         let current = unsafe { bindings::rb_first(root) };
    |                                          ^^^^^^^^ not found in `bindings`

error[E0425]: cannot find function rb_last in crate bindings

     --> rust/kernel/rbtree.rs:264:42  
      |
264   |         let current = unsafe { bindings::rb_last(root) };
      |                                          ^^^^^^^ help: a function with a similar name exists: `sg_last`
      |
     ::: rust/bindings/bindings_generated.rs:90155:5
      |
90155 |     pub fn sg_last(s: *mut scatterlist, arg1: ffi::c_uint) -> *mut scatterlist;
      |     --------------------------------------------------------------------------- similarly named function `sg_last` defined here

error: aborting due to 4 previous errors

For more information about this error, try rustc --explain E0425.

Caused by commit

84aa8c5fc414 ("rbtree: inline rb_first()")

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I have reverted that commit and the following one for today.

I am still reverting those commits.

Thanks, I'll disable them for now.

Alice, can you please help us with a fix? Simple patch follows:

The diff Miguel shared should fix this issue. Let me know if you need a real patch.

Alice