Re: [PATCH v2 01/11] iomap: punch out a run of clean blocks in one call
From: Ernest Borowski
Date: Wed Nov 25 2026 - 12:38:11 EST
On Wed, Nov 25, 2026 at 06:48:14AM +0100, Christoph Hellwig wrote:
> On Tue, Nov 24, 2026 at 11:49:35PM +0100, Ernest Borowski via B4 Relay wrote:
> > + unsigned int next_blk = ifs_next_dirty_block(folio,
> > + first_blk + 1, last_blk);
> > +
> > punch(inode, folio_pos(folio) + (first_blk << blkbits),
> > - 1 << blkbits, iomap);
> > - first_blk++;
> > + (loff_t)(next_blk - first_blk) << blkbits, iomap);
>
> Overly long line.
Fixed for v3, with the position in a local variable:
loff_t pos = folio_pos(folio) + (first_blk << blkbits);
unsigned int next_blk;
next_blk = ifs_next_dirty_block(folio, first_blk + 1, last_blk);
punch(inode, pos, (loff_t)(next_blk - first_blk) << blkbits,
iomap);
first_blk = next_blk;
> Otherwise this looks fine, but did you test this on ext4 and XFS?
I have now: fstests on ntfs-next with and without patches 1 and 2, on
XFS and on ext4 (mounted with buffered_iomap), each with 1k and 4k
blocks. The list was the quick tests in the rw, punch, prealloc, enospc,
mmap, quota, zero, collapse and insert groups, plus the fsx tests
generic/{075,091,112,127,263,469}.
Every test gave the same result on both kernels:
section pass fail not run
xfs 1k 156 0 69
xfs 4k 158 0 67
ext4 1k 97 1 49
ext4 4k 99 1 47
The ext4 failure is generic/223 ("Start block 33153 not multiple of
sunit 2"), which fails without the patches too. The test kernel did not
have CONFIG_XFS_DEBUG, so the XFS error injection tests did not run.