Skip to content

Add --max-storage quota enforcement and statfs()#24

Merged
congwang-mk merged 1 commit intomainfrom
dev
Mar 13, 2026
Merged

Add --max-storage quota enforcement and statfs()#24
congwang-mk merged 1 commit intomainfrom
dev

Conversation

@congwang-mk
Copy link
Contributor

Summary

  • Add --max-storage flag to branchfs mount to limit total delta storage (e.g. --max-storage 2G)
  • Enforce quota at COW copy, write extension, and truncation with ENOSPC
  • Implement statfs() FUSE callback — reports quota-derived values when set, otherwise reports from the underlying storage filesystem
  • Add tests/test_quota.sh with 6 test cases covering write within/exceeding quota, COW quota enforcement, delete reclaiming space, statfs reporting, and unlimited mode

Test plan

  • All 13 existing test suites pass (shell + Rust integration + ioctl)
  • New test_quota.sh passes all 6 tests (10 assertions)
  • cargo build --release clean
  • cargo fmt clean

Signed-off-by: Cong Wang <cwang@multikernel.io>
@congwang-mk congwang-mk merged commit 5898e5f into main Mar 13, 2026
4 checks passed
@congwang-mk congwang-mk mentioned this pull request Mar 13, 2026
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.

1 participant