Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linux-like: add OPEN_TREE_CLONE and OPEN_TREE_CLOEXEC #3048

Merged
merged 1 commit into from
Jan 9, 2023

Conversation

lucab
Copy link
Contributor

@lucab lucab commented Dec 23, 2022

This adds the OPEN_TREE_CLONE and OPEN_TREE_CLOEXEC constants on Linux and Android.
Those are used by the open_tree() syscall and defined in mount.h:

@rustbot
Copy link
Collaborator

rustbot commented Dec 23, 2022

r? @JohnTitor

(rustbot has picked a reviewer for you, use r? to override)

@@ -616,6 +616,8 @@ pub const MS_LAZYTIME: ::c_ulong = 0x2000000;
pub const MS_ACTIVE: ::c_ulong = 0x40000000;
pub const MS_MGC_VAL: ::c_ulong = 0xc0ed0000;
pub const MS_MGC_MSK: ::c_ulong = 0xffff0000;
pub const OPEN_TREE_CLONE: ::c_uint = 0x01;
pub const OPEN_TREE_CLOEXEC: ::c_uint = O_CLOEXEC as ::c_uint;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewers: these constants are typed as uint because they are used in the corresponding open_tree() syscall, which is defined with an unsigned flags argument:

SYSCALL_DEFINE3(open_tree, int, dfd, const char __user *, filename, unsigned, flags)

@lucab lucab force-pushed the ups/linux-open-tree-flags branch 2 times, most recently from 23bdd08 to c578f2f Compare January 6, 2023 09:54
@JohnTitor
Copy link
Member

Thanks! @bors r+

@bors
Copy link
Contributor

bors commented Jan 6, 2023

📌 Commit c578f2f has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 6, 2023

⌛ Testing commit c578f2f with merge 472875e...

bors added a commit that referenced this pull request Jan 6, 2023
linux-like: add OPEN_TREE_CLONE and OPEN_TREE_CLOEXEC

This adds the `OPEN_TREE_CLONE` and `OPEN_TREE_CLOEXEC` constants on Linux and Android.
Those are used by the `open_tree()` syscall and defined in `mount.h`:
 * https://github.com/torvalds/linux/blob/v6.1/include/uapi/linux/mount.h#L61-L65
@bors
Copy link
Contributor

bors commented Jan 6, 2023

💔 Test failed - checks-actions

@lucab
Copy link
Contributor Author

lucab commented Jan 6, 2023

Amended to add missing linux/mount.h includes in libc-test logic.

@JohnTitor
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Jan 7, 2023

📌 Commit 2fd7e81 has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 7, 2023

⌛ Testing commit 2fd7e81 with merge d4a917e...

bors added a commit that referenced this pull request Jan 7, 2023
linux-like: add OPEN_TREE_CLONE and OPEN_TREE_CLOEXEC

This adds the `OPEN_TREE_CLONE` and `OPEN_TREE_CLOEXEC` constants on Linux and Android.
Those are used by the `open_tree()` syscall and defined in `mount.h`:
 * https://github.com/torvalds/linux/blob/v6.1/include/uapi/linux/mount.h#L61-L65
@bors
Copy link
Contributor

bors commented Jan 7, 2023

💔 Test failed - checks-actions

@lucab
Copy link
Contributor Author

lucab commented Jan 8, 2023

CI failure:

/checkout/target/i686-unknown-linux-musl/debug/build/libc-test-edac14eb712d5cd2/out/main.c:120:10: fatal error: linux/mount.h: No such file or directory
120 | #include <linux/mount.h>
    |          ^~~~~~~~~~~~~~~

I'm a bit out of clues about why it cannot find linux/mount.h specifically, while all the other linux/*.h kernel headers seem fine. Is there some weird setup for kernel headers in CI? How can I trigger bors tests myself to dig into this?

@JohnTitor
Copy link
Member

Hmm, our kernel version on musl is indeed quite old, IIUC but mount.h is more senior than it and I'm not sure why that happens.
You can find our CI structure here: https://github.com/rust-lang/libc/tree/master/ci
You're also now able to use @bors try, feel free to test on bors!
@bors delegate+

@JohnTitor
Copy link
Member

@bors delegate+

@bors
Copy link
Contributor

bors commented Jan 8, 2023

✌️ @lucab can now approve this pull request

@lucab
Copy link
Contributor Author

lucab commented Jan 9, 2023

@bors try

This adds the `OPEN_TREE_CLONE` and `OPEN_TREE_CLOEXEC` constants
on Linux and Android.
Those are used by the `open_tree()` syscall and defined in `mount.h`:
 * https://github.com/torvalds/linux/blob/v6.1/include/uapi/linux/mount.h#L61-L65
@lucab
Copy link
Contributor Author

lucab commented Jan 9, 2023

@bors try

@bors
Copy link
Contributor

bors commented Jan 9, 2023

⌛ Trying commit 82ded69 with merge 87ed483...

bors added a commit that referenced this pull request Jan 9, 2023
linux-like: add OPEN_TREE_CLONE and OPEN_TREE_CLOEXEC

This adds the `OPEN_TREE_CLONE` and `OPEN_TREE_CLOEXEC` constants on Linux and Android.
Those are used by the `open_tree()` syscall and defined in `mount.h`:
 * https://github.com/torvalds/linux/blob/v6.1/include/uapi/linux/mount.h#L61-L65
@bors
Copy link
Contributor

bors commented Jan 9, 2023

☀️ Try build successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14
Build commit: 87ed483 (87ed48351296c2d24fe8c5ee3d36d5d9dd3e9bd8)

@lucab
Copy link
Contributor Author

lucab commented Jan 9, 2023

Ok, so the problem with musl tests is that the headers snapshot at https://github.com/sabotage-linux/kernel-headers is from version 4.19.88. There has been a rework/split of kernel headers after that, but anyway the OPEN_TREE_* constants are more recent than that version.

I've reworked the tests to take that into account, and bors CI is green now.
This PR should be ready for stamping and merging now.

@JohnTitor
Copy link
Member

Thank you! @bors r+

@bors
Copy link
Contributor

bors commented Jan 9, 2023

📌 Commit 82ded69 has been approved by JohnTitor

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 9, 2023

⌛ Testing commit 82ded69 with merge 68ad935...

@bors
Copy link
Contributor

bors commented Jan 9, 2023

☀️ Test successful - checks-actions, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13, checks-cirrus-freebsd-14
Approved by: JohnTitor
Pushing 68ad935 to master...

@bors bors merged commit 68ad935 into rust-lang:master Jan 9, 2023
@lucab lucab deleted the ups/linux-open-tree-flags branch January 9, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants