diff options
author | Brian Foster <bfoster@redhat.com> | 2022-05-30 10:56:33 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2022-05-30 10:56:33 +1000 |
commit | 6f5097e3367a7c0751e165e4c15bc30511a4ba38 (patch) | |
tree | fd572f54c58f1b428e07b046936f09b3ce772354 /fs/xfs/xfs_inode.c | |
parent | a54f78def73d847cb060b18c4e4a3d1d26c9ca6d (diff) | |
download | linux-6f5097e3367a7c0751e165e4c15bc30511a4ba38.tar.bz2 |
xfs: fix xfs_ifree() error handling to not leak perag ref
For some reason commit 9a5280b312e2e ("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: 9a5280b312e2e ("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>
Diffstat (limited to 'fs/xfs/xfs_inode.c')
-rw-r--r-- | fs/xfs/xfs_inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index b2879870a17e..52d6f2c7d58b 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -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) |