Re: [PATCH v2 2/2] exportfs, xfs, nfsd: map a whole pNFS block layout in one ->map_blocks call
From: Christoph Hellwig
Date: Tue Dec 01 2026 - 03:25:05 EST
On Thu, Nov 26, 2026 at 10:52:26AM +0900, Daejun Park via B4 Relay wrote:
> ---
> The medians are over 60 LAYOUTGETs from three boots per kernel, and 160
> from eight boots for one extent. The median of one boot for one extent
> is 0.5 to 2.4 us over both kernels. pynfs block tests over the block
> layout and fstests generic/075, 091 and 263 over the block and SCSI
> layouts give the same results as without this series, with KASAN and
> lockdep. With XFS_DEBUG, generic/013, 075, 091, 112, 127 and 263 run,
> and 075, 112 and 127 fail with fsx errors as without this series.
Interesting, I've not usually seen them fail with pnfs layouts. Do
you only see this with DEBUG enabled? What is the failure mode?
> +++ b/fs/nfsd/blocklayout.c
> @@ -20,48 +20,19 @@
>
>
> /*
> - * Get an extent from the file system that contains offset. It may start
> - * below offset and may end before or after offset + length.
> + * Turn a mapping from the filesystem into an extent of the layout.
> */
> static __be32
> -nfsd4_block_map_extent(struct inode *inode, const struct svc_fh *fhp,
> - u64 offset, u64 length, u32 iomode, u64 minlength,
> - struct pnfs_block_extent *bex)
> +nfsd4_block_iomap_to_extent(const struct iomap *iomap, u32 iomode,
> + u64 minlength, struct pnfs_block_extent *bex)
Can you split the refactoring of this helper into a prep patch? That'll
make the real change much easier to read.
Also maybe break up the nfsd/exportfs change for the new interface
into one patch, and then another one for filling in more than a
single extent in xfs, as that might be useful if we have to bisect
bugs later.