Skip to content

Commit 1614569

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
xfs: fix xfs_group release bug in xfs_verify_report_losses
Chris Mason reports that his AI tools noticed that we were using xfs_perag_put and xfs_group_put to release the group reference returned by xfs_group_next_range. However, the iterator function returns an object with an active refcount, which means that we must use the correct function to release the active refcount, which is _rele. Fixes: b8accfd ("xfs: add media verification ioctl") Reported-by: Chris Mason <clm@meta.com> Link: https://lore.kernel.org/linux-xfs/20260206030527.2506821-1-clm@meta.com/ Signed-off-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com> Signed-off-by: Carlos Maiolino <cem@kernel.org>
1 parent e764dd4 commit 1614569

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/xfs/xfs_verify_media.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ xfs_verify_report_losses(
122122

123123
error = xfs_alloc_read_agf(pag, tp, 0, &agf_bp);
124124
if (error) {
125-
xfs_perag_put(pag);
125+
xfs_perag_rele(pag);
126126
break;
127127
}
128128

@@ -158,7 +158,7 @@ xfs_verify_report_losses(
158158
if (rtg)
159159
xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
160160
if (error) {
161-
xfs_group_put(xg);
161+
xfs_group_rele(xg);
162162
break;
163163
}
164164
}

0 commit comments

Comments
 (0)