From: "Darrick J. Wong" <djwong@kernel.org>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Cc: cem@kernel.org, ruansy.fnst@fujitsu.com,
akpm@linux-foundation.org, linux-xfs@vger.kernel.org,
linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH] xfs: fix a resource leak in xfs_alloc_buftarg()
Date: Tue, 31 Mar 2026 21:21:43 -0700 [thread overview]
Message-ID: <20260401042143.GR6254@frogsfrogsfrogs> (raw)
In-Reply-To: <20260401040241.560314-1-lihaoxiang@isrc.iscas.ac.cn>
On Wed, Apr 01, 2026 at 12:02:41PM +0800, Haoxiang Li wrote:
> In the error path, call fs_put_dax() to drop the DAX
> device reference.
>
> Fixes: 6f643c57d57c ("xfs: implement ->notify_failure() for XFS")
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Yep, that's definitely a leak...
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
--D
> ---
> fs/xfs/xfs_buf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 47edf3041631..1ca95ef46a73 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1831,6 +1831,7 @@ xfs_alloc_buftarg(
> return btp;
>
> error_free:
> + fs_put_dax(btp->bt_daxdev, mp);
> kfree(btp);
> return ERR_PTR(error);
> }
> --
> 2.25.1
>
prev parent reply other threads:[~2026-04-01 4:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 4:02 [PATCH] xfs: fix a resource leak in xfs_alloc_buftarg() Haoxiang Li
2026-04-01 4:21 ` 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=20260401042143.GR6254@frogsfrogsfrogs \
--to=djwong@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=cem@kernel.org \
--cc=lihaoxiang@isrc.iscas.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ruansy.fnst@fujitsu.com \
--cc=stable@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