Skip to content

feat(fuse): Statfs#11261

Merged
lidel merged 5 commits intoipfs:masterfrom
wjmelements:statfs
Apr 10, 2026
Merged

feat(fuse): Statfs#11261
lidel merged 5 commits intoipfs:masterfrom
wjmelements:statfs

Conversation

@wjmelements
Copy link
Copy Markdown
Contributor

Reviewer @lidel
On macOS, Finder uses statfs(2) to check if there is enough space for a file before copying.
Without this, writing can fail with error ('there isn't enough free space').
I have only seen this issue with Finder but it's possible that statfs(2) is used by other fs browsers, so it is good to implement it.

Changes

  • implement Statfs, returning underlying FS info

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wjmelements wjmelements requested a review from a team as a code owner March 29, 2026 23:43
@gammazero
Copy link
Copy Markdown
Contributor

Looks like CI failures due to missing int64/uint64 conversions.

@wjmelements
Copy link
Copy Markdown
Contributor Author

Looks like CI failures due to missing int64/uint64 conversions.

I am surprised these have different types on macos vs linux.

@wjmelements
Copy link
Copy Markdown
Contributor Author

test failures look unrelated

wjmelements and others added 2 commits April 2, 2026 21:06
Report the free space of the volume backing the IPFS repo so that
tools like macOS Finder see real numbers instead of zeros.

- add Statfs to writable.Dir (serves /mfs and /ipns child dirs),
  readonly.Root (/ipfs), and ipns.Root (/ipns)
- thread RepoPath from the repo through Config / CreateRoot
- unit test for Dir.Statfs and empty-path guard
- FUSE integration tests on all three mounts comparing
  mount-point stats against the repo directory
@lidel lidel changed the title feat(mfs): Statfs feat(fuse): Statfs Apr 10, 2026
Copy link
Copy Markdown
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thanks @wjmelements for flagging this!

The original PR was written against bazil.org/fuse which has since been replaced by hanwen/go-fuse in #11272, so
the code no longer applied. I've rebased, resolved conflicts, and reimplemented statfs on top of the new FUSE stack:

  • writable.Dir (serves /mfs and /ipns child dirs), readonly.Root (/ipfs), and ipns.Root (/ipns) all implement NodeStatfser now
  • RepoPath is threaded from the repo through to each mount so syscall.Statfs has a real target
  • Unit and FUSE integration tests on all three mounts verify the returned stats match the repo's backing volume

@lidel lidel merged commit b1e70f8 into ipfs:master Apr 10, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants