Skip to contentSkip to conversation

Patch "xfs: clamp a pNFS LAYOUTCOMMIT extent before computing its end" has been added to the 6.18-stable tree

PATCH Sasha Levin 1 participant 1 message Nov 10 XFS filesystem

lore
Share & tools
lore

Sasha Levin

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

xfs: clamp a pNFS LAYOUTCOMMIT extent before computing its end

to the 6.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
xfs-clamp-a-pnfs-layoutcommit-extent-before-computin.patch
and it can be found in the queue-6.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

commit bfc4e32e1fd6e887ff31ba385d39aa686a1820d9

Author: Daejun Park <[email protected]>
Date:   Thu Oct 29 11:23:01 2026 +0900

xfs: clamp a pNFS LAYOUTCOMMIT extent before computing its end

[ Upstream commit d8c2bc88460f89e543ab3af622fc8f34c7011d71 ]

xfs_fs_commit_blocks() adds the client's length to the offset before it clamps the end to the file size. A large length wraps the sum and reaches xfs_iomap_write_unwritten() unclamped. With the previous two patches the LAYOUTCOMMIT then fails with -EIO and converts nothing.

Clamp the length first.

Fixes 527851124d10 ("xfs: implement pNFS export operations")
fs/xfs/xfs_pnfs.c +1 -3
index ef08f0f619f70..b880d061ee90c 100644
@@ -311,9 +311,7 @@ xfs_fs_commit_blocks(
 		if (start > size)
 			continue;
 
-		end = start + maps[i].length;
-		if (end > size)
-			end = size;
+		end = start + min_t(u64, maps[i].length, size - start);
 
 		length = end - start;
 		if (!length)