FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] generic/064: allow 50 extents on F2FS after fcollapse
@ 2026-06-22  7:04 Jan Prusakowski
  2026-06-23  8:46 ` [f2fs-dev] " Chao Yu
  2026-06-24  7:46 ` Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Prusakowski @ 2026-06-22  7:04 UTC (permalink / raw)
  To: fstests; +Cc: zlang, jaegeuk, linux-f2fs-devel, Jan Prusakowski

On F2FS, generic/064 fails with "extents mismatched before = 1 after =
50" following multiple fcollapse (collapse range) operations.

To ensure crash consistency and checkpoint integrity, F2FS forbids
in-place SSR (Summary Standalone Replacement) overwrites on valid
checkpointed blocks. When collapse range shifts blocks, F2FS allocates
new data pages in LFS mode (out-of-place log writes). As a result,
sequential collapse range calls rewrite shifted blocks at new log
locations, intentionally leaving the file with 50 extents.

Adjust the extent verification in generic/064 to expect exactly 50
extents on F2FS, while preserving the strict 1-extent requirement for
all other filesystems. Data integrity continues to be verified via byte
comparison.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
---
 tests/generic/064 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/generic/064 b/tests/generic/064
index aed13970..b77eccb4 100755
--- a/tests/generic/064
+++ b/tests/generic/064
@@ -59,7 +59,13 @@ for (( j=0; j < $(($BLOCKS/2)); j++ )); do
 done
 
 extent_after=`_count_extents $dest`
-if [ $extent_before -ne $extent_after ]; then
+
+if [ "$FSTYP" == "f2fs" ];
+then
+	if [ $extent_before -ne 1 ] || [ $extent_after -ne 50 ]; then
+		echo "extents mismatched before = $extent_before after = $extent_after"
+	fi
+elif [ $extent_before -ne $extent_after ]; then
 	echo "extents mismatched before = $extent_before after = $extent_after"
 fi
 
-- 
2.55.0.rc0.786.g65d90a0328-goog


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] [PATCH] generic/064: allow 50 extents on F2FS after fcollapse
  2026-06-22  7:04 [PATCH] generic/064: allow 50 extents on F2FS after fcollapse Jan Prusakowski
@ 2026-06-23  8:46 ` Chao Yu
  2026-06-24  7:46 ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Chao Yu @ 2026-06-23  8:46 UTC (permalink / raw)
  To: Jan Prusakowski, fstests; +Cc: chao, jaegeuk, zlang, linux-f2fs-devel

On 6/22/26 15:04, Jan Prusakowski via Linux-f2fs-devel wrote:
> On F2FS, generic/064 fails with "extents mismatched before = 1 after =
> 50" following multiple fcollapse (collapse range) operations.
> 
> To ensure crash consistency and checkpoint integrity, F2FS forbids
> in-place SSR (Summary Standalone Replacement) overwrites on valid
> checkpointed blocks. When collapse range shifts blocks, F2FS allocates
> new data pages in LFS mode (out-of-place log writes). As a result,
> sequential collapse range calls rewrite shifted blocks at new log
> locations, intentionally leaving the file with 50 extents.
> 
> Adjust the extent verification in generic/064 to expect exactly 50
> extents on F2FS, while preserving the strict 1-extent requirement for
> all other filesystems. Data integrity continues to be verified via byte
> comparison.
> 
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> Signed-off-by: Jan Prusakowski <jprusakowski@google.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] generic/064: allow 50 extents on F2FS after fcollapse
  2026-06-22  7:04 [PATCH] generic/064: allow 50 extents on F2FS after fcollapse Jan Prusakowski
  2026-06-23  8:46 ` [f2fs-dev] " Chao Yu
@ 2026-06-24  7:46 ` Christoph Hellwig
  2026-06-29 16:37   ` Zorro Lang
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2026-06-24  7:46 UTC (permalink / raw)
  To: Jan Prusakowski; +Cc: fstests, zlang, jaegeuk, linux-f2fs-devel

