Skip to content

Commit f5714a3

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
xfs: fix a rtgroup leak when xfs_init_zone fails
Drop the rtgrop reference when xfs_init_zone fails for a conventional device. Fixes: 4e4d520 ("xfs: add the zoned space allocator") Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent 8d7bba1 commit f5714a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/xfs/xfs_zone_alloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1249,8 +1249,10 @@ xfs_mount_zones(
12491249

12501250
while ((rtg = xfs_rtgroup_next(mp, rtg))) {
12511251
error = xfs_init_zone(&iz, rtg, NULL);
1252-
if (error)
1252+
if (error) {
1253+
xfs_rtgroup_rele(rtg);
12531254
goto out_free_zone_info;
1255+
}
12541256
}
12551257
}
12561258

0 commit comments

Comments
 (0)