Re: (2) [PATCH] xfs: map pNFS layouts to the end of the extent again
From: Darrick J. Wong
Date: Tue Oct 06 2026 - 11:23:53 EST
On Tue, Oct 06, 2026 at 02:48:46PM +0900, Daejun Park wrote:
> On Mon, Oct 05, 2026 at 10:13:24PM -0700, Darrick J. Wong wrote:
> > I wonder, though, should the caller (i.e. NFS) do this trimming to
> > protect itself from other filesystems making the same mistake?
>
> I agree that nfsd needs a patch as well. nfsd4_block_proc_layoutget()
> could trim every extent after the first to start at the offset asked
> for, moving soff by the same amount for the written and unwritten ones.
> If that sounds right, I can send a patch for it.
Hmm. You're right that only the filesystem knows where the upper end of
the mapping should be. So either nfsd limits itself to trimming the
lower end (because we know that we need a mapping for at least one block
starting at @offset) or we just WARN_ON in that case and return EIO or
something?
> This patch still makes sense as it is. Mapping to the end of the extent
> can only be done in XFS, and with the trim in XFS as well, the stable
> fix does not depend on the nfsd patch. What the trim costs shows in the
> 4 KiB random row of the table: 15 LAYOUTGETs instead of 1, with no
> clear change in I/Os done.
<nod> I'm satisfied with the xfs part, so
Reviewed-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
--D