On Mon, Jun 22, 2026 at 07:04:38AM +0000, Jan Prusakowski wrote:
> On F2FS, generic/064 fails with "extents mismatched before = 1 after =
> 50" following multiple fcollapse (collapse range) operations.
> 
> To ensure crash consistency and checkpoint integrity, F2FS forbids
> in-place SSR (Summary Standalone Replacement) overwrites on valid
> checkpointed blocks. When collapse range shifts blocks, F2FS allocates
> new data pages in LFS mode (out-of-place log writes). As a result,
> sequential collapse range calls rewrite shifted blocks at new log
> locations, intentionally leaving the file with 50 extents.

This sounds odd.  The test allocates a contigous range and then just does
insert/collapse on it, which should not lead to any new data block
allocations.  Given that the test works fine on zoned XFS and btrfs
with strict out of place write policies we know it does not require
overwriting blocks to work as well.

So I think something is fishy in f2fs if needs to allocate data blocks
here.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] generic/064: allow 50 extents on F2FS after fcollapse
  2026-06-24  7:46 ` Christoph Hellwig
@ 2026-06-29 16:37   ` Zorro Lang
  2026-06-30 12:09     ` [f2fs-dev] " Chao Yu
  0 siblings, 1 reply; 5+ messages in thread
From: Zorro Lang @ 2026-06-29 16:37 UTC (permalink / raw)
  To: Jan Prusakowski; +Cc: Christoph Hellwig, fstests, jaegeuk, linux-f2fs-devel

On Wed, Jun 24, 2026 at 12:46:01AM -0700, Christoph Hellwig wrote:
> On Mon, Jun 22, 2026 at 07:04:38AM +0000, Jan Prusakowski wrote:
> > On F2FS, generic/064 fails with "extents mismatched before = 1 after =
> > 50" following multiple fcollapse (collapse range) operations.
> > 
> > To ensure crash consistency and checkpoint integrity, F2FS forbids
> > in-place SSR (Summary Standalone Replacement) overwrites on valid
> > checkpointed blocks. When collapse range shifts blocks, F2FS allocates
> > new data pages in LFS mode (out-of-place log writes). As a result,
> > sequential collapse range calls rewrite shifted blocks at new log
> > locations, intentionally leaving the file with 50 extents.
> 
> This sounds odd.  The test allocates a contigous range and then just does
> insert/collapse on it, which should not lead to any new data block
> allocations.  Given that the test works fine on zoned XFS and btrfs
> with strict out of place write policies we know it does not require
> overwriting blocks to work as well.
> 
> So I think something is fishy in f2fs if needs to allocate data blocks
> here.

I have the same question with Christoph. Shouldn't fcollapse in F2FS just
remap the metadata instead of allocating new data blocks?

> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [f2fs-dev] [PATCH] generic/064: allow 50 extents on F2FS after fcollapse
  2026-06-29 16:37   ` Zorro Lang
@ 2026-06-30 12:09     ` Chao Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2026-06-30 12:09 UTC (permalink / raw)
  To: Christoph Hellwig, Zorro Lang, Jan Prusakowski
  Cc: chao, linux-f2fs-devel, fstests, jaegeuk

On 6/30/26 00:37, Zorro Lang via Linux-f2fs-devel wrote:
> On Wed, Jun 24, 2026 at 12:46:01AM -0700, Christoph Hellwig wrote:
>> This sounds odd.  The test allocates a contigous range and then just does
>> insert/collapse on it, which should not lead to any new data block
>> allocations.  Given that the test works fine on zoned XFS and btrfs
>> with strict out of place write policies we know it does not require
>> overwriting blocks to work as well.
>>
>> So I think something is fishy in f2fs if needs to allocate data blocks
>> here.
> 
> I have the same question with Christoph. Shouldn't fcollapse in F2FS just
> remap the metadata instead of allocating new data blocks?

Hi Christoph, Zorro,

Let me explain it briefly, this is because f2fs has only one copy of reverse
mapping table (aka SSA), for any checkpointed data, we can not modify SSA info
directly during remap, otherwise, after sudden power-cut, we will suffer
inconsistent issue in between reverse mapping table and mapping table. So, f2fs
choose to rewrite for any checkpointed data.

Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-30 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-22  7:04 [PATCH] generic/064: allow 50 extents on F2FS after fcollapse Jan Prusakowski
2026-06-23  8:46 ` [f2fs-dev] " Chao Yu
2026-06-24  7:46 ` Christoph Hellwig
2026-06-29 16:37   ` Zorro Lang
2026-06-30 12:09     ` [f2fs-dev] " Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox