Re: [RFC] xfs: fake fallocate success for always CoW inodes
From: Florian Weimer
Date: Mon Nov 10 2025 - 05:04:20 EST
* Christoph Hellwig:
> On Mon, Nov 10, 2025 at 06:27:41AM +0100, Florian Weimer wrote:
>> Sorry, I made the example confusing.
>>
>> How would the application deal with failure due to lack of fallocate
>> support? It would have to do a pwrite, like posix_fallocate does to
>> today, or maybe ftruncate. This is way I think removing the fallback
>> from posix_fallocate completely is mostly pointless.
>
> In general it would ftruncate. If it thinks it can't work without
> preallocation at all the application will fail, as again the lack
> of posix_fallocate means that space can't be preallocated.
Hmm. It's not a 1:1 replacement: someone really needs to understand the
code and see what the appropriate way to deal with the situation is. Of
course the posix_fallocate fallback path (or an application-level
equivalent) has the potential for data loss, too. It's just a different
trade-off.
Thanks,
Florian