Commit 6f5097e3 authored by Brian Foster's avatar Brian Foster Committed by Dave Chinner
Browse files

xfs: fix xfs_ifree() error handling to not leak perag ref



For some reason commit 9a5280b3 ("xfs: reorder iunlink remove
operation in xfs_ifree") replaced a jump to the exit path in the
event of an xfs_difree() error with a direct return, which skips
releasing the perag reference acquired at the top of the function.
Restore the original code to drop the reference on error.

Fixes: 9a5280b3 ("xfs: reorder iunlink remove operation in xfs_ifree")
Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
parent a54f78de
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2622,7 +2622,7 @@ xfs_ifree(
	 */
	error = xfs_difree(tp, pag, ip->i_ino, &xic);
	if (error)
		return error;
		goto out;

	error = xfs_iunlink_remove(tp, pag, ip);
	if (error)