From: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
To: Yichong Chen <chenyichong@uniontech.com>,
Steve French <sfrench@samba.org>
Cc: Paulo Alcantara <pc@manguebit.org>,
Ronnie Sahlberg <ronniesahlberg@gmail.com>,
Shyam Prasad N <sprasad@microsoft.com>,
Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>,
linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] smb: client: free partially allocated transform folio queue
Date: Mon, 27 Jul 2026 21:30:25 +0800 [thread overview]
Message-ID: <02e13173-b4b1-4de2-a58a-b5627799b94d@chenxiaosong.com> (raw)
In-Reply-To: <20260704052714.428561-1-chenyichong@uniontech.com>
Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn>
在 2026/7/4 13:27, Yichong Chen 写道:
> netfs_alloc_folioq_buffer() may leave a partially allocated folio
> queue attached to the caller's buffer pointer when it returns an error.
>
> smb3_init_transform_rq() stores the buffer in the request only after
> allocation succeeds, so the common error path cannot free a partial
> allocation. Store the buffer pointer before checking the return value so
> err_free releases it.
>
> Signed-off-by: Yichong Chen <chenyichong@uniontech.com>
> ---
> fs/smb/client/smb2ops.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
> index 199f6aeb7b33..3fe9f0534e42 100644
> --- a/fs/smb/client/smb2ops.c
> +++ b/fs/smb/client/smb2ops.c
> @@ -4882,10 +4882,10 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst,
> size_t cur_size = 0;
> rc = netfs_alloc_folioq_buffer(NULL, &buffer, &cur_size,
> size, GFP_NOFS);
> + new->rq_buffer = buffer;
> if (rc < 0)
> goto err_free;
>
> - new->rq_buffer = buffer;
> iov_iter_folio_queue(&new->rq_iter, ITER_SOURCE,
> buffer, 0, 0, size);
>
--
ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Chinese Homepage: https://chenxiaosong.com
English Homepage: https://chenxiaosong.com/en
next prev parent reply other threads:[~2026-07-27 13:30 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-04 5:27 Yichong Chen
2026-07-27 6:16 ` Yichong Chen
2026-07-27 13:30 ` ChenXiaoSong [this message]
2026-07-27 22:35 ` Steve French
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=02e13173-b4b1-4de2-a58a-b5627799b94d@chenxiaosong.com \
--to=chenxiaosong@chenxiaosong.com \
--cc=bharathsm@microsoft.com \
--cc=chenyichong@uniontech.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pc@manguebit.org \
--cc=ronniesahlberg@gmail.com \
--cc=samba-technical@lists.samba.org \
--cc=sfrench@samba.org \
--cc=sprasad@microsoft.com \
--cc=tom@talpey.com \
/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
all inboxes | Powered by JetHome®