Fix #907 #917
No reviewers
Labels
No labels
action
check-aws
action
discussion-needed
action
for-external-contributors
action
for-newcomers
action
more-info-needed
action
need-funding
action
triage-required
kind
correctness
kind
ideas
kind
improvement
kind
performance
kind
testing
kind
usability
kind
wrong-behavior
prio
critical
prio
low
scope
admin-api
scope
background-healing
scope
build
scope
documentation
scope
k8s
scope
layout
scope
metadata
scope
ops
scope
rpc
scope
s3-api
scope
security
scope
telemetry
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#917
Loading…
Reference in a new issue
No description provided.
Delete branch "vk/garage:fix_907"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A naive fix for #907. Successfully tested on FreeBSD.
Would you guys mind taking a look and fixing the formatting, I have no clue what I'm doing wrong?
Did you try running
cargo fmt
from the root of the project? This should reformat the code as appropriate.With this implementation, on FreeBSD we will now make two calls, one to statfs and one to statvfs. I think we can avoid this and also make the code simpler, by just making the current mount_avail function conditionnal to
#[cfg(not(target_os="freebsd"))]
, and rewrite a freebsd-specific version that uses statfs instead of statvfs. This would avoid adding lines 850-860 and we can keep 843-848 as is on all platforms.Indeed, but that's intentional.
statfs
is deprecated on most platforms, bystatvfs
, which is furthermore part of the POSIX standard. Hence,statfs
is being used barely as a workaround thefilesystem_id
issue. Moreover, IIRC (I'll check further), manipulatingstatfs
results requires knowledge of the underlying filesystem (whether it'sufs
,zfs
, ...) in order to exploit the returned data, which is whatstatvfs
does.Ok, that's fine then!
If you give me write access to your forked repo I can run the correct cargo fmt command for you
It seems I was partly wrong,
statvfs
seems to barely copy thestatfs
results (it acts as a dumb wrapper).Yet, I'd still stick to using
statfvs
for its intended purpose, but I may refactor this as you decide.I'll do, but I'll still try doing it by myself. I'm a total noob in rust and tooling but I believe I can do that :)
Ok,
cargo fmt
does reformat my patch but also other files I haven't touched, I'll push mine only, that okay?LGTM, thanks for your contribution :)