Skip to content

Commit 6f5097e

Browse files
Brian Fosterdchinner
authored andcommitted
xfs: fix xfs_ifree() error handling to not leak perag ref
For some reason commit 9a5280b ("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: 9a5280b ("xfs: reorder iunlink remove operation in xfs_ifree") Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Dave Chinner <david@fromorbit.com>
1 parent a54f78d commit 6f5097e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/xfs/xfs_inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2622,7 +2622,7 @@ xfs_ifree(
26222622
*/
26232623
error = xfs_difree(tp, pag, ip->i_ino, &xic);
26242624
if (error)
2625-
return error;
2625+
goto out;
26262626

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

0 commit comments

Comments
 (0)