-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Build fail on linux-next (next-20220629 tag): the name maple_enode
is defined multiple times
#795
Comments
Thanks! (For future reference, this came from Zulip: https://rust-for-linux.zulipchat.com/#narrow/stream/291565-Help/topic/Newbie.20Corner/near/287880755) |
This bug is due to the wrong typedefs in It should be changed from typedef struct maple_enode *maple_enode; /* encoded node */
typedef struct maple_pnode *maple_pnode; /* parent node */ to typedef struct maple_enode *maple_enode_p; /* encoded node */
typedef struct maple_pnode *maple_pnode_p; /* parent node */ After solving this, there is also a bug related to file_operations. The following code should be added to the 537th line of uring_cmd: None, The kernel can successfully boot after solving these two bugs. |
It seems the linux-next git tree is not in the github. Is it proper to send the bugfix patch to the linux-next community by email? |
The C code seems OK (even if potentially confusing) -- the problem is that This seems to be rust-lang/rust-bindgen#2227 (and maybe others since that one is recent and I just did a quick look). I am adding it to the wish list.
linux-next is recreated every day or so merging different trees. Instead, the best would be to email the respective maintainers of the tree, the LKML etc. (but I wouldn't in this case, since I don't think this is a problem on the C side).
This one was reported and fixed a while ago (in Thanks a lot for taking a look! |
However, by fixing the bug of
Thanks for helping!
Glad to participate in :) |
Yeah, I think it can be worth checking with the Maple maintainer, perhaps they agree to rename it for clarity anyway. I also cannot find another example (with a pointer) from a quick grep. |
Another report at https://lore.kernel.org/lkml/20220716124214.329949-1-conor@kernel.org/, from Conor Dooley. |
Sorry for the noise, I expected development/reports on the ml not on a github! |
No worries at all Conor! And yeah, currently most development is happening here, though things will probably change when/if we get merged. The issue tracker is nice to have and probably will remain here, especially since it allows us to easily link and ping things into different Rust projects we use etc. |
The current name of the pointer to struct maple_enode is also maple_enode. This is correct from the grammar point but can be comfusing. Besides it seems in Linux it prefers typedef struct foo *foo_p;, e.g. typedef struct cpumask *cpumask_var_t; and typedef struct cgraph_node *cgraph_node_ptr;. I use re to search in the Linux project and cannot find another example in typedef struct foo *foo; style. This also results in a bug in the bindings of the rust-for-linux subsystem, which can be seen in this github issue. Rust-for-Linux#795 The struct pointer maple_enode and maple_pnode are not used. It is safe to change it to a new name. Signed-off-by: Li Hongyu <lihongyu1999@bupt.edu.cn>
Patch submitted at https://lore.kernel.org/linux-mm/20220717120652.GA9281@38c3a67cb865/ by Li Hongyu. |
The current state of this patch is https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/maple-tree-add-new-data-structure-fix-2.patch. It will appear in the |
The patch is merged into the |
Thanks Richard! Let's wait a bit more until the commit actually hits Linus' tree ( |
Closing this one, since the latest two patch series (v13 and v14) do not have the |
I was trying build the linux-next tree today with Rust support enabled and ran into the following issue:
I've attached my .config for reference.
rust-config.txt
The text was updated successfully, but these errors were encountered: