Skip to content

Commit eb8550f

Browse files
Darrick J. Wongcmaiolino
authored andcommitted
xfs: fix xfs_group release bug in xfs_dax_notify_dev_failure
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. Cc: <stable@vger.kernel.org> # v6.0 Fixes: 6f643c5 ("xfs: implement ->notify_failure() for XFS") 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 1614569 commit eb8550f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/xfs/xfs_notify_failure.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ xfs_dax_notify_dev_failure(
304304

305305
error = xfs_alloc_read_agf(pag, tp, 0, &agf_bp);
306306
if (error) {
307-
xfs_perag_put(pag);
307+
xfs_perag_rele(pag);
308308
break;
309309
}
310310

@@ -340,7 +340,7 @@ xfs_dax_notify_dev_failure(
340340
if (rtg)
341341
xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
342342
if (error) {
343-
xfs_group_put(xg);
343+
xfs_group_rele(xg);
344344
break;
345345
}
346346
}

0 commit comments

Comments
 (0)