]> git.itanic.dy.fi Git - linux-stable/commit
xfs: fix xfs_ifree() error handling to not leak perag ref
authorBrian Foster <bfoster@redhat.com>
Thu, 22 Sep 2022 15:15:00 +0000 (08:15 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 28 Sep 2022 09:11:45 +0000 (11:11 +0200)
commit5caa3a12795383654bcb1272605801816c216726
tree4ec23c389409733b6d54767961094aeea2d07aac
parent9e7b231687fda5cdec8a6e2e87cc86256943f892
xfs: fix xfs_ifree() error handling to not leak perag ref

[ Upstream commit 6f5097e3367a7c0751e165e4c15bc30511a4ba38 ]

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>
Signed-off-by: Leah Rumancik <leah.rumancik@gmail.com>
Acked-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/xfs/xfs_inode.c