Skip to content

Add max bytes limit and default chunk size#262

Open
steven-mpawulo wants to merge 2 commits intotursodatabase:mainfrom
steven-mpawulo:adding-quotas
Open

Add max bytes limit and default chunk size#262
steven-mpawulo wants to merge 2 commits intotursodatabase:mainfrom
steven-mpawulo:adding-quotas

Conversation

@steven-mpawulo
Copy link
Copy Markdown

Enforce max_bytes quota on writes, throwing ENOSPC if exceeded.
Persist the default chunk_size in fs_config.
Update statfs() to report correct usage.

rail44 added a commit to rail44/agentfs that referenced this pull request Apr 16, 2026
Git creates loose objects with open(O_RDWR|O_CREAT|O_EXCL, 0444),
writes compressed data, then closes the fd. On local filesystems this
works because the open fd retains write access regardless of mode bits.
On NFS v3, which is stateless, the server checks the file's current
mode on each WRITE RPC and rejects it for 0444 files with NFS3ERR_ACCES.

This is a known issue affecting NFS/FUSE servers:
  - nfs-ganesha: tursodatabase#262, #349 (fixed in 2.7.3-9)
  - mergerfs:    #626, #343 (fixed via nfsopenhack)
  - Red Hat:     Bug 1751210

Fix: In nfsproc3_write(), allow the file owner and root to bypass the
mode-bit write check. In POSIX, the owner can always chmod to restore
write permission, so the restriction is not enforceable against the
owner. Non-owner, non-root users remain subject to mode-bit checks.

Add a syscall test (test-write-readonly-new) that reproduces git's
open(O_CREAT, 0444) → write → close pattern.
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