diff --git a/0014-fix-the-entry-condition-of-exact-EOF-block-allocation.patch b/0014-fix-the-entry-condition-of-exact-EOF-block-allocation.patch new file mode 100644 index 0000000000000000000000000000000000000000..5f94c1776e0b2396e36a54641104622c33aa6a6e --- /dev/null +++ b/0014-fix-the-entry-condition-of-exact-EOF-block-allocation.patch @@ -0,0 +1,58 @@ +From c89b1f70b43dc7d1dd7147d5147170db651131a4 Mon Sep 17 00:00:00 2001 +From: Jinliang Zheng +Date: Mon, 24 Feb 2025 10:21:56 -0800 +Subject: xfs: fix the entry condition of exact EOF block allocation + optimization + +Source kernel commit: 915175b49f65d9edeb81659e82cbb27b621dbc17 + +When we call create(), lseek() and write() sequentially, offset != 0 +cannot be used as a judgment condition for whether the file already +has extents. + +Furthermore, when xfs_bmap_adjacent() has not given a better blkno, +it is not necessary to use exact EOF block allocation. + +Suggested-by: Dave Chinner +Signed-off-by: Jinliang Zheng +Reviewed-by: Dave Chinner +Signed-off-by: Carlos Maiolino +--- + libxfs/xfs_bmap.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c +index 1f7326acbf..07c553d924 100644 +--- a/libxfs/xfs_bmap.c ++++ b/libxfs/xfs_bmap.c +@@ -3557,12 +3557,12 @@ xfs_bmap_btalloc_at_eof( + int error; + + /* +- * If there are already extents in the file, try an exact EOF block +- * allocation to extend the file as a contiguous extent. If that fails, +- * or it's the first allocation in a file, just try for a stripe aligned +- * allocation. ++ * If there are already extents in the file, and xfs_bmap_adjacent() has ++ * given a better blkno, try an exact EOF block allocation to extend the ++ * file as a contiguous extent. If that fails, or it's the first ++ * allocation in a file, just try for a stripe aligned allocation. + */ +- if (ap->offset) { ++ if (ap->eof) { + xfs_extlen_t nextminlen = 0; + + /* +@@ -3730,7 +3730,8 @@ xfs_bmap_btalloc_best_length( + int error; + + ap->blkno = XFS_INO_TO_FSB(args->mp, ap->ip->i_ino); +- xfs_bmap_adjacent(ap); ++ if (!xfs_bmap_adjacent(ap)) ++ ap->eof = false; + + /* + * Search for an allocation group with a single extent large enough for +-- +cgit 1.2.3-korg + diff --git a/xfsprogs.spec b/xfsprogs.spec index e65fd16ccae6d3346fc57f1284117c6154497b3d..ea3fc59ead922e847ca9c403aced7f35cb297154 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,6 +1,6 @@ Name: xfsprogs Version: 6.6.0 -Release: 14 +Release: 15 Summary: Administration and debugging tools for the XFS file system License: GPL-1.0-or-later AND LGPL-2.1-or-later URL: https://xfs.wiki.kernel.org @@ -32,6 +32,7 @@ Patch10: 0010-misc-fix-reversed-calloc-arguments.patch Patch11: 0011-mkfs-fix-the-issue-of-maxpct-set-to-0-not-taking-eff.patch Patch12: 0012-xfs_repair-don-t-leak-the-rootdir-inode-when-orphana.patch Patch13: 0013-xfs_repair-fix-stupid-argument-error-in-verify_inode.patch +Patch14: 0014-fix-the-entry-condition-of-exact-EOF-block-allocation.patch %description xfsprogs are the userspace utilities that manage XFS filesystems. @@ -104,6 +105,9 @@ rm -rf %{buildroot}%{_datadir}/doc/xfsprogs/ %exclude %{_mandir}/man8/xfs_scrub* %changelog +* Fri Nov 14 2025 xuchenchen - 6.6.0-15 +- xfs: fix the entry condition of exact EOF block allocation + * Wed Nov 12 2025 liuh - 6.6.0-14 - xfs_repair: fix stupid argument error in verify_inode_chunk