Commit f5714a3c authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Carlos Maiolino
Browse files

xfs: fix a rtgroup leak when xfs_init_zone fails



Drop the rtgrop reference when xfs_init_zone fails for a conventional
device.

Fixes: 4e4d5207 ("xfs: add the zoned space allocator")
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarHans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 8d7bba1e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1249,10 +1249,12 @@ xfs_mount_zones(

		while ((rtg = xfs_rtgroup_next(mp, rtg))) {
			error = xfs_init_zone(&iz, rtg, NULL);
			if (error)
			if (error) {
				xfs_rtgroup_rele(rtg);
				goto out_free_zone_info;
			}
		}
	}

	xfs_set_freecounter(mp, XC_FREE_RTAVAILABLE, iz.available);
	xfs_set_freecounter(mp, XC_FREE_RTEXTENTS,