]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: put the open zone later xfs_open_zone_put
authorChristoph Hellwig <hch@lst.de>
Tue, 31 Mar 2026 15:27:25 +0000 (17:27 +0200)
committerCarlos Maiolino <cem@kernel.org>
Tue, 7 Apr 2026 11:28:47 +0000 (13:28 +0200)
The open zone is what holds the rtg reference for us.  This doesn't
matter until we support shrinking, and even then is rather theoretical
because we can't shrink away a just filled zone in a tiny race window,
but let's play safe here.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_zone_alloc.c

index 5f8b6cbeebfdb23eee09e0c73c616408bdcdb263..17a3762aa9516b787aba9b96ddf9ae428112117b 100644 (file)
@@ -182,11 +182,11 @@ xfs_open_zone_mark_full(
                list_del_init(&oz->oz_entry);
        }
        spin_unlock(&zi->zi_open_zones_lock);
-       xfs_open_zone_put(oz);
 
        wake_up_all(&zi->zi_zone_wait);
        if (used < rtg_blocks(rtg))
                xfs_zone_account_reclaimable(rtg, rtg_blocks(rtg) - used);
+       xfs_open_zone_put(oz);
 }
 
 static inline void