]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.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)
committerDarrick J. Wong <darrick.wong@oracle.com>
Tue, 9 Jun 2020 03:57:03 +0000 (20:57 -0700)
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>
fs/xfs/xfs_inode.c

index 64f5f9a440aedbcac894687130d6ef4d286043f1..88a9e4964802161db4da0ecfc7ed044f3a3aea58 100644 (file)
@@ -2634,8 +2634,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