Re: Sparse file support in FreeBSD NFSv4.2 server
Date: Tue, 13 May 2025 08:52:36 UTC
On Tue, 13 May 2025, at 6:35 PM, Aurélien Couderc wrote: > On Tue, May 13, 2025 at 8:51 AM Rob Norris <robn@despairlabs.com> wrote: > > Without having looked at it, I can see a way to do it by creating some object-specific operation to "write" but have it accounted to a dataset's ""reservation", rather than "used". Easy to say, difficult to do. I suspect the hardest part is figuring out the best way to keep a set of reserved ranges on each object. > > What about just writing 0x00 bytes in case of F_ALLOCSP? By default, with block compression enabled, OpenZFS will detect all-zero blocks and write a hole instead, which doesn't use any space. But even if it did, that can't guarantee enough space to be able to overwrite it, because the previous data may exist in snapshots or clones. There's also metadata and indirect blocks and other stuff that we need space for too. Reservations already have all the stuff needed to track the extra commitment, which is why I think if it were possible, that's the way to do it. Rob.