Re: [RFC] xfs: fake fallocate success for always CoW inodes

From: hch
Date: Tue Nov 11 2025 - 04:12:00 EST


On Tue, Nov 11, 2025 at 08:31:30AM +0000, Hans Holmberg wrote:
> In stead of returning success in fallocate(2), could we in stead return
> an distinct error code that would tell the caller that:
>
> The optimized allocation not supported, AND there is no use trying to
> preallocate data using writes?
>
> EUSELESS would be nice to have, but that is not available.
>
> Then posix_fallocate could fail with -EINVAL (which looks legit according
> to the man page "the underlying filesystem does not support the operation")
> or skip the writes and return success (whatever is preferable)

The problem is that both the existing direct callers of fallocate(2)
including all currently released glibc versions do not expect that
return value.