* [PATCH] xfs: fix incorrect error-out in xfs_remove
@ 2022-11-08 1:29 Darrick J. Wong
2022-11-08 9:59 ` Andrey Albershteyn
0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2022-11-08 1:29 UTC (permalink / raw)
To: xfs
From: Darrick J. Wong <djwong@kernel.org>
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>
---
fs/xfs/xfs_inode.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index aa303be11576..d354ea2b74f9 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -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 {
/*
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] xfs: fix incorrect error-out in xfs_remove
2022-11-08 1:29 [PATCH] xfs: fix incorrect error-out in xfs_remove Darrick J. Wong
@ 2022-11-08 9:59 ` Andrey Albershteyn
0 siblings, 0 replies; 2+ messages in thread
From: Andrey Albershteyn @ 2022-11-08 9:59 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs
On Mon, Nov 07, 2022 at 05:29:02PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
>
> 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>
> ---
> fs/xfs/xfs_inode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index aa303be11576..d354ea2b74f9 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -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 {
> /*
>
Looks good to me.
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
--
- Andrey
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-11-08 10:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-08 1:29 [PATCH] xfs: fix incorrect error-out in xfs_remove Darrick J. Wong
2022-11-08 9:59 ` Andrey Albershteyn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox