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

Fix statfs for DragonFlyBSD #2364

Merged
merged 1 commit into from
Aug 25, 2021
Merged

Conversation

rtzoeller
Copy link
Contributor

The statfs struct was missing several padding areas and used incorrect array lengths, causing all values to be incorrect.

DragonFlyBSD's own documentation seems to be wrong here, which is likely how this ended up being incorrect in the first place.

Source: https://github.com/DragonFlyBSD/DragonFlyBSD/blob/27ea30e396c40d8feb44d76002b79153e96ecf8f/sys/sys/mount.h#L95
Documentation: https://man.dragonflybsd.org/?command=statfs&section=2

struct was missing several padded areas, causing all values to be wrong.
@rust-highfive
Copy link

r? @Amanieu

(rust-highfive has picked a reviewer for you, use r? to override)

pub f_syncwrites: ::c_long,
pub f_asyncwrites: ::c_long,
pub f_fstypename: [::c_char; 16],
pub f_mntonname: [::c_char; 90],
pub f_mntonname: [::c_char; 80],
Copy link
Member

Choose a reason for hiding this comment

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

Do we have constants that we could use here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The C source defines MFSNAMELEN and MNAMELEN, but I don't see any equivalents in rust's libc. I can add these as constants if you'd prefer.

Copy link
Member

Choose a reason for hiding this comment

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

You're right, none of the other targets use a constant. I guess it's fine as it is.

@Amanieu
Copy link
Member

Amanieu commented Aug 25, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Aug 25, 2021

📌 Commit f09c62c has been approved by Amanieu

@bors
Copy link
Contributor

bors commented Aug 25, 2021

⌛ Testing commit f09c62c with merge d16dfc4...

@bors
Copy link
Contributor

bors commented Aug 25, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: Amanieu
Pushing d16dfc4 to master...

@bors bors merged commit d16dfc4 into rust-lang:master Aug 25, 2021
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.

4 participants