xfs: fix incorrect error-out in xfs_remove
authorDarrick J. Wong <djwong@kernel.org>
Thu, 17 Nov 2022 03:20:20 +0000 (19:20 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 17 Nov 2022 03:20:20 +0000 (19:20 -0800)
Clean up resources if resetting the dotdot entry doesn't succeed.
Observed through code inspection.

Fixes: 5838d0356bb3 ("xfs: reset child dir '..' entry when unlinking child")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
fs/xfs/xfs_inode.c

index aa303be..d354ea2 100644 (file)
@@ -2479,7 +2479,7 @@ xfs_remove(
                        error = xfs_dir_replace(tp, ip, &xfs_name_dotdot,
                                        tp->t_mountp->m_sb.sb_rootino, 0);
                        if (error)
-                               return error;
+                               goto out_trans_cancel;
                }
        } else {
                /*