提交 6f5097e3 编写于 作者: B Brian Foster 提交者: Dave Chinner

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: NBrian Foster <bfoster@redhat.com>
Reviewed-by: NDarrick J. Wong <djwong@kernel.org>
Reviewed-by: NDave Chinner <dchinner@redhat.com>
Signed-off-by: NDave Chinner <david@fromorbit.com>
上级 a54f78de
...@@ -2622,7 +2622,7 @@ xfs_ifree( ...@@ -2622,7 +2622,7 @@ xfs_ifree(
*/ */
error = xfs_difree(tp, pag, ip->i_ino, &xic); error = xfs_difree(tp, pag, ip->i_ino, &xic);
if (error) if (error)
return error; goto out;
error = xfs_iunlink_remove(tp, pag, ip); error = xfs_iunlink_remove(tp, pag, ip);
if (error) if (error)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册