Re: [f2fs-dev] [PATCH] generic/064: allow 50 extents on F2FS after fcollapse

Chao Yu <[email protected]> Wed, 22 Jul 2026 09:12:48 +0800
Newsgroups org.kernel.vger.fstests,net.sourceforge.lists.linux-f2fs-devel
Message-ID <[email protected]>
Hi Christoph,

On 7/20/26 16:04, Christoph Hellwig wrote:
> So looking at this explanation and the code, f2fs does not actually
> support COLLAPSE_RANGE at all, but emulates by doing a full data

For non-checkpoint data, we can just update metadata w/o any data copying
to support COLLAPSE_RANGE.

> copy.  What is the point of this and lying to the user that it supports
> and operation that isn't actually supported as the intended metadata
> only swizzle?

I added the fcollapse support long time ago in commit b4ace3370324
("f2fs: support FALLOC_FL_COLLAPSE_RANGE"), and then, a following patch
was committed to fix checkpoint case by copying data.

IIRC, the intention at that time is trying to support modern filesystem
features as many as possible, so while commercializing f2fs filesystem,
it won't break userspace application use if previous filesystem support
the feature.

I just followed manual of fallocate 2 to implement the fcollapse, I didn't
notice fcollapse is a metadata operation only interface, but I may missed
something in manual or discussion conclusion about fcollapse in community,
please let me know if I missed something. :)

Thanks,