On 10-10-2021 07:57, Rick Macklem wrote:

This leads me to a couple of questions:
- Is there a good reason for not using vop_stdallocate() for ZFS?
Yes.  posix_fallocate is supposed to guarantee that subsequent writes
to the file will not fail with ENOSPC.  But ZFS, being a copy-on-write
file system, cannot possibly guarantee that.  See SVN r325320.
However, vop_stdallocate() just does VOP_WRITE()s to the area (with
bytes of data all zeros). Wouldn't that satisfy the criteria?

I had the same problem in Ceph, where a guaranteed writable space is required for keeping a log of modifications to the system. Not having this space might case loss of data.

Writing al zero's is probably even worse on filesystems that have compression set.
Almost nothing is allocated, and so no guarantee at all.
Next trick wass to write random data, but then you run into the problem signaled by
Alan and Warner. New writes will need free space, since the CoW nature.

Solution was to actually create a specific zpool just for this.
But that will not help you with NFS 4.2 I guess

--WjW


Reply via email to