]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
xfs: Add the missed xfs_perag_put() for xfs_ifree_cluster()
authorChuhong Yuan <hslester96@gmail.com>
Wed, 3 Jun 2020 16:27:28 +0000 (09:27 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Jun 2020 15:48:31 +0000 (17:48 +0200)
[ Upstream commit 8cc0072469723459dc6bd7beff81b2b3149f4cf4 ]

xfs_ifree_cluster() calls xfs_perag_get() at the beginning, but forgets to
call xfs_perag_put() in one failed path.
Add the missed function call to fix it.

Fixes: ce92464c180b ("xfs: make xfs_trans_get_buf return an error code")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/xfs_inode.c

index d1772786af29deb5401372e2472175b8e9d9bcc7..8845faa8161a9f85a06bf20017ac76d0bfc70217 100644 (file)
@@ -2639,8 +2639,10 @@ xfs_ifree_cluster(
                error = xfs_trans_get_buf(tp, mp->m_ddev_targp, blkno,
                                mp->m_bsize * igeo->blocks_per_cluster,
                                XBF_UNMAPPED, &bp);
-               if (error)
+               if (error) {
+                       xfs_perag_put(pag);
                        return error;
+               }
 
                /*
                 * This buffer may not have been correctly initialised as we