From: Chuhong Yuan Date: Wed, 3 Jun 2020 16:27:28 +0000 (-0700) Subject: xfs: Add the missed xfs_perag_put() for xfs_ifree_cluster() X-Git-Tag: v5.7.6~374 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5e75707d5f574c66c6b30b6ab406a5ab9863f48c;p=users%2Fdwmw2%2Flinux.git xfs: Add the missed xfs_perag_put() for xfs_ifree_cluster() [ 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 Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Sasha Levin --- diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index d1772786af29d..8845faa8161a9 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -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