From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: linux-xfs@vger.kernel.org, Dave Chinner <dchinner@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xfs: Add the missed xfs_perag_put() for xfs_ifree_cluster()
Date: Wed, 3 Jun 2020 09:26:59 -0700 [thread overview]
Message-ID: <20200603162659.GA8230@magnolia> (raw)
In-Reply-To: <20200603092707.1424619-1-hslester96@gmail.com>
On Wed, Jun 03, 2020 at 05:27:07PM +0800, Chuhong Yuan wrote:
> 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>
Yeah, that looks like a bug, will test.
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_inode.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index d1772786af29..8845faa8161a 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
> --
> 2.26.2
>
prev parent reply other threads:[~2020-06-03 16:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 9:27 [PATCH] xfs: Add the missed xfs_perag_put() for xfs_ifree_cluster() Chuhong Yuan
2020-06-03 16:26 ` Darrick J. Wong [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200603162659.GA8230@magnolia \
--to=darrick.wong@oracle.com \
--cc=dchinner@redhat.com \
--cc=hslester96@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).