Commit eb8550fb authored by Darrick J. Wong's avatar Darrick J. Wong Committed by Carlos Maiolino
Browse files

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: 6f643c57 ("xfs: implement ->notify_failure() for XFS")
Signed-off-by: default avatar"Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarCarlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 16145698
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -304,7 +304,7 @@ xfs_dax_notify_dev_failure(

			error = xfs_alloc_read_agf(pag, tp, 0, &agf_bp);
			if (error) {
				xfs_perag_put(pag);
				xfs_perag_rele(pag);
				break;
			}

@@ -340,7 +340,7 @@ xfs_dax_notify_dev_failure(
		if (rtg)
			xfs_rtgroup_unlock(rtg, XFS_RTGLOCK_RMAP);
		if (error) {
			xfs_group_put(xg);
			xfs_group_rele(xg);
			break;
		}
	}