I have a user who is reporting ENOSPC errors when running gocryptfs on
top of btrfs (ticket: https://github.com/rfjakob/gocryptfs/issues/395 ).
What is interesting is that the error gets thrown at write time. This
is not supposed to happen, because gocryptfs does
fallocate(..., FALLOC_FL_KEEP_SIZE, ...)
before writing.
I wrote a minimal reproducer in C: https://github.com/rfjakob/fallocate_write
This is what it looks like on ext4:
$ ../fallocate_write/fallocate_write
reading from /dev/urandom
writing to ./blob.379Q8P
writing blocks of 132096 bytes each
[...]
fallocate failed: No space left on device
On btrfs, it will instead look like this:
[...]
pwrite failed: No space left on device
Is this a bug in btrfs' fallocate implementation or am I reading the
guarantees that fallocate gives me wrong?
Thanks!
Jakob