]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: fix zone selection in xfs_select_open_zone_mru
authorChristoph Hellwig <hch@lst.de>
Mon, 3 Nov 2025 10:15:13 +0000 (05:15 -0500)
committerCarlos Maiolino <cem@kernel.org>
Wed, 5 Nov 2025 15:54:38 +0000 (16:54 +0100)
xfs_select_open_zone_mru needs to pass XFS_ZONE_ALLOC_OK to
xfs_try_use_zone because we only want to tightly pack into zones of the
same or a compatible temperature instead of any available zone.

This got broken in commit 0301dae732a5 ("xfs: refactor hint based zone
allocation"), which failed to update this particular caller when
switching to an enum.  xfs/638 sometimes, but not reliably fails due to
this change.

Fixes: 0301dae732a5 ("xfs: refactor hint based zone allocation")
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_alloc.c

index fa76fa4ba0f9bf87cb0624839bcf25ab3538f4a6..ef7a931ebde5a0276110ecc8e7acd66c2ded72ff 100644 (file)
@@ -615,7 +615,7 @@ xfs_select_open_zone_mru(
        lockdep_assert_held(&zi->zi_open_zones_lock);
 
        list_for_each_entry_reverse(oz, &zi->zi_open_zones, oz_entry)
-               if (xfs_try_use_zone(zi, file_hint, oz, false))
+               if (xfs_try_use_zone(zi, file_hint, oz, XFS_ZONE_ALLOC_OK))
                        return oz;
 
        cond_resched_lock(&zi->zi_open_zones_lock);